15 #include <FMEThirdPartyWarningsDisable.h>
21 #include <FMEThirdPartyWarningsRestore.h>
29 class DicomMessageCollector;
30 class MultiFileVolume;
32 namespace DICOMTagTools{
53 const std::string &info,
60 const std::string& validCacheDir,
61 const std::string& validCacheFileName);
91 bool useNumericTagStringValueSorting);
95 std::string sopInstanceUID)
const;
100 std::vector<MLuint32>& outVolumeIds,
102 bool searchAnyValue)
const;
116 std::string &currCacheState,
117 bool useRelativePaths,
118 const std::string &optionalFilePrefix=
"")
const;
146 const std::string &cacheDirPath,
147 ProgressCB progressCB =
nullptr,
148 void *userData =
nullptr,
149 const float startPercentage = 0.0f,
150 const float percentageRange = 1.0f,
151 std::list<std::string> *cacheFileList =
nullptr,
168 const std::string &cachePathInput,
169 std::string &fileName,
170 std::string &cacheDirPath,
171 const MLint fileIndex=-1);
184 const std::string &cachePathInput,
186 RemoveUserFileCB userFileDeleter =
nullptr);
205 const std::string &cachePathInput,
207 bool &volumeListChanged,
208 ProgressCB progressCallback,
222 const std::string &cachePathInput,
223 const bool useRelativePaths,
224 const bool writeSingleVolumeCaches,
262 const std::string &cacheDirPath,
263 bool *volumeListChanged =
nullptr,
264 ProgressCB progressCB =
nullptr,
265 void *userData =
nullptr,
266 const float startPercentage = 0.0f,
267 const float percentageRange = 1.0f,
268 std::list<std::string> *cacheFileList =
nullptr,
275 bool *volumeListChanged =
nullptr,
276 ProgressCB progressCB =
nullptr,
277 void *userData =
nullptr,
278 const float startPercentage = 0.0f,
279 const float percentageRange = 1.0f,
280 std::list<std::string> *cacheFileList =
nullptr);
311 MultiFileVolumeList::const_iterator &volumeIt,
312 bool forceSearchInEnhancedHandles,
313 bool alsoSearchInSMFTrees,
335 const std::string &tagValue,
338 MultiFileVolumeList::const_iterator &volumeIt,
339 bool forceSearchInEnhancedHandles,
340 bool alsoSearchInSMFTrees,
355 const std::string &tagValue,
356 bool forceSearchInEnhancedHandles,
357 bool alsoSearchInSMFTrees,
372 const std::string &tagValue,
373 bool forceSearchInEnhancedHandles,
374 bool alsoSearchInSMFTrees,
407 const std::string &cacheDirPath,
408 ProgressCB progressCB ,
410 const float startPercentage ,
411 const float percentageRange ,
412 std::list<std::string> *cacheFileList ,
Project global and OS specific declarations.
#define MLMULTI_FILE_VOLUME_EXPORT
Only for diagnostic purposes.
Class to collect messages and errors related to a given frame handle.
BooleanOperation
An enumeration to define the boolean op to be performed on the results of all search items.
SortModes
Possible modes how to reorder the volumes.
Class managing a list of MultiFileVolume instances for the DirectDicomImport module; taking ownership...
MLErrorCode appendToCache(const std::string &cacheDirPath, std::string &currCacheState, bool useRelativePaths, const std::string &optionalFilePrefix="") const
Converts the current state of this to a string.
void setUpIssues(const DicomMessageCollector *dcmMsgCollector=nullptr)
Sets up the 'issues' members of all volumes; see MultiFileVolume::setUpIssues() for details.
bool equals(const MultiFileVolumeList &obj) const
Returns true if basic properties of *this and obj are identical, otherwise false.
std::set< size_t > searchVolumeIndexesWithValueInTag(unsigned int tagId, const std::string &tagValue, bool forceSearchInEnhancedHandles, bool alsoSearchInSMFTrees, DicomMessageCollector &dcmMsgCollector) const
Returns a set of indexes to volumes which contain a frame with a tag with id tagId with value tagValu...
MLErrorCode _setFromMultiCacheFile(const std::string &state, const std::string &cacheDirPath, ProgressCB progressCB, void *userData, const float startPercentage, const float percentageRange, std::list< std::string > *cacheFileList, size_t &readPos, DicomMessageCollector *dcmMsgCollector)
Helper function for setFromString: Reads the state of this from the string state; returns ML_RESULT_O...
void ProgressCB(void *usrData, const std::string &info, float state)
Progress callback which can be passed to some functions for progress bar updates in DirectDicomImport...
bool findVolumesByCriteria(TSearchTerm searchTerm, std::vector< MLuint32 > &outVolumeIds, MultiFileVolumeListFind::BooleanOperation booleanOperation, bool searchAnyValue) const
Find volumes in *this using given searchTerm (containing e.g.
void freeAllVolumes()
Deletes all volumes and reduce vector size to 0.
MLErrorCode clearResultFiles(ProgressLogger *progressLogger=nullptr) const
Clear all stored SMF-Tree files for the MultiFileVolumeList instance; cache files are not removed.
bool searchFrameWithSOPInstanceUID(const std::string &sopInstanceUID, DICOMCachedIOFileHandle &foundHandle, DICOMTagTools::ZTUIndex &ztuPosition, MultiFileVolumeList::const_iterator &volumeIt, bool forceSearchInEnhancedHandles, bool alsoSearchInSMFTrees, DicomMessageCollector &dcmMsgCollector) const
Returns position and file handle of the first frame in the first volume with the given SOPInstanceUID...
virtual ~MultiFileVolumeList()
Destructor.
MLErrorCode writeResultCache(const std::string &fileNameInput, const std::string &cachePathInput, const bool useRelativePaths, const bool writeSingleVolumeCaches, ProgressLogger *progressLogger) const
Writes all information into the cache file in the cache file directory.
MultiFileVolumeList(const MultiFileVolumeList &ref)
Copy constructor.
std::vector< MultiFileVolumeList::const_iterator > searchVolumesWithFramesWithValueInTag(unsigned int tagId, const std::string &tagValue, bool forceSearchInEnhancedHandles, bool alsoSearchInSMFTrees, DicomMessageCollector &dcmMsgCollector) const
Returns a vector of iterators to volumes which contain a frame with a tag with id tagId with value ta...
MLErrorCode setFromString(const std::string &state, const std::string &cacheDirPath, ProgressCB progressCB=nullptr, void *userData=nullptr, const float startPercentage=0.0f, const float percentageRange=1.0f, std::list< std::string > *cacheFileList=nullptr, DicomMessageCollector *dcmMsgCollector=nullptr)
Reads the state of this from the string state; returns ML_RESULT_OK on successful load and false on f...
MultiFileVolume * findVolumeByInstanceUID(std::string sopClassUID, std::string sopInstanceUID) const
Find a volume in *this using given SOPClassUID and SOPInstanceUID; see MultiFileVolumeListFind for de...
MLErrorCode loadResultCacheIntoVolumeList(const std::string &sourceFileName, const std::string &cacheDirPath, bool *volumeListChanged=nullptr, ProgressCB progressCB=nullptr, void *userData=nullptr, const float startPercentage=0.0f, const float percentageRange=1.0f, std::list< std::string > *cacheFileList=nullptr, DicomMessageCollector *dcmMsgCollector=nullptr)
Reload all information from the cache file in the cache file directory into *this.
void sortVolumes(MultiFileVolumeListSort::SortModes sortMode, bool sortUpwards, MLint rawTagId, bool useNumericTagStringValueSorting)
Sorts the volume list according the given sort criteria sortMode; see MultiFileVolumeListSort for det...
static std::string getResultCacheFileName(const std::string &fileNameInput, const std::string &cachePathInput, std::string &fileName, std::string &cacheDirPath, const MLint fileIndex=-1)
Returns the full name path of the result cache file.
MultiFileVolumeList & operator=(const MultiFileVolumeList &ref)
Assignment operator *creating copied duplicates from ref).
bool searchFrameWithValueInTag(unsigned int tagId, const std::string &tagValue, DICOMCachedIOFileHandle &foundHandle, DICOMTagTools::ZTUIndex &ztuPosition, MultiFileVolumeList::const_iterator &volumeIt, bool forceSearchInEnhancedHandles, bool alsoSearchInSMFTrees, DicomMessageCollector &dcmMsgCollector) const
Returns file handle and position of the first frame in the first volume with tagValue in a tag with i...
std::string getIssues(const DicomMessageCollector *dcmMsgCollector=nullptr) const
Returns a collected string with all issues; requires that issues have been set up before.
MLErrorCode loadResultCache(const std::string &fileNameInput, const std::string &cachePathInput, ProgressLogger *progressLogger, bool &volumeListChanged, ProgressCB progressCallback, void *userData)
Reload all information from the cache file in the cache file directory into the internal volume list ...
static MLErrorCode clearResultCacheFiles(const std::string &fileNameInput, const std::string &cachePathInput, ProgressLogger *progressLogger=nullptr, RemoveUserFileCB userFileDeleter=nullptr)
Clear all files from the cache containing result volume files in the cache file directory.
MLErrorCode loadMultiFileVolumeListCache(const std::string &fileName, bool *volumeListChanged=nullptr, ProgressCB progressCB=nullptr, void *userData=nullptr, const float startPercentage=0.0f, const float percentageRange=1.0f, std::list< std::string > *cacheFileList=nullptr)
Alternative load routine for a MultiFileVolume(List) from a cache file which first splits fileName to...
void RemoveUserFileCB(const size_t volumeIndex, const std::string &validCacheDir, const std::string &validCacheFileName)
A function callback which removes a user added cache file related to a volume which is stored in the ...
Management class used by DirectDicomImport to create, represent and describe volumes composed of mult...
Configurable logger and progress handler class which can be used as base class for logging,...
MLint32 MLErrorCode
Type of an ML Error code.
Header of FileHandle class which should be used in DICOM importing modules to resolve the filename fo...
Class implementing some search functionality on MultiFileVolumeLists.
Tool class to sort MultiFileVolumeLists according to specific properties.
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
MultiFileVolumeList DirectDicomImportOutVolumeList
For backward compatibility to DirectDicomImport applications:
std::multimap< unsigned int, std::string > TSearchTerm
Typedef to define filter criteria to filter the list of volume references e.g.