MeVisLab Toolbox Reference
|
A tool class to manage a list of file/frame names/urls associated with attributes. More...
#include <mlFileListToolsFileList.h>
Public Types | |
enum | { CopyFullFunctionalGroupSequences = 1 } |
Flag bits used as binary composed word for get/setDicomImportsFlags. More... | |
typedef FileListFilterPluginBase::FileAttributeMap | FileAttributeMap |
A map type assigning an attribute container to file paths. More... | |
typedef std::map< std::string, const FileAttribute * > | FileAttributeMapReferenced |
A map type assigning references to attribute container to file paths. More... | |
typedef std::vector< FileAttributeMapReferenced > | FileAttributeMaps |
A vector of FileAttributeMapReferenced. More... | |
Public Member Functions | |
FileList (const FileListFilterPluginBase *filterPlugin) | |
Constructs an empty fileAttributeMap object and associate the filter plugin connected to the FileListTools if there is one (otherwise use nullptr). More... | |
FileList (const FileList &fileList, size_t fileListIdx) | |
Constructs a file list from the fileListIdx'th entry of the FileAttributeMaps of a file list. More... | |
virtual | ~FileList () |
Currently no destructor is needed, however, it should be virtual. More... | |
const FileListFilterPluginBase * | getConstFilterPlugin () const |
If available this points to the filter plugin connected to the DirectDicomImport module, otherwise nullptr (constant version). More... | |
void | reset () |
Restore construction state. More... | |
FileAttributeMap & | getFileAttributeMap () |
Get the _fileAttributeMap as modifiable object. More... | |
const FileAttributeMap & | getFileAttributeMap () const |
Get the _fileAttributeMap as constant object. More... | |
const FileAttributeMaps & | getGroupedFileAttributeMaps () const |
Get the _groupedFileAttributeMaps as constant object. More... | |
FileAttribute & | getAttributesForFile (const std::string &fileName) |
Get the attributes associated to the file name (if necessary then the map entry is created). More... | |
const FileAttribute * | getAttributesForFile (const std::string &fileName) const |
Get the attributes associated to the file name with constant access; if no entry exists then nullptr is returned. More... | |
std::vector< std::string > | getFileNameList (bool onlyPassed, MLuint32 fileTypeMaskMask, MLuint32 noFileTypeMaskMask) const |
Returns a vector of std::strings of all file names of the fileAttributeMap which obey the restrictions defined by the function arguments. More... | |
void | setDicomImportFlags (MLint64 flags) |
Set dedicated flags influencing the import of DICOM files. For supported bits see CopyFullFunctionalGroupSequences. More... | |
MLint64 | getDicomImportFlags () const |
Set dedicated flags influencing the import of DICOM files. More... | |
virtual bool | setUpFilesToImport (ProgressLogger *progressLogger, const std::string &frameSourcesDir, const std::vector< std::string > &suppressedFilesAndSuffixes, const std::vector< std::string > &explicitFileTypes, const std::vector< std::string > &additionalFiles, bool recursively, bool decomposeMultiFrames, float progressMinimum, float progressMaximum, DicomMessageCollector &dcmMsgCollector, bool filterDecomposedFrames=false) |
Searches all files in directory frameSourcesDirs which do not have suffixes as described in suppressedFilesAndSuffixes. More... | |
Protected Member Functions | |
bool | _doMultiFrameDecomposition (FileAttribute &fileAttributes, DicomMessageCollector &dcmMsgCollector, bool filterDecomposedFrames) |
Decomposes the multi-frame file given by fileAttributes and adds each frame as a single frame with _addFile. More... | |
virtual void | _addFile (const std::string &fullFileNamePathToAdd, const std::vector< std::string > &suppressedFilesAndSuffixes, const std::vector< std::string > &explicitFileTypes, bool decomposeMultiFrames, bool checkForTiffDcm, DicomMessageCollector &dcmMsgCollector, bool filterDecomposedFrames) |
Tool function to check whether a file shall be imported or moved to non imported files. More... | |
void | _updateLabelConfigGroups () |
Clears _groupedFileAttributeMaps, scans all entries of _fileAttributeMap and fills _groupedFileAttributeMaps with pointers to FileAttributeMap objects containing the same volumeLabel and importCfg strings. More... | |
Protected Attributes | |
MLDICOMCachedIOProxies | _cacheProxies |
Member used to access DICOM trees and to hold a handle on the tags cache until the last cache instance is removed. More... | |
FileAttributeMap | _fileAttributeMap |
The map storing the imported file names associated with filter attributes. More... | |
FileAttributeMaps | _groupedFileAttributeMaps |
Contains references to entries in fileAttributeMap, but decomposed to different FileAttributeMap objects which have identical volumeLabel+importConfig attributes. More... | |
const FileListFilterPluginBase * | _filterPlugin |
If available this points to the filter plugin connected to the DirectDicomImport module, otherwise nullptr. More... | |
MLint64 | _dicomImportFlags |
Flags interpreted by the DICOM loader. More... | |
A tool class to manage a list of file/frame names/urls associated with attributes.
Definition at line 44 of file mlFileListToolsFileList.h.
A map type assigning an attribute container to file paths.
Definition at line 49 of file mlFileListToolsFileList.h.
typedef std::map< std::string, const FileAttribute* > ml::FileListTools::FileList::FileAttributeMapReferenced |
A map type assigning references to attribute container to file paths.
Definition at line 52 of file mlFileListToolsFileList.h.
typedef std::vector< FileAttributeMapReferenced > ml::FileListTools::FileList::FileAttributeMaps |
A vector of FileAttributeMapReferenced.
Definition at line 55 of file mlFileListToolsFileList.h.
anonymous enum |
Flag bits used as binary composed word for get/setDicomImportsFlags.
Enumerator | |
---|---|
CopyFullFunctionalGroupSequences |
Definition at line 103 of file mlFileListToolsFileList.h.
ml::FileListTools::FileList::FileList | ( | const FileListFilterPluginBase * | filterPlugin | ) |
Constructs an empty fileAttributeMap object and associate the filter plugin connected to the FileListTools if there is one (otherwise use nullptr).
ml::FileListTools::FileList::FileList | ( | const FileList & | fileList, |
size_t | fileListIdx | ||
) |
Constructs a file list from the fileListIdx'th entry of the FileAttributeMaps of a file list.
If no such entry exists, the result list will be empty.
|
inlinevirtual |
Currently no destructor is needed, however, it should be virtual.
Definition at line 67 of file mlFileListToolsFileList.h.
|
protectedvirtual |
Tool function to check whether a file shall be imported or moved to non imported files.
If available it also calls filterPlugins connected to the FileListTools instance which could filter out certain files.
fullFileNamePathToAdd | The file name to be added either to to foundToBeImportedWithOther if it is not filtered. |
suppressedFilesAndSuffixes | Array of file suffixes including "." (such as ".tif", ".txt") describing the file types not to be parsed and included in the list of found frames. Strings not having a leading dot must match case insensitively. |
explicitFileTypes | Array of file suffixes including "." (such as ".pnm", ".jpg") describing the file types which shall be imported as additional non DICOM files. |
decomposeMultiFrames | If false then multiframe files are loaded as single volumes, if true then these files are decomposed to single frames before importing them. |
checkForTiffDcm | Allow checking and handlĂng of DCM/TIF-pairs, because they are considered as DICOM files but have to be imported with a non-DICOM importer typically. They get specific attributes to make handling easier. This check, however, can speed down some operations since searching the corresponding file pair can take long on some file system types. |
filterDecomposedFrames | If false (the default) then frames decomposed from enhanced multi-frame are not specifically filtered, otherwise filtering is applied to each of them. |
dcmMsgCollector | Collects error, info and issue messages (typically related to a handle). |
|
protected |
Decomposes the multi-frame file given by fileAttributes and adds each frame as a single frame with _addFile.
fileAttributes | The file (with import and filter attribute information) to be decomposed to a set of frames. |
dcmMsgCollector | Collects error, info and issue messages (typically related to a handle). |
filterDecomposedFrames | If false (the default) then frames decomposed from enhanced multi-frame are not specifically filtered, otherwise filtering is applied to each of them. |
|
protected |
Clears _groupedFileAttributeMaps, scans all entries of _fileAttributeMap and fills _groupedFileAttributeMaps with pointers to FileAttributeMap objects containing the same volumeLabel and importCfg strings.
FileAttribute& ml::FileListTools::FileList::getAttributesForFile | ( | const std::string & | fileName | ) |
Get the attributes associated to the file name (if necessary then the map entry is created).
const FileAttribute* ml::FileListTools::FileList::getAttributesForFile | ( | const std::string & | fileName | ) | const |
Get the attributes associated to the file name with constant access; if no entry exists then nullptr is returned.
|
inline |
If available this points to the filter plugin connected to the DirectDicomImport module, otherwise nullptr (constant version).
Definition at line 70 of file mlFileListToolsFileList.h.
MLint64 ml::FileListTools::FileList::getDicomImportFlags | ( | ) | const |
Set dedicated flags influencing the import of DICOM files.
|
inline |
Get the _fileAttributeMap as modifiable object.
Definition at line 76 of file mlFileListToolsFileList.h.
|
inline |
Get the _fileAttributeMap as constant object.
Definition at line 79 of file mlFileListToolsFileList.h.
std::vector<std::string> ml::FileListTools::FileList::getFileNameList | ( | bool | onlyPassed, |
MLuint32 | fileTypeMaskMask, | ||
MLuint32 | noFileTypeMaskMask | ||
) | const |
Returns a vector of std::strings of all file names of the fileAttributeMap which obey the restrictions defined by the function arguments.
It is required that the files have been set up before (e.g. with setUpFilesToImport).
onlyPassed | If true the only files with a true pass flag are returned. |
fileTypeMaskMask | Only files are returned where the fileTypeMask ANDed with fileTypeMaskMaskThese is non 0. |
noFileTypeMaskMask | Only files which do NOT have bits set noFileTypeMaskMask are returned. |
|
inline |
Get the _groupedFileAttributeMaps as constant object.
Definition at line 82 of file mlFileListToolsFileList.h.
|
inline |
Restore construction state.
Definition at line 73 of file mlFileListToolsFileList.h.
void ml::FileListTools::FileList::setDicomImportFlags | ( | MLint64 | flags | ) |
Set dedicated flags influencing the import of DICOM files. For supported bits see CopyFullFunctionalGroupSequences.
|
virtual |
Searches all files in directory frameSourcesDirs which do not have suffixes as described in suppressedFilesAndSuffixes.
progressLogger | Used for message output and progress updates, allowed to be nullptr. |
frameSourcesDir | The directory to be scanned for files which do not have suffixes as described in suppressedFilesAndSuffixes. |
suppressedFilesAndSuffixes | Array of file suffixes including "." (such as ".tif", ".txt") describing the file types not to be parsed and included in the list of found frames. Strings not having a leading dot must match case insensitively. |
explicitFileTypes | Array of file suffixes including "." (such as ".pnm", ".jpg") describing the file types which shall be imported as additional non DICOM files if they were refused by this imported due to the suppressedFilesAndSuffixes list. That means files matching suppressedFilesAndSuffixes and explicitFileTypes are added to foundExplicits. |
additionalFiles | Explicitly specified files to be imported. |
recursively | If true (the default) then directories are recursively parsed; if not only the current directory is scanned. |
decomposeMultiFrames | If false (the default) then multiframe files are loaded as single volumes, if true then these files are decomposed to single frames before importing them. |
progressMinimum | Start percentage for progress counting. |
progressMaximum | End percentage for progress counting. |
dcmMsgCollector | Collects error, info and issue messages (typically related to a handle). |
filterDecomposedFrames | If false (the default) then frames decomposed from enhanced multi-frame are not specifically filtered, otherwise filtering is applied to each of them. |
|
protected |
Member used to access DICOM trees and to hold a handle on the tags cache until the last cache instance is removed.
Definition at line 208 of file mlFileListToolsFileList.h.
|
protected |
Flags interpreted by the DICOM loader.
Definition at line 222 of file mlFileListToolsFileList.h.
|
protected |
The map storing the imported file names associated with filter attributes.
Definition at line 212 of file mlFileListToolsFileList.h.
|
protected |
If available this points to the filter plugin connected to the DirectDicomImport module, otherwise nullptr.
Definition at line 219 of file mlFileListToolsFileList.h.
|
protected |
Contains references to entries in fileAttributeMap, but decomposed to different FileAttributeMap objects which have identical volumeLabel+importConfig attributes.
Definition at line 216 of file mlFileListToolsFileList.h.