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
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
60 bool createFileInput,
62 bool allowEmptyFileNames=false);
63
65 void addFields() override;
66
69
73
79
83
87
91
93 void setAllowEmptyFileNames(bool allow){ _allowEmptyFileNames = allow; }
94
96 bool getAllowEmptyFileNames() const { return _allowEmptyFileNames; }
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 ; }
104 inline StringField *getUnresolvedFileNameFld () const { return _unresolvedFileNameFld ; }
105 inline StringField *getAbsoluteFileNameFld () const { return _absoluteFileNameFld ; }
106 inline EnumField &getInputSelectorFld () const { return *_inputSelectorFld ; }
107 inline IntField &getInputVolumeIndexFld () const { return *_inputVolumeIndexFld ; }
108 inline IntField &getNumVolumesFld () const { return *_numVolumesFld ; }
109 inline BoolField &getWarnNonExistingFileOnBrowsingFld() const { return *_warnNonExistingFileOnBrowsingFld; }
110 inline BoolField &getWarnDirectoriesOnBrowsingFld () const { return *_warnDirectoriesOnBrowsingFld ; }
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 ; }
116 inline size_t getMultiFileVolumeCacheEnumIndex () const { return _multiFileVolumeCacheEnumIndex ; }
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
202
205
208
212
213};
214
Project global and OS specific declarations.
#define ML_DICOM_MODIFY_EXPORT
DLL export macro definition.
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 to collect messages and errors related to a given frame handle.
Field to encapsulate an enumerated value.
Definition mlFields.h:195
Abstract base class for field interfaces to be added to other ML module classes.
FieldChangeState
Describes the type of a field changes detected in handleFieldChanges(Field *field).
Base class for all fields used in the ML.
Definition mlField.h:73
Field to encapsulate a pointer to an input connector which represents a module input.
Definition mlFields.h:750
Field to encapsulate an integer value.
Definition mlFields.h:126
Base class for an image processing module of the ML.
Definition mlModule.h:151
Class managing a list of MultiFileVolume instances for the DirectDicomImport module.
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 to encapsulate a string value.
Definition mlFields.h:610
Class implementing a FieldAddOn managing fields and functionality for a multi- purpose input connecto...
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
Return the DCMTree::Const_TreePtr which can be retrieved via the current settings; returns nullptr if...
TreeAndVolumeInputFieldAddOn(Module &moduleRef, InputConfigurations inputConfig, bool createFileInput, bool createMultiFileVolumeCacheInput=false, bool allowEmptyFileNames=false)
Constructor, setting the reference of the FieldContainer managing the fields.
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
Return the currently selected MultiFileVolumeList if there is a valid one selected and connected; oth...
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
Return the currently selected or loaded MultiFileVolumeList if there is a valid one selected and conn...
FieldAddOnBase::FieldChangeState handleFieldChanges(Field *field) override
Handle field notifications.
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.
BaseField * _inputBaseFld
Base connector input for DCMTree sources.
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
Return the currently selected MultiFileVolume if there is a valid one selected and connected; otherwi...
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.
void _loadMultiFileVolumeListRefCountedIfNeeded()
Loaded MultiFileVolumeList from Input file name and stores it in a RefCounted member if _inputSelecto...
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.
Header file of the abstract base class FieldAddOnBase managing fields independently of an ML Module.
Reference counted Base class encapsulating a list of MultiFileVolume instances.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
Main header file including all other headers of the project MLReleaseTools.
boost::shared_ptr< const Tree > Const_TreePtr
Definition DCMTree_Lib.h:73