MeVisLab Toolbox Reference
mlMultiFileVolumeListREGOutput.h
Go to the documentation of this file.
1 // Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2 // **InsertLicense** code
3 //----------------------------------------------------------------------------------
6 
12 
13 //----------------------------------------------------------------------------------
14 #pragma once
15 
16 // Base class of output module, already being a MultiFileVolumeListImageOutput.
18 
19 ML_START_NAMESPACE
20 
21 // Forward to internally used classes.
22 class MultiFileVolume;
23 
24 //----------------------------------------------------------------------------------
27 //----------------------------------------------------------------------------------
29 {
30 public:
32  MultiFileVolumeListREGOutput(int numInputs=0, int numOutputs=0);
33 
36 
38  struct OverallTabTags {
40  std::string contentLabel;
42  std::string contentDescription;
44  std::string contentCreatorsName;
46  std::string derivationDescription;
47  };
48 
50  struct REGMatrix {
52  std::string matrixType;
54  std::string matrixValue;
56  std::pair<bool, Matrix4> conversionResult=std::pair<bool, Matrix4>(false, Matrix4(0.));
57  };
58 
60  struct REGMatrixVector {
62  std::vector<REGMatrix> regMatrixVector;
63 
65  std::string frameOfReferenceUID;
66  };
67 
69  typedef std::vector< REGMatrixVector > REGMatrixGrid;
70 
71 protected:
72 
74  void activateAttachments() override;
75 
77  void handleNotification(Field *field) override;
78 
81  void _updateVolumeInformation(MultiFileVolume *currVol) override;
82 
83 private:
84 
86  void _initializeFieldsAndMembers();
87 
89  void _resetLoadedMembers();
90 
92  std::pair<bool, std::string> _getOverviewIntro(DCMTree::Const_TreePtr dcmTree) const;
93 
95  std::pair<std::string, OverallTabTags> _getOverallTabTagFields(DCMTree::Const_TreePtr dcmTree) const;
96 
98  std::pair<std::string, REGMatrixGrid> _getDCMTreeInfos(DCMTree::Const_TreePtr dcmTree) const;
99 
103  std::pair<bool, Matrix4> _getConvertedMatrix(std::string matrixStr) const;
104 
108  REGMatrixGrid _convertREGMatrixGrid(REGMatrixGrid regMatrixGrid) const;
109 
111  Matrix4 _transposeIfSelected(const Matrix4 &matrix) const;
112 
114  REGMatrixVector _calculateConcatenatedMatrices(const REGMatrixGrid &regMatrixGrid) const;
115 
117  void _setOverallTabTagFields(const OverallTabTags &overallTabTagValues);
118 
120  void _setREGMatrixGridFields(const REGMatrixGrid &regMatrixGrid);
121 
123  void _setConcatenatedMatrixFields(const REGMatrixVector &matrixGrid);
124 
125  // Input fields:
127  BoolField *_transposeMatricesFld;
128 
129  // Output fields:
131  StringField *_infoFld;
132 
133  // Top level segmentation tags:
135  StringField *_contentLabelFld;
136 
138  StringField *_contentDescriptionFld;
139 
141  StringField *_contentCreatorsNameFld;
142 
144  StringField *_derivationDescriptionFld;
145 
147  static const size_t NumRegSequenceEntriesFields = 3;
148 
150  StringField *_frameOfReferenceUIDFld[NumRegSequenceEntriesFields];
151 
153  static const size_t NumMatrixFields = 3;
154 
156  Matrix4Field *_matrixValuesFld[NumRegSequenceEntriesFields][NumMatrixFields];
157 
159  StringField *_matrixTypeFld[NumRegSequenceEntriesFields][NumMatrixFields];
160 
162  BoolField *_matrixValidFld[NumRegSequenceEntriesFields][NumMatrixFields];
163 
165  Matrix4Field *_concatenatedMatrixValuesFld[NumRegSequenceEntriesFields];
166 
168  BoolField *_concatenatedMatrixValidFld[NumRegSequenceEntriesFields];
169 
171  BaseField *_outputCurrentRegistrationSequenceTreeFld;
172 
175  NotifyField *_updateREGOutputInformationDoneFld;
176 
179 };
180 
181 ML_END_NAMESPACE
182 
#define MLDIRECTDICOMIMPORTOUTPUTS_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
Base class for all fields used in the ML.
Definition: mlField.h:73
Field to encapsulate a 4x4 matrix.
Definition: mlFields.h:2420
The ML module class MultiFileVolumeListImageOutput for extending the number of image outputs of Multi...
The ML module class MultiFileVolumeListREGOutput providing an additional output for spatial REG DICOM...
void _updateVolumeInformation(MultiFileVolume *currVol) override
This is called by the super class if the volume has changed.
MultiFileVolumeListREGOutput(int numInputs=0, int numOutputs=0)
Constructor.
~MultiFileVolumeListREGOutput() override
Destructor.
void handleNotification(Field *field) override
Handles changes of fields.
std::vector< REGMatrixVector > REGMatrixGrid
The type of a list of all matrix values from all Registration sequence entries.
void activateAttachments() override
Called after changes of fields without handleNotification calls.
Management class used by DirectDicomImport to create, represent and describe volumes composed of mult...
Field without value for notifications.
Definition: mlFields.h:1049
Field to encapsulate a string value.
Definition: mlFields.h:1000
#define ML_MODULE_CLASS_HEADER(className)
Like ML_CLASS_HEADER for the usage of derived classes from Module.
The ML module class MultiFileVolumeListImageOutput for extending the number of image outputs of Multi...
boost::shared_ptr< const Tree > Const_TreePtr
Definition: DCMTree_Lib.h:73
Tmat4< MLdouble > Matrix4
The standard 4x4 matrix of type double.
Definition: mlMatrix4.h:726
std::string contentLabel
Value extracted from same named DICOM tag.
std::string derivationDescription
Value extracted from same named DICOM tag.
std::string contentCreatorsName
Value extracted from same named DICOM tag.
std::string contentDescription
Value extracted from same named DICOM tag.
The Vector type representing matrices of one Registration sequence entries.
std::vector< REGMatrix > regMatrixVector
The matrices from the Matrix Sequence.
std::string frameOfReferenceUID
The FrameOfReferenceUID if available, otherwise empty.
std::string matrixType
The type of the matrix (RIGID, RIGID_SCALE, AFFINE)