MeVisLab Toolbox Reference
mlTreeAndVolumeInputFieldAddOn.h
Go to the documentation of this file.
1// Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2// **InsertLicense** code
3//----------------------------------------------------------------------------------
6
11//----------------------------------------------------------------------------------
12#pragma once
13
14#include "MLDicomModifySystem.h"
15
16// Base class for SringLineFilter
17#include <mlFieldAddOnBase.h>
18
19// String vector and tools.
20#include <mlReleaseTools.h>
21
24#include <DCMTree_Lib.h>
25
26ML_START_NAMESPACE
27
28// Forwards.
29class MultiFileVolume;
30class MultiFileVolumeList;
31class MultiFileVolumeListRefCounted;
32
33//----------------------------------------------------------------------------------
36//----------------------------------------------------------------------------------
38{
39public:
47
49 inline const std::vector<std::string> &getInputSelectorStrings() const { return _inputSelectorEnumerators; }
50
59 InputConfigurations inputConfig,
60 bool createFileInput,
61 bool createMultiFileVolumeCacheInput=false,
62 bool allowEmptyFileNames=false);
63
65 void addFields() override;
66
69
73
79
83
87
91
93 void setAllowEmptyFileNames(bool allow){ _allowEmptyFileNames = allow; }
94
97
99
100 inline InputConnectorField *getInput0Fld () const { return _input0Fld ; }
101 inline InputConnectorField *getInput1Fld () const { return _input1Fld ; }
102 inline InputConnectorField *getInput2Fld () const { return _input2Fld ; }
103 inline BaseField &getInputBaseFld () const { return *_inputBaseFld ; }
106 inline EnumField &getInputSelectorFld () const { return *_inputSelectorFld ; }
108 inline IntField &getNumVolumesFld () const { return *_numVolumesFld ; }
111 inline size_t getImageConnector0EnumIndex () const { return _imageConnector0EnumIndex ; }
112 inline size_t getImageConnector1EnumIndex () const { return _imageConnector1EnumIndex ; }
113 inline size_t getImageConnector2EnumIndex () const { return _imageConnector2EnumIndex ; }
114 inline size_t getBaseConnectorEnumIndex () const { return _baseConnectorEnumIndex ; }
115 inline size_t getFileEnumIndex () const { return _fileEnumIndex ; }
118
119protected:
120
124
126
129
132
135
139
141
144
147
150
154
157
160
163
166
169
172
176
178
180 std::vector<std::string> _inputSelectorEnumerators;
181
184
187
190
193
196
199
201 MultiFileVolumeListRefCountedPtr _lastLoadedMultiFileVolumeList;
202
205
208
212
213};
214
215ML_END_NAMESPACE
Project global and OS specific declarations.
#define ML_DICOM_MODIFY_EXPORT
DLL export macro definition.
Class to collect messages and errors related to a given frame handle.
FieldChangeState
Describes the type of a field changes detected in handleFieldChanges(Field *field).
FieldAddOnBase(FieldContainer &fieldContainerRef)
Constructor, setting the reference of the FieldContainer managing the fields.
IntField * _numVolumesFld
Read-only: Output field showing the current number of available DICOM volumes at the selected input.
MultiFileVolumeListRefCountedPtr _lastLoadedMultiFileVolumeList
Stores the most recently loaded MultiFileVolumeList.
const bool _createMultiFileVolumeCacheInput
If true then also an enumerator entry for MultFileVolumeCache loading will be created,...
DCMTree::Const_TreePtr _recentlyLoadedTree
The recently loaded DICOM tree.
DCMTree::Const_TreePtr getDCMTree(DicomMessageCollector &dcmMsgCollector) const
TreeAndVolumeInputFieldAddOn(Module &moduleRef, InputConfigurations inputConfig, bool createFileInput, bool createMultiFileVolumeCacheInput=false, bool allowEmptyFileNames=false)
BoolField * _warnNonExistingFileOnBrowsingFld
Flag passed to the GUI script: if true then selected non-existing files are warned,...
BoolField * _warnDirectoriesOnBrowsingFld
Flag passed to the GUI script: if true then selected directories directories are warned,...
IntField * _inputVolumeIndexFld
Selector for a volume from inside a connected MultiFileVolumeList.
const bool _createFileInput
If true then also a file input interface will be created, otherwise not.
const InputConfigurations _inputConfig
Stores the input configuration which shall be handled by this FieldAddOn.
const MultiFileVolumeList * getMultiFileVolumeList() const
StringField * _unresolvedFileNameFld
GUI-only file path for the unresolved DICOM file or MultiFileVolume, may be nullptr if not created; o...
size_t _imageConnector1EnumIndex
Enumerator index for image connector 1, will be std::string::npos if not defined.
size_t _baseConnectorEnumIndex
Enumerator index for the base connector, will be std::string::npos if not defined.
MultiFileVolumeListRefCounted * getMultiFileVolumeListRefCounted() const
FieldAddOnBase::FieldChangeState handleFieldChanges(Field *field) override
EnumField * _inputSelectorFld
Selects the input from which DICOM trees shall be retrieved.
bool getAllowEmptyFileNames() const
Returns true if empty file names are tolerated without errors and lead to nullptr trees.
size_t _imageConnector0EnumIndex
Enumerator index for image connector 0, will be std::string::npos if not defined.
DicomMessageCollector _recentDcmMsgCollector
The recent messages from recently loaded DICOM tree.
InputConnectorField * getInput0Fld() const
Access interface to fields and members, see corresponding members for details.
void setAllowEmptyFileNames(bool allow)
If set to true then empty file names will be tolerated without errors and lead to nullptr trees.
Module & _module
Stores the reference to the modules the FieldContainer belongs to (needed for input connector creatio...
InputConfigurations
Variants of input connectors which can be provided by this FieldAddOn.
@ ImageImageImageBase
Three Image and one Base connector.
@ ImageBase
One Image and one Base connector.
@ ImageImageBase
Two Image and one Base connector.
InputConnectorField * _input2Fld
InputConnector 2 if created, otherwise nullptr.
InputConnectorField * _input0Fld
InputConnector 0 if created, otherwise nullptr.
size_t _fileEnumIndex
Enumerator index for the file, will be std::string::npos if not defined.
StringField * _absoluteFileNameFld
Path to a possible DICOM file or MultiFileVolume, may be nullptr if not created. This should usually ...
void handleFieldActivationChanges() override
Do the activateAttachment-like stuff in this method.
size_t _multiFileVolumeCacheEnumIndex
Enumerator index for the MultiFileVolumeCache, will be std::string::npos if not defined.
InputConnectorField * _input1Fld
InputConnector 1 if created, otherwise nullptr.
void addFields() override
Add fields to the module according to the InputConfiguration defined in the constructor.
const MultiFileVolume * getMultiFileVolume() const
size_t _imageConnector2EnumIndex
Enumerator index for image connector 2, will be std::string::npos if not defined.
const std::vector< std::string > & getInputSelectorStrings() const
Returns the enumerator strings used for the _inputSelectorFld.
std::vector< std::string > _inputSelectorEnumerators
Stores the enumerator strings used for the _inputSelectorFld.
bool _allowEmptyFileNames
If true then empty file names will be tolerated without errors and lead to nullptr trees.
Header file of class to collect messages and errors related to a given frame handle.
Reference counted Base class encapsulating a list of MultiFileVolume instances.
Main header file including all other headers of the project MLReleaseTools.
boost::shared_ptr< const Tree > Const_TreePtr
Definition DCMTree_Lib.h:67