MeVisLab Toolbox Reference
mlDicomSaveBase.h
Go to the documentation of this file.
1 // Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2 // **InsertLicense** code
3 //----------------------------------------------------------------------------------
5 
24 //----------------------------------------------------------------------------------
25 #pragma once
26 
27 // Local includes
28 #include "MLDicomOutputsSystem.h"
29 
30 // ML includes
31 #include <mlModuleIncludes.h>
32 
33 // DICOM tree etc.
34 #include <DCMTree_Tree.h>
35 
38 
39 // AddOn for DicomTagDumps.
41 
42 ML_START_NAMESPACE
43 
44 // Forwards
45 class DicomMessageCollector;
46 
47 //----------------------------------------------------------------------------------
48 // See above.
49 //----------------------------------------------------------------------------------
51 {
52 public:
53 
55  DicomSaveBase(int numInputs=1, int numOutputs=0);
56 
58 
59  inline const BoolField &getCopyOtherInputTagsFld() const { return *_copyOtherInputTagsFld ; }
60  inline BoolField &getDumpPrivateTagValuesFld() const { return _dicomTagDumpFieldAddOn.getDumpPrivateTagValuesFld(); }
61  inline const StringField &getFileNameField() const { return *_fileNameFld ; }
62  inline const NotifyField &getInheritDICOMTagsFld() const { return *_inheritDICOMTagsFld ; }
63  inline const BoolField &getPostBadParamErrorsField() const { return *_postBadParamErrorsFld ; }
64  inline NotifyField &getSaveField() const { return *_saveFld ; }
65  inline StringField &getStatusField() const { return *_statusFld ; }
66  inline IntField &getTagDumpSizeFld() const { return _dicomTagDumpFieldAddOn.getTagDumpSizeFld(); }
67  inline StringField &getTagDumpFld() const { return _dicomTagDumpFieldAddOn.getTagDumpFld(); }
69 
75  static std::string checkXYZValues(const ImageVector &ext);
76 
80  static std::string checkMaximumPixelDataSize(const PagedImage &inImg);
81 
82 protected:
83 
85  void handleNotification(Field *field) override;
86 
88  void activateAttachments() override;
89 
93 
95  inline DCMTree::Const_TreePtr _getCurrentOriginalInputTree() const { return _currentOriginalInputTree; }
96 
98  inline DCMTree::TreePtr _getCurrentModifiableTree() const { return _currentModifiableTree; }
99 
101  inline PagedImage *_getCurrentInImg() const { return _currentInImg; }
102 
104  inline bool &_getAllowNULLInputTree() { return _allowNULLInputTree; }
105 
110  virtual std::string _checkConsistency() const=0;
111 
116  virtual std::string _setUpTreeContent() = 0;
117 
118 
119  // Stuff below is sometimes useful in derived classes but mostly not needed:
120  //--------------------------------------------------------------------------
121 
126 
141  virtual std::string _getInputImageConfiguration(int inputImageConnector,
142  DCMTree::Const_TreePtr &originalInputImageTree,
143  DCMTree::TreePtr &resultDcmTree,
144  PagedImage *&inImg);
145 
156  virtual void _updateInputState();
157 
160  virtual void _updateTagDump(DCMTree::Const_TreePtr dcmTree);
161 
167 
174 
176  const FieldContainer *treeInfos=nullptr);
177 
180  virtual void _save();
181 
184 
187 
188 private:
190  DCMTree::Const_TreePtr _currentOriginalInputTree;
191 
193  DCMTree::TreePtr _currentModifiableTree;
194 
196  PagedImage *_currentInImg;
197 
200  bool _allowNULLInputTree;
201 
203 
206  BoolField *_copyOtherInputTagsFld;
208  NotifyField *_inheritDICOMTagsFld;
210 
212 
214  NotifyField *_saveFld;
216  StringField *_fileNameFld;
218 
222  BoolField *_postBadParamErrorsFld;
223 
225  StringField *_statusFld;
226 
229  BaseField *_inputModifierListFld;
230 
233 };
234 
235 ML_END_NAMESPACE
Project global and OS specific declarations.
#define MLDICOMOUTPUTS_EXPORT
DLL export macro definition.
Field to encapsulate a pointer to an ML base object.
Definition: mlFields.h:1187
Field to encapsulate a boolean value.
Definition: mlFields.h:62
Class to collect messages and errors related to a given frame handle.
virtual void _updateInputState()
Checks the input state and updates status fields accordingly: it gets the validity of the expected in...
virtual void _createInputModifierConnector()
If called then an input Base field for a DicomModifyList object is installed, typically called in con...
const NotifyField & getInheritDICOMTagsFld() const
virtual std::string _getInputImageConfiguration(int inputImageConnector, DCMTree::Const_TreePtr &originalInputImageTree, DCMTree::TreePtr &resultDcmTree, PagedImage *&inImg)
Returns some important parameters of the module's input image configuration:
virtual void _inheritFieldValuesFromDCMTree(DCMTree::Const_TreePtr dcmTree)=0
Tries to copy all DICOM tag field information from a given DCMTree; dcmTree will be nullptr if not av...
const BoolField & getCopyOtherInputTagsFld() const
Access to internal fields fields, see corresponding member documentation for details.
DCMTree::TreePtr _getCurrentModifiableTree() const
Returns content of _currentModifiableTree after the recent call of _updateInputState().
IntField & getTagDumpSizeFld() const
virtual std::string _applyInputModifiersIfAvailable(DCMTree::TreePtr dcmTree, const FieldContainer *treeInfos=nullptr)
If an InputModifierConnector is available and modifiers are connected then apply them to dcmTree,...
const BoolField & getPostBadParamErrorsField() const
virtual void _updateTagDump(DCMTree::Const_TreePtr dcmTree)
Updates the _dicomTagDumpFieldAddOn according to the content of dcmTree; called automatically by _sav...
StringField & getTagDumpFld() const
DicomTagDumpFieldAddOn _dicomTagDumpFieldAddOn
Field AddOns managing the DICOM tag dump as string field.
void activateAttachments() override
Updates the internal module state after loading or cloning the module, and enables notification handl...
PagedImage * _getCurrentInImg() const
Returns content of _currentInImg after the recent call of _updateInputState().
virtual void _save()
Saves the DICOM object in the file(s) defined by _fileNameFld.
BoolField & getDumpPrivateTagValuesFld() const
const StringField & getFileNameField() const
static std::string checkXYZValues(const ImageVector &ext)
If Y and X are used as row and column, they can hold at most values of 65535, because these tags are ...
NotifyField & getSaveField() const
TreeAndVolumeInputFieldAddOn _dcmTreeInputFieldAddOn
Field AddOn to manage selectors and input connectors for DCMTrees and MultiFileVolumes.
virtual std::string _checkConsistency() const =0
Checks for invalid parameters which could cause problems in file creation and return textual descript...
bool & _getAllowNULLInputTree()
Provides access to _allowNULLInputTree.
virtual std::string _setUpTreeContent()=0
Allows the user to apply changes to the tree before it is saved; called after _updateInputState() and...
DicomSaveBase(int numInputs=1, int numOutputs=0)
Constructor, currently 0-3 input images are allowed to be set by derived modules.
static std::string checkMaximumPixelDataSize(const PagedImage &inImg)
Returns an empty string if the passed PagedImage describes an image whose pixel data would fit into a...
virtual DCMTree::Const_TreePtr _getInputDCMTree(DicomMessageCollector &dcmMsgCollector)
Gets a DCMTree from the selected input or a nullptr tree if that is not available or empty.
void handleNotification(Field *field) override
Handles field changes of the field field.
StringField & getStatusField() const
DCMTree::Const_TreePtr _getCurrentOriginalInputTree() const
Returns content of the _currentOriginalInputTree after the recent call of _updateInputState().
Class managing fields to show and handle a DICOM tree tag dump.
Defines the class FieldContainer to encapsulate a vector of fields for (see class Field).
Base class for all fields used in the ML.
Definition: mlField.h:73
Field to encapsulate an integer value.
Definition: mlFields.h:161
Base class for an image processing module of the ML.
Definition: mlModule.h:156
Field without value for notifications.
Definition: mlFields.h:1049
Class which represents an image, which manages properties of an image and image data which is located...
Definition: mlPagedImage.h:70
Field to encapsulate a string value.
Definition: mlFields.h:1000
Class implementing a FieldAddOn managing fields and functionality for a multi- purpose input connecto...
#define ML_MODULE_CLASS_HEADER(className)
Like ML_CLASS_HEADER for the usage of derived classes from Module.
Header file for the DicomTagDumpFieldAddOn which manages fields to show and handle a DICOM tree tag d...
Header file of a FieldAddOn managing fields and functionality for a multi- purpose input connector fo...
boost::shared_ptr< const Tree > Const_TreePtr
Definition: DCMTree_Lib.h:73
boost::shared_ptr< Tree > TreePtr
shared pointer to a DCMTree::Tree
Definition: DCMTree_Lib.h:70