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.
20
23
24// Needed to maintain the DICOM pixel frame-, tag-, and tree caches alife as long as instances of this module exist.
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
34
35// Forward to internally used classes.
36class MultiFileVolume;
37class DicomTagDumpFieldAddOn;
38class RelatedDicomVolumeFieldAddOn;
39
40//----------------------------------------------------------------------------------
43//----------------------------------------------------------------------------------
45{
46public:
47
63 int numOutputs=0,
68
71
72public:
73
78
81
84
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
121protected:
122
124 void activateAttachments () override;
125
128
132
137
138 // Tool function useful to create text dumps of extracted tag information in derived classes:
148 DCMTree::TagId tagId,
149 const std::string prefixStr,
150 std::string &resultStr,
151 const std::string &lineBreakStr="\n");
152
153 // Tool function useful to create text dumps of extracted tag information in derived classes:
158 DCMTree::TagId tagId,
159 const std::string prefixStr,
160 std::string &resultStr);
161
162 // Tool function useful to create text dumps of extracted tag information in derived classes:
173 const std::string seqNameStr,
174 std::string &resultStr,
175 const std::string &sep=".");
176
177private:
178
180
182 void _initFieldsAndMembers();
183
187 bool _updateLoadedCache();
188
194 MultiFileVolume *_selectVolumeFromListAndFields();
195
200 //void _clampOutVolIndexField();
201
204 void _updateInformationFields(MultiFileVolume *outVolToUse);
205
207
210 MLDICOMCachedIOProxies _cacheProxies;
211
213 DicomTagDumpFieldAddOn *_dicomTagDumpFieldAddOn;
214
216 RelatedDicomVolumeFieldAddOn *_relatedDicomVolumeFieldAddOn;
217
219 std::string _previousCacheFileContent;
220
222 MultiFileVolumeListRefCountedPtr _outVolumesFromCacheFile;
223
225 MultiFileVolume *_currOutVolume;
226
227 // --------------- User modifiable fields.
228
231 BoolField *_useBaseInputFld;
232
234 NotifyField *_loadResultCacheFld;
235
238 BoolField *_autoLoadResultCacheFld;
239
241 StringField *_cacheFilePathFld;
242
247 BaseField *_inputAccessConnectorFld;
248
252 BaseField *_inputMessageFilterPluginFld;
253
256 BaseField *_outputAccessConnectorFld;
257
259 IntField *_outVolIdxFld;
260
261 // --------------- Read-only output information fields
263 IntField *_numVolumesFld;
264
266 StringField *_issuesFld;
267
269 StringField *_volumeInfoDumpFld;
270
273 NotifyField *_updateBaseOutputInformationDoneFld;
274
277};
278
279
Project global and OS specific declarations.
#define MLDIRECTDICOMIMPORTOUTPUTS_EXPORT
DLL export macro definition.
Class to wrap a tag-id.
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:797
Field to encapsulate a boolean value.
Definition mlFields.h:58
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:126
Base class for an image processing module of the ML.
Definition mlModule.h:151
The ML module base class MultiFileVolumeListBaseOutput used to implement further output modules for t...
DicomTagDumpFieldAddOn * getDicomTagDumpFieldAddOn() const
Returns the DicomTagDumpFieldAddOn if installed or nullptr otherwise.
BaseField * getInputAccessConnectorFld() const
Access methods to optional fields which return nullptr if fields are not requested during constructor...
static std::string extractValueAndAppend(DCMTree::Const_TreePtr dcmTree, DCMTree::TagId tagId, const std::string prefixStr, std::string &resultStr, const std::string &lineBreakStr="\n")
Retrieves the tag value of tag with id tagId from dcmTree and adds it after prefixStr as string to re...
virtual void _updateVolumeInformation(MultiFileVolume *currVol)
This is called to notify derived classes about volume changes.
void handleNotification(Field *field) override
Handle field changes of the field field.
void installRelatedDicomVolumeFieldAddOn()
If called then a RelatedDicomVolumFieldAddOn is created and managed additionally to all other fields;...
BoolField & getUseBaseInputFld() const
Access methods to fields; see field members for documentation.
virtual DicomConfigurableMessageFilterBaseRefCountedPtr _getMessageCollector()
Convenience routine to returns a new instance of a message collector to be used for message handling;...
RelatedDicomVolumeFieldAddOn * getRelatedDicomVolumeFieldAddOn() const
Returns the RelatedDicomVolumeFieldAddOn 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.
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...
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.
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.
MultiFileVolume * getCurrentlySetVolume()
Returns the currently set volume or nullptr if none is set.
MultiFileVolumeList * getCurrentVolumeList()
Returns the pointer to the currently used volume list if there is one or nullptr otherwise.
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:659
Class managing fields fields to show and reference other volumes in a MultiFileVolumeList.
Field to encapsulate a string value.
Definition mlFields.h:610
#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.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
boost::shared_ptr< const Tag > Const_TagPtr
Definition DCMTree_Lib.h:63
boost::shared_ptr< const Tree > Const_TreePtr
Definition DCMTree_Lib.h:73