MeVisLab Toolbox Reference
ml::MultiFileVolumeListView Class Reference

Manages the volume list view and its contents for the DirectDicomImport module. More...

#include <mlMultiFileVolumeListView.h>

Classes

struct  _ColumnNameHeadValue
 Composition of a column name, the head entry, and the column value. More...
 
class  DirectDicomImportColumnDesc
 Simple class to manage a list view column. More...
 

Public Types

enum  IconBuildMode { UseFirstSlice = 0 , UseMiddleSlice , NumIconBuildModes }
 Modes how icons shall be generated. More...
 

Public Member Functions

 MultiFileVolumeListView ()
 Constructor.
 
virtual ~MultiFileVolumeListView ()
 Destructor.
 
void appendFields (FieldContainer &fieldContainer)
 Creates all bool fields for volume vie columns. To be called in constructor.
 
void checkSortParameters () const
 Perform some checks on sort parameters and logs errors if necessary.
 
void handleNotification (Field &field, bool &updateVolumeListViewFlag, bool &updateThumbNails, bool &updateTableSort, bool isResultCachingPossible)
 Handle field changes of the field field.
 
void updateSortOrderOfVolumeTable (MultiFileVolumeList &volumeList) const
 Sorts the volumes according to the current sort mode.
 
void updateThumbNailFiles (MultiFileVolumeList &volumeList, const std::string &validCacheDir, const std::string &validCacheFileName)
 Update the list of thumbnails from the source volumes and write them in the cache directory.
 
void updateVolumeListView (const MultiFileVolumeList &volumeList, size_t subSetStart=0u, size_t subSetEnd=std::string::npos)
 Update the volume list with all columns.
 
const BoolFieldgetUseThumbNailsField () const
 Returns read access to the useThumbNails field; only allowed to be called after appendFields() call.
 

Static Public Member Functions

static std::string createThumbFileName (const std::string &cacheDir, const std::string &cacheFileName, const size_t volumeIndex)
 Create file name for thumbNailFile with index v in directory cacheDir and for cache file cacheFileName.
 
static void removeThumbNail (const size_t volumeIndex, const std::string &validCacheDir, const std::string &validCacheFileName)
 Removes possibly existing thumbnail with index volumeIndex with cachefileName validCacheFileName which has been stored in validCacheDir.
 
static void removeThumbNails (const size_t numVolumes, const std::string &validCacheDir, const std::string &validCacheFileName)
 Removes possibly existing thumbnails indexed from 0 to numVolumes-1 with cachefileName validCacheFileName which have been stored in validCacheDir.
 
static void replaceNonTableViewChars (const std::string &columnSubStr, std::string &correctedStr)
 Replaces all string components in columnSubStr which could disturb the list view such as newlines, @'s etc.
 

Static Public Attributes

static const char *const IconBuildModeStrings [NumIconBuildModes]
 Strings corresponding to IconBuildModes.
 

Protected Types

typedef std::vector< std::vector< _ColumnNameHeadValue > > _ColumnNameHeadValueVector
 Type used for managing and sorting all rows and columns of the ListView.
 

Protected Member Functions

void _checkIdxSortTagValue () const
 Logs an ML error if _idxSortTagValueFld has an invalid content.
 
std::string _getUserTagVal (DCMTree::Const_TreePtr tree, size_t idx, bool useNumericTagValueSorting) const
 Returns the value of the tag specified in user tag id fields from tree or "" if not possible.
 
void _appendTableColumn (const size_t &volumeIdx, DCMTree::Const_TreePtr tree, size_t &descIdx, bool isFirst, const std::string &userVal, bool isTagValue, _ColumnNameHeadValueVector &tableColumns) const
 Updates head line and value for the volume view list.
 
std::vector< size_t_determineTableColumnOrder () const
 Parse the _columnConfigFld and determines the order of visible columns.
 
void _buildTableString (const _ColumnNameHeadValueVector &tableColumns, bool showDots, std::string &tableString) const
 Build the final table string from all row/column entries; if showDots is true then a final line with dots is appended to show that the list is not shown completely.
 

Protected Attributes

StringField_volumeListViewFld
 The field containing the Volume table with columns.
 
EnumField_sortModeFld
 Enumerator field showing all sort modes for list of output volumes, default is MultiFileVolumeList::NumVoxels.
 
BoolField_sortUpwardsFld
 If enabled sorting orders the higher values to first, otherwise to last position.
 
StringField_idxSortTagValueFld
 Field specifying a DICOM tag whose value is used to sort the volume list; only used when_sortMode is MultiFileVolumeList::SortAccordingDcmTag.
 
BoolField_useNumericTagValueSortingFld
 If enabled then tags with value representations IS are interpreted as sign 32 bit integers and printed with "-" for negative values and leading spaces to fill 9 characters to make all tag values sortable uniquely.
 
IntField_thumbNailsExtFld
 Extent of thumbNails, default is 40.
 
NotifyField_updateThumbNailsFld
 Field containing the path base to the pixMaps and to trigger an update of pixmaps on the volumeInfosFld.
 
BoolField_useThumbNailsField
 Field containing the pointer to the thumbnail enable/disable toggle.
 
StringField_userColumnTagFld [3]
 Three tag ids specifying tag values to be shown in the volume list.
 
StringField_columnConfigFld
 Configuration string containing the list of column names to be displayed.
 
EnumField_iconBuildModeFld
 Selects the mode how and from which slices of the image the icons in the volume table are created, default is UseMiddleSlice.
 
std::vector< DirectDicomImportColumnDesc_columnDescs
 Boolean fields to enable/disable tags.
 

Detailed Description

Manages the volume list view and its contents for the DirectDicomImport module.

Definition at line 31 of file mlMultiFileVolumeListView.h.

Member Typedef Documentation

◆ _ColumnNameHeadValueVector

Type used for managing and sorting all rows and columns of the ListView.

Definition at line 128 of file mlMultiFileVolumeListView.h.

Member Enumeration Documentation

◆ IconBuildMode

Modes how icons shall be generated.

Enumerator
UseFirstSlice 
UseMiddleSlice 

Fist slice of image is used to build the icon.

NumIconBuildModes 

Middle slice of image is used to build the icon.

Number of icon build modes, do not use as selector!

Definition at line 36 of file mlMultiFileVolumeListView.h.

Constructor & Destructor Documentation

◆ MultiFileVolumeListView()

ml::MultiFileVolumeListView::MultiFileVolumeListView ( )

Constructor.

◆ ~MultiFileVolumeListView()

virtual ml::MultiFileVolumeListView::~MultiFileVolumeListView ( )
virtual

Destructor.

Member Function Documentation

◆ _appendTableColumn()

void ml::MultiFileVolumeListView::_appendTableColumn ( const size_t & volumeIdx,
DCMTree::Const_TreePtr tree,
size_t & descIdx,
bool isFirst,
const std::string & userVal,
bool isTagValue,
_ColumnNameHeadValueVector & tableColumns ) const
protected

Updates head line and value for the volume view list.

◆ _buildTableString()

void ml::MultiFileVolumeListView::_buildTableString ( const _ColumnNameHeadValueVector & tableColumns,
bool showDots,
std::string & tableString ) const
protected

Build the final table string from all row/column entries; if showDots is true then a final line with dots is appended to show that the list is not shown completely.

◆ _checkIdxSortTagValue()

void ml::MultiFileVolumeListView::_checkIdxSortTagValue ( ) const
protected

Logs an ML error if _idxSortTagValueFld has an invalid content.

◆ _determineTableColumnOrder()

std::vector< size_t > ml::MultiFileVolumeListView::_determineTableColumnOrder ( ) const
protected

Parse the _columnConfigFld and determines the order of visible columns.

◆ _getUserTagVal()

std::string ml::MultiFileVolumeListView::_getUserTagVal ( DCMTree::Const_TreePtr tree,
size_t idx,
bool useNumericTagValueSorting ) const
protected

Returns the value of the tag specified in user tag id fields from tree or "" if not possible.

◆ appendFields()

void ml::MultiFileVolumeListView::appendFields ( FieldContainer & fieldContainer)

Creates all bool fields for volume vie columns. To be called in constructor.

◆ checkSortParameters()

void ml::MultiFileVolumeListView::checkSortParameters ( ) const

Perform some checks on sort parameters and logs errors if necessary.

◆ createThumbFileName()

static std::string ml::MultiFileVolumeListView::createThumbFileName ( const std::string & cacheDir,
const std::string & cacheFileName,
const size_t volumeIndex )
static

Create file name for thumbNailFile with index v in directory cacheDir and for cache file cacheFileName.

◆ getUseThumbNailsField()

const BoolField & ml::MultiFileVolumeListView::getUseThumbNailsField ( ) const

Returns read access to the useThumbNails field; only allowed to be called after appendFields() call.

◆ handleNotification()

void ml::MultiFileVolumeListView::handleNotification ( Field & field,
bool & updateVolumeListViewFlag,
bool & updateThumbNails,
bool & updateTableSort,
bool isResultCachingPossible )

Handle field changes of the field field.

◆ removeThumbNail()

static void ml::MultiFileVolumeListView::removeThumbNail ( const size_t volumeIndex,
const std::string & validCacheDir,
const std::string & validCacheFileName )
static

Removes possibly existing thumbnail with index volumeIndex with cachefileName validCacheFileName which has been stored in validCacheDir.

File I/O errors on deletion of an existing file are posted as ML error, a non-existing file is ignored.

◆ removeThumbNails()

static void ml::MultiFileVolumeListView::removeThumbNails ( const size_t numVolumes,
const std::string & validCacheDir,
const std::string & validCacheFileName )
static

Removes possibly existing thumbnails indexed from 0 to numVolumes-1 with cachefileName validCacheFileName which have been stored in validCacheDir.

File I/O errors on deletion of existing files are posted as ML error. Non-existing files are ignored.

◆ replaceNonTableViewChars()

static void ml::MultiFileVolumeListView::replaceNonTableViewChars ( const std::string & columnSubStr,
std::string & correctedStr )
static

Replaces all string components in columnSubStr which could disturb the list view such as newlines, @'s etc.

◆ updateSortOrderOfVolumeTable()

void ml::MultiFileVolumeListView::updateSortOrderOfVolumeTable ( MultiFileVolumeList & volumeList) const

Sorts the volumes according to the current sort mode.

Updating of information fields is not done.

◆ updateThumbNailFiles()

void ml::MultiFileVolumeListView::updateThumbNailFiles ( MultiFileVolumeList & volumeList,
const std::string & validCacheDir,
const std::string & validCacheFileName )

Update the list of thumbnails from the source volumes and write them in the cache directory.

◆ updateVolumeListView()

void ml::MultiFileVolumeListView::updateVolumeListView ( const MultiFileVolumeList & volumeList,
size_t subSetStart = 0u,
size_t subSetEnd = std::string::npos )

Update the volume list with all columns.

Parameters
volumeListThe volume list to convert to a ListView table string.
subSetStartExperimental: defines the first index inside the list to start from; if it is outside the list range then nothing is shown.
subSetEndExperimental: Last volume to display+1, may be larger than volume list it is always clamped into the valid list range; if clamp result is smaller than subSetStart then nothing is shown.

Member Data Documentation

◆ _columnConfigFld

StringField* ml::MultiFileVolumeListView::_columnConfigFld
protected

Configuration string containing the list of column names to be displayed.

Definition at line 195 of file mlMultiFileVolumeListView.h.

◆ _columnDescs

std::vector<DirectDicomImportColumnDesc> ml::MultiFileVolumeListView::_columnDescs
protected

Boolean fields to enable/disable tags.

Definition at line 238 of file mlMultiFileVolumeListView.h.

◆ _iconBuildModeFld

EnumField* ml::MultiFileVolumeListView::_iconBuildModeFld
protected

Selects the mode how and from which slices of the image the icons in the volume table are created, default is UseMiddleSlice.

Definition at line 199 of file mlMultiFileVolumeListView.h.

◆ _idxSortTagValueFld

StringField* ml::MultiFileVolumeListView::_idxSortTagValueFld
protected

Field specifying a DICOM tag whose value is used to sort the volume list; only used when_sortMode is MultiFileVolumeList::SortAccordingDcmTag.

Definition at line 170 of file mlMultiFileVolumeListView.h.

◆ _sortModeFld

EnumField* ml::MultiFileVolumeListView::_sortModeFld
protected

Enumerator field showing all sort modes for list of output volumes, default is MultiFileVolumeList::NumVoxels.

Definition at line 163 of file mlMultiFileVolumeListView.h.

◆ _sortUpwardsFld

BoolField* ml::MultiFileVolumeListView::_sortUpwardsFld
protected

If enabled sorting orders the higher values to first, otherwise to last position.

Definition at line 166 of file mlMultiFileVolumeListView.h.

◆ _thumbNailsExtFld

IntField* ml::MultiFileVolumeListView::_thumbNailsExtFld
protected

Extent of thumbNails, default is 40.

Definition at line 180 of file mlMultiFileVolumeListView.h.

◆ _updateThumbNailsFld

NotifyField* ml::MultiFileVolumeListView::_updateThumbNailsFld
protected

Field containing the path base to the pixMaps and to trigger an update of pixmaps on the volumeInfosFld.

Definition at line 184 of file mlMultiFileVolumeListView.h.

◆ _useNumericTagValueSortingFld

BoolField* ml::MultiFileVolumeListView::_useNumericTagValueSortingFld
protected

If enabled then tags with value representations IS are interpreted as sign 32 bit integers and printed with "-" for negative values and leading spaces to fill 9 characters to make all tag values sortable uniquely.

If disabled then of the IS-valued tags the normal string values are read as they are stored in the tag.

Definition at line 177 of file mlMultiFileVolumeListView.h.

◆ _userColumnTagFld

StringField* ml::MultiFileVolumeListView::_userColumnTagFld[3]
protected

Three tag ids specifying tag values to be shown in the volume list.

Definition at line 192 of file mlMultiFileVolumeListView.h.

◆ _useThumbNailsField

BoolField* ml::MultiFileVolumeListView::_useThumbNailsField
protected

Field containing the pointer to the thumbnail enable/disable toggle.

This field pointer is set manually after creating that toggle as all other table columns toggles, too.

Definition at line 189 of file mlMultiFileVolumeListView.h.

◆ _volumeListViewFld

StringField* ml::MultiFileVolumeListView::_volumeListViewFld
protected

The field containing the Volume table with columns.

Definition at line 159 of file mlMultiFileVolumeListView.h.

◆ IconBuildModeStrings

const char* const ml::MultiFileVolumeListView::IconBuildModeStrings[NumIconBuildModes]
static

Strings corresponding to IconBuildModes.

Definition at line 44 of file mlMultiFileVolumeListView.h.


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