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
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
43
44// Forwards
45class DicomMessageCollector;
46
47//----------------------------------------------------------------------------------
48// See above.
49//----------------------------------------------------------------------------------
51{
52public:
53
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
82protected:
83
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
144 PagedImage *&inImg);
145
156 virtual void _updateInputState();
157
161
167
174
176 const FieldContainer *treeInfos=nullptr);
177
180 virtual void _save();
181
184
187
188private:
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
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:797
Field to encapsulate a boolean value.
Definition mlFields.h:58
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...
IntField & getTagDumpSizeFld() 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...
NotifyField & getSaveField() const
DCMTree::TreePtr _getCurrentModifiableTree() const
Returns content of _currentModifiableTree after the recent call of _updateInputState().
PagedImage * _getCurrentInImg() const
Returns content of _currentInImg after the recent call of _updateInputState().
const BoolField & getCopyOtherInputTagsFld() const
Access to internal fields fields, see corresponding member documentation for details.
const StringField & getFileNameField() 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,...
virtual void _updateTagDump(DCMTree::Const_TreePtr dcmTree)
Updates the _dicomTagDumpFieldAddOn according to the content of dcmTree; called automatically by _sav...
DicomTagDumpFieldAddOn _dicomTagDumpFieldAddOn
Field AddOns managing the DICOM tag dump as string field.
const NotifyField & getInheritDICOMTagsFld() const
void activateAttachments() override
Updates the internal module state after loading or cloning the module, and enables notification handl...
virtual void _save()
Saves the DICOM object in the file(s) defined by _fileNameFld.
bool & _getAllowNULLInputTree()
Provides access to _allowNULLInputTree.
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 ...
StringField & getTagDumpFld() const
TreeAndVolumeInputFieldAddOn _dcmTreeInputFieldAddOn
Field AddOn to manage selectors and input connectors for DCMTrees and MultiFileVolumes.
StringField & getStatusField() const
virtual std::string _checkConsistency() const =0
Checks for invalid parameters which could cause problems in file creation and return textual descript...
const BoolField & getPostBadParamErrorsField() const
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...
BoolField & getDumpPrivateTagValuesFld() const
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.
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:126
Base class for an image processing module of the ML.
Definition mlModule.h:151
Field without value for notifications.
Definition mlFields.h:659
Class which represents an image, which manages properties of an image and image data which is located...
Field to encapsulate a string value.
Definition mlFields.h:610
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...
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
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:72