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
42ML_START_NAMESPACE
43
44// Forwards
45class DicomMessageCollector;
46
47//----------------------------------------------------------------------------------
48// See above.
49//----------------------------------------------------------------------------------
51{
52public:
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
82protected:
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
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
235ML_END_NAMESPACE
Project global and OS specific declarations.
#define MLDICOMOUTPUTS_EXPORT
DLL export macro definition.
Class to collect messages and errors related to a given frame handle.
virtual void _updateInputState()
virtual void _createInputModifierConnector()
IntField & getTagDumpSizeFld() const
virtual std::string _getInputImageConfiguration(int inputImageConnector, DCMTree::Const_TreePtr &originalInputImageTree, DCMTree::TreePtr &resultDcmTree, PagedImage *&inImg)
virtual void _inheritFieldValuesFromDCMTree(DCMTree::Const_TreePtr dcmTree)=0
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)
virtual void _updateTagDump(DCMTree::Const_TreePtr dcmTree)
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()
bool & _getAllowNULLInputTree()
Provides access to _allowNULLInputTree.
static std::string checkXYZValues(const ImageVector &ext)
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
const BoolField & getPostBadParamErrorsField() const
virtual std::string _setUpTreeContent()=0
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)
BoolField & getDumpPrivateTagValuesFld() const
virtual DCMTree::Const_TreePtr _getInputDCMTree(DicomMessageCollector &dcmMsgCollector)
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.
Module(int numInputImages, int numOutputImages)
friend class PagedImage
Definition mlModule.h:157
#define ML_MODULE_CLASS_HEADER(className)
boost::shared_ptr< const Tree > Const_TreePtr
Definition DCMTree_Lib.h:67
boost::shared_ptr< Tree > TreePtr
Shared pointer to a DCMTree::Tree.
Definition DCMTree_Lib.h:66
TImageVector< MLint > ImageVector
Defines the standard ImageVector type that is used by the ML for indexing and coordinates.