MeVisLab Toolbox Reference
ml::TreeAndVolumeInputFieldAddOn Class Reference

Class implementing a FieldAddOn managing fields and functionality for a multi- purpose input connector for MultiFileVolumeList(s) and DICOM-Tree(s). More...

#include <mlTreeAndVolumeInputFieldAddOn.h>

Inheritance diagram for ml::TreeAndVolumeInputFieldAddOn:
ml::FieldAddOnBase

Public Types

enum  InputConfigurations { BaseOnly = 0 , ImageBase , ImageImageBase , ImageImageImageBase }
 Variants of input connectors which can be provided by this FieldAddOn. More...
 
- Public Types inherited from ml::FieldAddOnBase
enum  FieldChangeState { NoChange = 0 , StatusOnlyChange , RecalculationRequired }
 Describes the type of a field changes detected in handleFieldChanges(Field *field). More...
 

Public Member Functions

const std::vector< std::string > & getInputSelectorStrings () const
 Returns the enumerator strings used for the _inputSelectorFld.
 
 TreeAndVolumeInputFieldAddOn (Module &moduleRef, InputConfigurations inputConfig, bool createFileInput, bool createMultiFileVolumeCacheInput=false, bool allowEmptyFileNames=false)
 Constructor, setting the reference of the FieldContainer managing the fields.
 
void addFields () override
 Add fields to the module according to the InputConfiguration defined in the constructor.
 
void handleFieldActivationChanges () override
 Do the activateAttachment-like stuff in this method.
 
FieldAddOnBase::FieldChangeState handleFieldChanges (Field *field) override
 Handle field notifications.
 
DCMTree::Const_TreePtr getDCMTree (DicomMessageCollector &dcmMsgCollector) const
 Return the DCMTree::Const_TreePtr which can be retrieved via the current settings; returns nullptr if not accessible.
 
MultiFileVolumeListRefCountedgetMultiFileVolumeListRefCounted () const
 Return the currently selected or loaded MultiFileVolumeList if there is a valid one selected and connected or loaded; otherwise nullptr is returned.
 
const MultiFileVolumeListgetMultiFileVolumeList () const
 Return the currently selected MultiFileVolumeList if there is a valid one selected and connected; otherwise nullptr is returned.
 
const MultiFileVolumegetMultiFileVolume () const
 Return the currently selected MultiFileVolume if there is a valid one selected and connected; otherwise nullptr is returned.
 
void setAllowEmptyFileNames (bool allow)
 If set to true then empty file names will be tolerated without errors and lead to nullptr trees.
 
bool getAllowEmptyFileNames () const
 Returns true if empty file names are tolerated without errors and lead to nullptr trees.
 
InputConnectorFieldgetInput0Fld () const
 Access interface to fields and members, see corresponding members for details.
 
InputConnectorFieldgetInput1Fld () const
 
InputConnectorFieldgetInput2Fld () const
 
BaseFieldgetInputBaseFld () const
 
StringFieldgetUnresolvedFileNameFld () const
 
StringFieldgetAbsoluteFileNameFld () const
 
EnumFieldgetInputSelectorFld () const
 
IntFieldgetInputVolumeIndexFld () const
 
IntFieldgetNumVolumesFld () const
 
BoolFieldgetWarnNonExistingFileOnBrowsingFld () const
 
BoolFieldgetWarnDirectoriesOnBrowsingFld () const
 
size_t getImageConnector0EnumIndex () const
 
size_t getImageConnector1EnumIndex () const
 
size_t getImageConnector2EnumIndex () const
 
size_t getBaseConnectorEnumIndex () const
 
size_t getFileEnumIndex () const
 
size_t getMultiFileVolumeCacheEnumIndex () const
 
- Public Member Functions inherited from ml::FieldAddOnBase
 FieldAddOnBase (FieldContainer &fieldContainerRef)
 Constructor, setting the reference of the FieldContainer managing the fields.
 
virtual ~FieldAddOnBase ()
 Destructor.
 
FieldContainergetFieldContainer ()
 Returns the referenced container.
 
const FieldContainergetFieldContainer () const
 Returns the referenced container.
 
std::vector< Field * > & getFields ()
 Return modification access to the list of managed fields, use at own risk!
 
const std::vector< Field * > & getFields () const
 Return constant access to the list of managed fields!
 
virtual FieldChangeState getMergedFieldChangeState (FieldChangeState state1, FieldChangeState state2) const
 Returns a FieldChangeState which best represents a merge of the two given states.
 
virtual bool hasField (Field *field) const
 Returns true if the passed fieldPtr is in _fieldPointers, otherwise false.
 

Protected Member Functions

void _loadMultiFileVolumeListRefCountedIfNeeded ()
 Loaded MultiFileVolumeList from Input file name and stores it in a RefCounted member if _inputSelectorFld->getEnumValue() requires that.
 
- Protected Member Functions inherited from ml::FieldAddOnBase
void _addFieldPointer (Field *field)
 Helper routine to add a Field pointer to _fieldPointers, empty pointers and pointers added more than once will be handled fatally.
 

Protected Attributes

Saved constructor arguments.
Module_module
 Stores the reference to the modules the FieldContainer belongs to (needed for input connector creation).
 
const InputConfigurations _inputConfig
 Stores the input configuration which shall be handled by this FieldAddOn.
 
const bool _createFileInput
 If true then also a file input interface will be created, otherwise not.
 
const bool _createMultiFileVolumeCacheInput
 If true then also an enumerator entry for MultFileVolumeCache loading will be created, otherwise not.
 
The managed fields.
InputConnectorField_input0Fld
 InputConnector 0 if created, otherwise nullptr.
 
InputConnectorField_input1Fld
 InputConnector 1 if created, otherwise nullptr.
 
InputConnectorField_input2Fld
 InputConnector 2 if created, otherwise nullptr.
 
BaseField_inputBaseFld
 Base connector input for DCMTree sources.
 
StringField_unresolvedFileNameFld
 GUI-only file path for the unresolved DICOM file or MultiFileVolume, may be nullptr if not created; only to be used by GUI-scripting, because the actual file name is given by absoluteFileNameFld.
 
StringField_absoluteFileNameFld
 Path to a possible DICOM file or MultiFileVolume, may be nullptr if not created. This should usually be the expanded file name from unresolvedFileNameFld (expanding could be done by a module script or so).
 
EnumField_inputSelectorFld
 Selects the input from which DICOM trees shall be retrieved.
 
IntField_inputVolumeIndexFld
 Selector for a volume from inside a connected MultiFileVolumeList.
 
IntField_numVolumesFld
 Read-only: Output field showing the current number of available DICOM volumes at the selected input.
 
BoolField_warnNonExistingFileOnBrowsingFld
 Flag passed to the GUI script: if true then selected non-existing files are warned, otherwise not.
 
BoolField_warnDirectoriesOnBrowsingFld
 Flag passed to the GUI script: if true then selected directories directories are warned, otherwise not.
 
Working and state members.
std::vector< std::string > _inputSelectorEnumerators
 Stores the enumerator strings used for the _inputSelectorFld.
 
size_t _imageConnector0EnumIndex
 Enumerator index for image connector 0, will be std::string::npos if not defined.
 
size_t _imageConnector1EnumIndex
 Enumerator index for image connector 1, will be std::string::npos if not defined.
 
size_t _imageConnector2EnumIndex
 Enumerator index for image connector 2, 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.
 
size_t _fileEnumIndex
 Enumerator index for the file, will be std::string::npos if not defined.
 
size_t _multiFileVolumeCacheEnumIndex
 Enumerator index for the MultiFileVolumeCache, will be std::string::npos if not defined.
 
MultiFileVolumeListRefCountedPtr _lastLoadedMultiFileVolumeList
 Stores the most recently loaded MultiFileVolumeList.
 
bool _allowEmptyFileNames
 If true then empty file names will be tolerated without errors and lead to nullptr trees.
 
DCMTree::Const_TreePtr _recentlyLoadedTree
 The recently loaded DICOM tree.
 
DicomMessageCollector _recentDcmMsgCollector
 The recent messages from recently loaded DICOM tree.
 

Detailed Description

Class implementing a FieldAddOn managing fields and functionality for a multi- purpose input connector for MultiFileVolumeList(s) and DICOM-Tree(s).

Definition at line 37 of file mlTreeAndVolumeInputFieldAddOn.h.

Member Enumeration Documentation

◆ InputConfigurations

Variants of input connectors which can be provided by this FieldAddOn.

Enumerator
BaseOnly 

Only one Base connector.

ImageBase 

One Image and one Base connector.

ImageImageBase 

Two Image and one Base connector.

ImageImageImageBase 

Three Image and one Base connector.

Definition at line 41 of file mlTreeAndVolumeInputFieldAddOn.h.

Constructor & Destructor Documentation

◆ TreeAndVolumeInputFieldAddOn()

ml::TreeAndVolumeInputFieldAddOn::TreeAndVolumeInputFieldAddOn ( Module & moduleRef,
InputConfigurations inputConfig,
bool createFileInput,
bool createMultiFileVolumeCacheInput = false,
bool allowEmptyFileNames = false )

Constructor, setting the reference of the FieldContainer managing the fields.

Parameters
moduleRefThe Module for which the fields and inputs shall be managed.
inputConfigDescribes which combination of Image and Base input field shall be created and managed.
createFileInputIf enabled then a file input interface will be created, otherwise not.
createMultiFileVolumeCacheInputIf enabled then a MultiFileVolumeCache load operation will be supported, otherwise not.
allowEmptyFileNamesIf true then empty file names will be tolerated without errors and lead to nullptr trees.

Member Function Documentation

◆ _loadMultiFileVolumeListRefCountedIfNeeded()

void ml::TreeAndVolumeInputFieldAddOn::_loadMultiFileVolumeListRefCountedIfNeeded ( )
protected

Loaded MultiFileVolumeList from Input file name and stores it in a RefCounted member if _inputSelectorFld->getEnumValue() requires that.

◆ addFields()

void ml::TreeAndVolumeInputFieldAddOn::addFields ( )
overridevirtual

Add fields to the module according to the InputConfiguration defined in the constructor.

Implements ml::FieldAddOnBase.

◆ getAbsoluteFileNameFld()

StringField * ml::TreeAndVolumeInputFieldAddOn::getAbsoluteFileNameFld ( ) const
inline

Definition at line 105 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ getAllowEmptyFileNames()

bool ml::TreeAndVolumeInputFieldAddOn::getAllowEmptyFileNames ( ) const
inline

Returns true if empty file names are tolerated without errors and lead to nullptr trees.

Definition at line 96 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ getBaseConnectorEnumIndex()

size_t ml::TreeAndVolumeInputFieldAddOn::getBaseConnectorEnumIndex ( ) const
inline

Definition at line 114 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ getDCMTree()

DCMTree::Const_TreePtr ml::TreeAndVolumeInputFieldAddOn::getDCMTree ( DicomMessageCollector & dcmMsgCollector) const

Return the DCMTree::Const_TreePtr which can be retrieved via the current settings; returns nullptr if not accessible.

Parameters
dcmMsgCollectorCollects error, info and issue messages (typically related to a handle).
Returns
The DICOM tree retrieved from any source or nullptr on error or empty paths.

◆ getFileEnumIndex()

size_t ml::TreeAndVolumeInputFieldAddOn::getFileEnumIndex ( ) const
inline

Definition at line 115 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ getImageConnector0EnumIndex()

size_t ml::TreeAndVolumeInputFieldAddOn::getImageConnector0EnumIndex ( ) const
inline

Definition at line 111 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ getImageConnector1EnumIndex()

size_t ml::TreeAndVolumeInputFieldAddOn::getImageConnector1EnumIndex ( ) const
inline

Definition at line 112 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ getImageConnector2EnumIndex()

size_t ml::TreeAndVolumeInputFieldAddOn::getImageConnector2EnumIndex ( ) const
inline

Definition at line 113 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ getInput0Fld()

InputConnectorField * ml::TreeAndVolumeInputFieldAddOn::getInput0Fld ( ) const
inline

Access interface to fields and members, see corresponding members for details.

Definition at line 100 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ getInput1Fld()

InputConnectorField * ml::TreeAndVolumeInputFieldAddOn::getInput1Fld ( ) const
inline

Definition at line 101 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ getInput2Fld()

InputConnectorField * ml::TreeAndVolumeInputFieldAddOn::getInput2Fld ( ) const
inline

Definition at line 102 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ getInputBaseFld()

BaseField & ml::TreeAndVolumeInputFieldAddOn::getInputBaseFld ( ) const
inline

Definition at line 103 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ getInputSelectorFld()

EnumField & ml::TreeAndVolumeInputFieldAddOn::getInputSelectorFld ( ) const
inline

Definition at line 106 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ getInputSelectorStrings()

const std::vector< std::string > & ml::TreeAndVolumeInputFieldAddOn::getInputSelectorStrings ( ) const
inline

Returns the enumerator strings used for the _inputSelectorFld.

Definition at line 49 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ getInputVolumeIndexFld()

IntField & ml::TreeAndVolumeInputFieldAddOn::getInputVolumeIndexFld ( ) const
inline

Definition at line 107 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ getMultiFileVolume()

const MultiFileVolume * ml::TreeAndVolumeInputFieldAddOn::getMultiFileVolume ( ) const

Return the currently selected MultiFileVolume if there is a valid one selected and connected; otherwise nullptr is returned.

◆ getMultiFileVolumeCacheEnumIndex()

size_t ml::TreeAndVolumeInputFieldAddOn::getMultiFileVolumeCacheEnumIndex ( ) const
inline

Definition at line 116 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ getMultiFileVolumeList()

const MultiFileVolumeList * ml::TreeAndVolumeInputFieldAddOn::getMultiFileVolumeList ( ) const

Return the currently selected MultiFileVolumeList if there is a valid one selected and connected; otherwise nullptr is returned.

◆ getMultiFileVolumeListRefCounted()

MultiFileVolumeListRefCounted * ml::TreeAndVolumeInputFieldAddOn::getMultiFileVolumeListRefCounted ( ) const

Return the currently selected or loaded MultiFileVolumeList if there is a valid one selected and connected or loaded; otherwise nullptr is returned.

◆ getNumVolumesFld()

IntField & ml::TreeAndVolumeInputFieldAddOn::getNumVolumesFld ( ) const
inline

Definition at line 108 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ getUnresolvedFileNameFld()

StringField * ml::TreeAndVolumeInputFieldAddOn::getUnresolvedFileNameFld ( ) const
inline

Definition at line 104 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ getWarnDirectoriesOnBrowsingFld()

BoolField & ml::TreeAndVolumeInputFieldAddOn::getWarnDirectoriesOnBrowsingFld ( ) const
inline

Definition at line 110 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ getWarnNonExistingFileOnBrowsingFld()

BoolField & ml::TreeAndVolumeInputFieldAddOn::getWarnNonExistingFileOnBrowsingFld ( ) const
inline

Definition at line 109 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ handleFieldActivationChanges()

void ml::TreeAndVolumeInputFieldAddOn::handleFieldActivationChanges ( )
overridevirtual

Do the activateAttachment-like stuff in this method.

Reimplemented from ml::FieldAddOnBase.

◆ handleFieldChanges()

FieldAddOnBase::FieldChangeState ml::TreeAndVolumeInputFieldAddOn::handleFieldChanges ( Field * field)
overridevirtual

Handle field notifications.

If a call of filterString() because filter results need an update then FieldAddOnBase::RecalculationRequired is returned.

Reimplemented from ml::FieldAddOnBase.

◆ setAllowEmptyFileNames()

void ml::TreeAndVolumeInputFieldAddOn::setAllowEmptyFileNames ( bool allow)
inline

If set to true then empty file names will be tolerated without errors and lead to nullptr trees.

Definition at line 93 of file mlTreeAndVolumeInputFieldAddOn.h.

Member Data Documentation

◆ _absoluteFileNameFld

StringField* ml::TreeAndVolumeInputFieldAddOn::_absoluteFileNameFld
protected

Path to a possible DICOM file or MultiFileVolume, may be nullptr if not created. This should usually be the expanded file name from unresolvedFileNameFld (expanding could be done by a module script or so).

Definition at line 159 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _allowEmptyFileNames

bool ml::TreeAndVolumeInputFieldAddOn::_allowEmptyFileNames
protected

If true then empty file names will be tolerated without errors and lead to nullptr trees.

Definition at line 204 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _baseConnectorEnumIndex

size_t ml::TreeAndVolumeInputFieldAddOn::_baseConnectorEnumIndex
protected

Enumerator index for the base connector, will be std::string::npos if not defined.

Definition at line 192 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _createFileInput

const bool ml::TreeAndVolumeInputFieldAddOn::_createFileInput
protected

If true then also a file input interface will be created, otherwise not.

Definition at line 134 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _createMultiFileVolumeCacheInput

const bool ml::TreeAndVolumeInputFieldAddOn::_createMultiFileVolumeCacheInput
protected

If true then also an enumerator entry for MultFileVolumeCache loading will be created, otherwise not.

Definition at line 137 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _fileEnumIndex

size_t ml::TreeAndVolumeInputFieldAddOn::_fileEnumIndex
protected

Enumerator index for the file, will be std::string::npos if not defined.

Definition at line 195 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _imageConnector0EnumIndex

size_t ml::TreeAndVolumeInputFieldAddOn::_imageConnector0EnumIndex
protected

Enumerator index for image connector 0, will be std::string::npos if not defined.

Definition at line 183 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _imageConnector1EnumIndex

size_t ml::TreeAndVolumeInputFieldAddOn::_imageConnector1EnumIndex
protected

Enumerator index for image connector 1, will be std::string::npos if not defined.

Definition at line 186 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _imageConnector2EnumIndex

size_t ml::TreeAndVolumeInputFieldAddOn::_imageConnector2EnumIndex
protected

Enumerator index for image connector 2, will be std::string::npos if not defined.

Definition at line 189 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _input0Fld

InputConnectorField* ml::TreeAndVolumeInputFieldAddOn::_input0Fld
protected

InputConnector 0 if created, otherwise nullptr.

Definition at line 143 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _input1Fld

InputConnectorField* ml::TreeAndVolumeInputFieldAddOn::_input1Fld
protected

InputConnector 1 if created, otherwise nullptr.

Definition at line 146 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _input2Fld

InputConnectorField* ml::TreeAndVolumeInputFieldAddOn::_input2Fld
protected

InputConnector 2 if created, otherwise nullptr.

Definition at line 149 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _inputBaseFld

BaseField* ml::TreeAndVolumeInputFieldAddOn::_inputBaseFld
protected

Base connector input for DCMTree sources.

Currently MultiFileVolumeListRefCounted and DicomTree objects are supported.

Definition at line 153 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _inputConfig

const InputConfigurations ml::TreeAndVolumeInputFieldAddOn::_inputConfig
protected

Stores the input configuration which shall be handled by this FieldAddOn.

Definition at line 131 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _inputSelectorEnumerators

std::vector<std::string> ml::TreeAndVolumeInputFieldAddOn::_inputSelectorEnumerators
protected

Stores the enumerator strings used for the _inputSelectorFld.

Definition at line 180 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _inputSelectorFld

EnumField* ml::TreeAndVolumeInputFieldAddOn::_inputSelectorFld
protected

Selects the input from which DICOM trees shall be retrieved.

Definition at line 162 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _inputVolumeIndexFld

IntField* ml::TreeAndVolumeInputFieldAddOn::_inputVolumeIndexFld
protected

Selector for a volume from inside a connected MultiFileVolumeList.

Definition at line 165 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _lastLoadedMultiFileVolumeList

MultiFileVolumeListRefCountedPtr ml::TreeAndVolumeInputFieldAddOn::_lastLoadedMultiFileVolumeList
protected

Stores the most recently loaded MultiFileVolumeList.

Definition at line 201 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _module

Module& ml::TreeAndVolumeInputFieldAddOn::_module
protected

Stores the reference to the modules the FieldContainer belongs to (needed for input connector creation).

Definition at line 128 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _multiFileVolumeCacheEnumIndex

size_t ml::TreeAndVolumeInputFieldAddOn::_multiFileVolumeCacheEnumIndex
protected

Enumerator index for the MultiFileVolumeCache, will be std::string::npos if not defined.

Definition at line 198 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _numVolumesFld

IntField* ml::TreeAndVolumeInputFieldAddOn::_numVolumesFld
protected

Read-only: Output field showing the current number of available DICOM volumes at the selected input.

Definition at line 168 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _recentDcmMsgCollector

DicomMessageCollector ml::TreeAndVolumeInputFieldAddOn::_recentDcmMsgCollector
protected

The recent messages from recently loaded DICOM tree.

Definition at line 210 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _recentlyLoadedTree

DCMTree::Const_TreePtr ml::TreeAndVolumeInputFieldAddOn::_recentlyLoadedTree
protected

The recently loaded DICOM tree.

Definition at line 207 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _unresolvedFileNameFld

StringField* ml::TreeAndVolumeInputFieldAddOn::_unresolvedFileNameFld
protected

GUI-only file path for the unresolved DICOM file or MultiFileVolume, may be nullptr if not created; only to be used by GUI-scripting, because the actual file name is given by absoluteFileNameFld.

Definition at line 156 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _warnDirectoriesOnBrowsingFld

BoolField* ml::TreeAndVolumeInputFieldAddOn::_warnDirectoriesOnBrowsingFld
protected

Flag passed to the GUI script: if true then selected directories directories are warned, otherwise not.

Definition at line 174 of file mlTreeAndVolumeInputFieldAddOn.h.

◆ _warnNonExistingFileOnBrowsingFld

BoolField* ml::TreeAndVolumeInputFieldAddOn::_warnNonExistingFileOnBrowsingFld
protected

Flag passed to the GUI script: if true then selected non-existing files are warned, otherwise not.

Definition at line 171 of file mlTreeAndVolumeInputFieldAddOn.h.


The documentation for this class was generated from the following file: