MeVisLab Toolbox Reference
mlMultiFileVolumeListBaseOutput.h
Go to the documentation of this file.
1 // Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2 // **InsertLicense** code
3 //----------------------------------------------------------------------------------
5 
10 //----------------------------------------------------------------------------------
11 #pragma once
12 
14 
15 // ML includes
16 #include <mlModuleIncludes.h>
17 
18 // List of volumes loaded or accessed via connected module.
19 #include <mlMultiFileVolumeList.h>
20 
23 
24 // Needed to maintain the DICOM pixel frame-, tag-, and tree caches alife as long as instances of this module exist.
25 #include <mlDICOMCachedIOProxies.h>
26 
27 // Needed to maintain the DICOM pixel frame-, tag-, and tree caches alife as long as instances of this module exist.
28 #include <DCMTree_Lib.h>
29 
32 
33 ML_START_NAMESPACE
34 
35 // Forward to internally used classes.
36 class MultiFileVolume;
37 class DicomTagDumpFieldAddOn;
38 class RelatedDicomVolumeFieldAddOn;
39 
40 //----------------------------------------------------------------------------------
43 //----------------------------------------------------------------------------------
45 {
46 public:
47 
63  int numOutputs=0,
64  bool autoInstallTagDumpFieldAddOn=true,
65  bool installInputAccessConnector=true,
66  bool installInputMessageFilterPlugin=true,
67  bool installOutputAccessConnector=true);
68 
71 
72 public:
73 
77  virtual void updateToVolume(MultiFileVolume *outVolToUse);
78 
81 
84 
86  MultiFileVolumeListRefCountedPtr getCurrentVolumeListRefCounted();
87 
89  BoolField &getUseBaseInputFld () const { return *_useBaseInputFld ; }
90  NotifyField &getLoadResultCacheFld () const { return *_loadResultCacheFld ; }
91  BoolField &getAutoLoadResultCacheFld () const { return *_autoLoadResultCacheFld ; }
92  StringField &getCacheFilePathFld () const { return *_cacheFilePathFld ; }
93  IntField &getOutVolIdxFld () const { return *_outVolIdxFld ; }
94  const IntField &getNumVolumesFld () const { return *_numVolumesFld ; }
95  const StringField &getIssuesFld () const { return *_issuesFld ; }
96  const StringField &getVolumeInfoDumpFld () const { return *_volumeInfoDumpFld ; }
98 
100  BaseField *getInputAccessConnectorFld () const { return _inputAccessConnectorFld ; }
101  BaseField *getInputMessageFilterPluginFld() const { return _inputMessageFilterPluginFld; }
102  BaseField *getOutputAccessConnectorFld () const { return _outputAccessConnectorFld ; }
104 
105  // Convenience support for FieldAddOns:
106 
110 
113 
117 
120 
121 protected:
122 
124  void activateAttachments () override;
125 
127  void handleNotification (Field *field) override;
128 
132 
136  virtual DicomConfigurableMessageFilterBaseRefCountedPtr _getMessageCollector();
137 
138  // Tool function useful to create text dumps of extracted tag information in derived classes:
146  static std::string extractValueAndAppend(DCMTree::Const_TreePtr dcmTree,
147  DCMTree::TagId tagId,
148  const std::string prefixStr,
149  std::string &resultStr);
150 
151  // Tool function useful to create text dumps of extracted tag information in derived classes:
156  DCMTree::TagId tagId,
157  const std::string prefixStr,
158  std::string &resultStr);
159 
160  // Tool function useful to create text dumps of extracted tag information in derived classes:
170  DCMTree::TagId seqTagId,
171  const std::string seqNameStr,
172  std::string &resultStr,
173  const std::string &sep=".");
174 
175 private:
176 
178 
180  void _initFieldsAndMembers();
181 
185  bool _updateLoadedCache();
186 
192  MultiFileVolume *_selectVolumeFromListAndFields();
193 
198  //void _clampOutVolIndexField();
199 
202  void _updateInformationFields(MultiFileVolume *outVolToUse);
203 
205 
208  MLDICOMCachedIOProxies _cacheProxies;
209 
211  DicomTagDumpFieldAddOn *_dicomTagDumpFieldAddOn;
212 
214  RelatedDicomVolumeFieldAddOn *_relatedDicomVolumeFieldAddOn;
215 
217  std::string _previousCacheFileContent;
218 
220  MultiFileVolumeListRefCountedPtr _outVolumesFromCacheFile;
221 
223  MultiFileVolume *_currOutVolume;
224 
225  // --------------- User modifiable fields.
226 
229  BoolField *_useBaseInputFld;
230 
232  NotifyField *_loadResultCacheFld;
233 
236  BoolField *_autoLoadResultCacheFld;
237 
239  StringField *_cacheFilePathFld;
240 
245  BaseField *_inputAccessConnectorFld;
246 
250  BaseField *_inputMessageFilterPluginFld;
251 
254  BaseField *_outputAccessConnectorFld;
255 
257  IntField *_outVolIdxFld;
258 
259  // --------------- Read-only output information fields
261  IntField *_numVolumesFld;
262 
264  StringField *_issuesFld;
265 
267  StringField *_volumeInfoDumpFld;
268 
271  NotifyField *_updateBaseOutputInformationDoneFld;
272 
275 };
276 
277 
278 ML_END_NAMESPACE
Project global and OS specific declarations.
#define MLDIRECTDICOMIMPORTOUTPUTS_EXPORT
DLL export macro definition.
Class to wrap a tag-id.
Definition: DCMTree_TagId.h:40
An instance of this class creates singleton proxies for DICOMCachedIO cache classes such that all cac...
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 managing fields to show and handle a DICOM tree tag dump.
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
The ML module base class MultiFileVolumeListBaseOutput used to implement further output modules for t...
virtual void _updateVolumeInformation(MultiFileVolume *currVol)
This is called to notify derived classes about volume changes.
static std::string extractValueAndAppend(DCMTree::Const_TreePtr dcmTree, DCMTree::TagId tagId, const std::string prefixStr, std::string &resultStr)
Retrieves the tag value of tag with id tagId from dcmTree and adds it after prefixStr as string to re...
void handleNotification(Field *field) override
Handle field changes of the field field.
BoolField & getUseBaseInputFld() const
Access methods to fields; see field members for documentation.
void installRelatedDicomVolumeFieldAddOn()
If called then a RelatedDicomVolumFieldAddOn is created and managed additionally to all other fields;...
virtual DicomConfigurableMessageFilterBaseRefCountedPtr _getMessageCollector()
Convenience routine to returns a new instance of a message collector to be used for message handling;...
DicomTagDumpFieldAddOn * getDicomTagDumpFieldAddOn() const
Returns the DicomTagDumpFieldAddOn if installed or nullptr otherwise.
static DCMTree::Const_TagPtr extractSequenceAndAppend(DCMTree::Const_TreePtr dcmTree, DCMTree::TagId seqTagId, const std::string seqNameStr, std::string &resultStr, const std::string &sep=".")
Retrieves the sequence tag with id tagId from dcmTree and adds information about it to resultStr; the...
virtual void updateToVolume(MultiFileVolume *outVolToUse)
Update image output and internal pointer to the passed MultiFileVolume.
MultiFileVolumeList * getCurrentVolumeList()
Returns the pointer to the currently used volume list if there is one or nullptr otherwise.
void activateAttachments() override
Update internal module state after load or clone and enable notification handling again.
MultiFileVolumeListRefCountedPtr getCurrentVolumeListRefCounted()
Returns the refcounted base pointer to the currently used volume list if there is one or nullptr othe...
RelatedDicomVolumeFieldAddOn * getRelatedDicomVolumeFieldAddOn() const
Returns the RelatedDicomVolumeFieldAddOn if installed or nullptr otherwise.
BaseField * getInputAccessConnectorFld() const
Access methods to optional fields which return nullptr if fields are not requested during constructor...
void installDicomTagDumpFieldAddOn()
If called then a DicomTagDumpFieldAddOn is created and managed additionally to all other fields; shou...
MultiFileVolumeListBaseOutput(int numInputs=0, int numOutputs=0, bool autoInstallTagDumpFieldAddOn=true, bool installInputAccessConnector=true, bool installInputMessageFilterPlugin=true, bool installOutputAccessConnector=true)
Constructor.
MultiFileVolume * getCurrentlySetVolume()
Returns the currently set volume or nullptr if none is set.
static int extractIntValueAndAppend(DCMTree::Const_TreePtr dcmTree, DCMTree::TagId tagId, const std::string prefixStr, std::string &resultStr)
Same as _extractValueAndAppend with the difference that it is tried to additionally convert the tag v...
~MultiFileVolumeListBaseOutput() override
Destructor.
Class managing a list of MultiFileVolume instances for the DirectDicomImport module; taking ownership...
Management class used by DirectDicomImport to create, represent and describe volumes composed of mult...
Field without value for notifications.
Definition: mlFields.h:1049
Class managing fields fields to show and reference other volumes in a MultiFileVolumeList.
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.
An instance of this class creates singleton proxies for DICOMCachedIO cache classes such that all cac...
Header file of ML module class DicomConfigurableMessageFilter usable as plugin for modules which prod...
Reference counted Base class encapsulating a list of MultiFileVolume instances.
Class managing a list of MultiFileVolume instances.
boost::shared_ptr< const Tag > Const_TagPtr
Definition: DCMTree_Lib.h:63
boost::shared_ptr< const Tree > Const_TreePtr
Definition: DCMTree_Lib.h:73