MeVisLab Toolbox Reference
|
Class containing the DCMTree look up map and the list of most recently used DICOM files as names. More...
#include <mlDICOMCachedIOTreeCacheMap.h>
Public Member Functions | |
MLDICOMCachedIOTreeCacheMap () | |
Constructor; it is initialized with 250 MB of cache for DICOM tree tag data. | |
~MLDICOMCachedIOTreeCacheMap () | |
Destructor; clears and deletes the MLDICOMCachedIODCMTreeLoaderPlugins and MLDICOMCachedIODCMTreeWriterPlugin. | |
MLint | flush (const MLint maxBytes, const bool flushAll=false) |
Flushes entries which have no other references than those ones from the cache until the given maxBytes is undergone; values < 0 for maxBytes means unlimited cache size, which means that the call is ignored; returns the number of flushed bytes; if flushAll is true and flushing unreferenced entries did not undergo maxBytes then an additional loop is performed to flush entries which have references from outside the cache if not enough can be flushed to reach maxBytes - doing this, however, may lead to duplicate entries in memory after reloading them. | |
MLint | flush () |
Same as flush(getMaxNumBytes(), false). | |
void | flushSingleFrameCache () |
Clears all cached singleFrameTrees, because they are normally excluded from normal flushing. | |
MLint | getNumFlushedBytes () const |
Returns the number of flushed bytes since most recent recent resetNumFlushedBytes(). | |
void | resetNumFlushedBytes () |
Sets counter of flushed bytes to 0. | |
MLint | getMaxNumBytes () const |
Return maximum number of bytes used for tag data. | |
void | setMaxNumMegaBytes (MLint maxNumMegaBytes) |
Set maximum number of mega bytes used for tag data. Values < 0 are clamped to 0. | |
MLint | getMaxNumMegaBytes () const |
Return maximum number of bytes used for tag data. | |
ml::IntField & | getMaxNumMegaBytesFld () |
Returns field that specifies the maximum number of mega bytes for tag data. | |
MLint | getTotalNumberOfBytes () const |
Return currently number of cached tree data in bytes. | |
void | storeSingleFrameTree (DCMTree::TreePtr singleFrameTree, const ml::DICOMCachedIOFileHandle &origFileHandle, size_t frameIndex) |
See DICOMCachedIOTreeCache::storeSingleFrameTree(). | |
MLErrorCode | addDCMTree (const ml::DICOMCachedIOFileHandle &fileHandle, DCMTree::TreePtr &treePtr) |
See DICOMCachedIOTreeCache::addDCMTree(). | |
MLErrorCode | getCachedDCMTree (const ml::DICOMCachedIOFileHandle &fileHandle, DCMTree::TreePtr &treePtr) |
See DICOMCachedIOTreeCache::getCachedDCMTree(). | |
MLErrorCode | loadDCMTree (const ml::DICOMCachedIOFileHandle &fileHandle, DCMTree::TreePtr &treePtr, ml::DicomMessageCollector &dcmMsgCollector) |
See DICOMCachedIOTreeCache::loadDCMTree(). | |
MLErrorCode | saveDCMTree (DCMTree::Const_TreePtr dcmTree, const ml::DICOMCachedIOFileHandle &fileHandle) |
See DICOMCachedIOTreeCache::saveDCMTree(). | |
void | removeAssociatedEntries (const ml::DICOMCachedIOFileHandle &fileHandle) |
Removes cached multi-frame data and/or tree related to fileHandle. | |
std::vector< MLDICOMCachedIODCMTreeLoaderPlugin * > & | getTreeLoaderPlugins () |
Return modifiable vector of DICOM tree loader plugins. | |
const std::vector< MLDICOMCachedIODCMTreeLoaderPlugin * > & | getConstTreeLoaderPlugins () const |
Return constant vector of DICOM tree loader plugins. | |
std::vector< MLDICOMCachedIODCMTreeWriterPlugin * > & | getTreeWriterPlugins () |
Return modifiable vector of DICOM tree writer plugins. | |
const std::vector< MLDICOMCachedIODCMTreeWriterPlugin * > & | getConstTreeWriterPlugins () const |
Return constant vector of DICOM tree writer plugins. | |
void | clear () |
Clears the DICOM trees cache singleton and resets all counters. | |
Protected Member Functions | |
MLErrorCode | _addDCMTree (const ml::DICOMCachedIOFileHandle &fileHandle, DCMTree::TreePtr &treePtr) |
Internal method that adds the given DICOM tree to the cache map with the specified fileHandle as key. | |
Protected Attributes | |
std::map< ml::DICOMCachedIOFileHandle, MLDICOMCachedIOTreeCacheMapEntry > | _cache |
The tree map. | |
std::map< ml::DICOMCachedIOFileHandle, MLDICOMCachedIOTreeCacheSingleMFMapEntry > | _singleFrameCache |
The map of SingleMultiFrame Frames extracted from multi-frame files. | |
std::list< ml::DICOMCachedIOFileHandle > | _recentlyCached |
Stores the file names of DCMTrees added to cache in the order of caching. | |
MLint | _totalNumBytes |
Total number of bytes in all DICOM trees. | |
MLint | _numFlushedBytes |
Counter for number of flushed bytes since most recent resetNumFlushedBytes(). | |
ml::IntField * | _limitInMegaBytesFld |
IntField specifying the maximum number of value mega bytes allowed in all DICOM trees. | |
std::vector< MLDICOMCachedIODCMTreeLoaderPlugin * > | _treeLoaderPlugins |
Vector of loader plugins. | |
std::vector< MLDICOMCachedIODCMTreeWriterPlugin * > | _treeWriterPlugins |
Vector of writer plugins. | |
Class containing the DCMTree look up map and the list of most recently used DICOM files as names.
Definition at line 37 of file mlDICOMCachedIOTreeCacheMap.h.
MLDICOMCachedIOTreeCacheMap::MLDICOMCachedIOTreeCacheMap | ( | ) |
Constructor; it is initialized with 250 MB of cache for DICOM tree tag data.
MLDICOMCachedIOTreeCacheMap::~MLDICOMCachedIOTreeCacheMap | ( | ) |
Destructor; clears and deletes the MLDICOMCachedIODCMTreeLoaderPlugins and MLDICOMCachedIODCMTreeWriterPlugin.
|
protected |
Internal method that adds the given DICOM tree to the cache map with the specified fileHandle as key.
Does not check, if fileHandle is already present in the cache.
fileHandle | Key by which the DICOM tree is added to the cache map. |
treePtr | The DICOM tree that shall be stored in the cache map. |
MLErrorCode MLDICOMCachedIOTreeCacheMap::addDCMTree | ( | const ml::DICOMCachedIOFileHandle & | fileHandle, |
DCMTree::TreePtr & | treePtr ) |
See DICOMCachedIOTreeCache::addDCMTree().
void MLDICOMCachedIOTreeCacheMap::clear | ( | ) |
Clears the DICOM trees cache singleton and resets all counters.
MLint MLDICOMCachedIOTreeCacheMap::flush | ( | ) |
Same as flush(getMaxNumBytes(), false).
Flushes entries which have no other references than those ones from the cache until the given maxBytes is undergone; values < 0 for maxBytes means unlimited cache size, which means that the call is ignored; returns the number of flushed bytes; if flushAll is true and flushing unreferenced entries did not undergo maxBytes then an additional loop is performed to flush entries which have references from outside the cache if not enough can be flushed to reach maxBytes - doing this, however, may lead to duplicate entries in memory after reloading them.
Currently the cache is organized as a FIFO list where oldest trees are flushed first.
void MLDICOMCachedIOTreeCacheMap::flushSingleFrameCache | ( | ) |
Clears all cached singleFrameTrees, because they are normally excluded from normal flushing.
MLErrorCode MLDICOMCachedIOTreeCacheMap::getCachedDCMTree | ( | const ml::DICOMCachedIOFileHandle & | fileHandle, |
DCMTree::TreePtr & | treePtr ) |
See DICOMCachedIOTreeCache::getCachedDCMTree().
|
inline |
Return constant vector of DICOM tree loader plugins.
Definition at line 113 of file mlDICOMCachedIOTreeCacheMap.h.
|
inline |
Return constant vector of DICOM tree writer plugins.
Definition at line 119 of file mlDICOMCachedIOTreeCacheMap.h.
MLint MLDICOMCachedIOTreeCacheMap::getMaxNumBytes | ( | ) | const |
Return maximum number of bytes used for tag data.
MLint MLDICOMCachedIOTreeCacheMap::getMaxNumMegaBytes | ( | ) | const |
Return maximum number of bytes used for tag data.
ml::IntField & MLDICOMCachedIOTreeCacheMap::getMaxNumMegaBytesFld | ( | ) |
Returns field that specifies the maximum number of mega bytes for tag data.
MLint MLDICOMCachedIOTreeCacheMap::getNumFlushedBytes | ( | ) | const |
Returns the number of flushed bytes since most recent recent resetNumFlushedBytes().
MLint MLDICOMCachedIOTreeCacheMap::getTotalNumberOfBytes | ( | ) | const |
Return currently number of cached tree data in bytes.
|
inline |
Return modifiable vector of DICOM tree loader plugins.
Definition at line 110 of file mlDICOMCachedIOTreeCacheMap.h.
|
inline |
Return modifiable vector of DICOM tree writer plugins.
Definition at line 116 of file mlDICOMCachedIOTreeCacheMap.h.
MLErrorCode MLDICOMCachedIOTreeCacheMap::loadDCMTree | ( | const ml::DICOMCachedIOFileHandle & | fileHandle, |
DCMTree::TreePtr & | treePtr, | ||
ml::DicomMessageCollector & | dcmMsgCollector ) |
See DICOMCachedIOTreeCache::loadDCMTree().
void MLDICOMCachedIOTreeCacheMap::removeAssociatedEntries | ( | const ml::DICOMCachedIOFileHandle & | fileHandle | ) |
Removes cached multi-frame data and/or tree related to fileHandle.
In case of a removed tree also the associated value size stored in the key is returned, otherwise in all cases 0 is returned.
void MLDICOMCachedIOTreeCacheMap::resetNumFlushedBytes | ( | ) |
Sets counter of flushed bytes to 0.
MLErrorCode MLDICOMCachedIOTreeCacheMap::saveDCMTree | ( | DCMTree::Const_TreePtr | dcmTree, |
const ml::DICOMCachedIOFileHandle & | fileHandle ) |
See DICOMCachedIOTreeCache::saveDCMTree().
Set maximum number of mega bytes used for tag data. Values < 0 are clamped to 0.
void MLDICOMCachedIOTreeCacheMap::storeSingleFrameTree | ( | DCMTree::TreePtr | singleFrameTree, |
const ml::DICOMCachedIOFileHandle & | origFileHandle, | ||
size_t | frameIndex ) |
See DICOMCachedIOTreeCache::storeSingleFrameTree().
|
protected |
The tree map.
Definition at line 135 of file mlDICOMCachedIOTreeCacheMap.h.
|
protected |
IntField specifying the maximum number of value mega bytes allowed in all DICOM trees.
Definition at line 153 of file mlDICOMCachedIOTreeCacheMap.h.
|
protected |
Counter for number of flushed bytes since most recent resetNumFlushedBytes().
Definition at line 150 of file mlDICOMCachedIOTreeCacheMap.h.
|
protected |
Stores the file names of DCMTrees added to cache in the order of caching.
Definition at line 144 of file mlDICOMCachedIOTreeCacheMap.h.
|
protected |
The map of SingleMultiFrame Frames extracted from multi-frame files.
These files are excluded from flushing, because they normally cannot be reconstructed. They have to be cleared manually.
Definition at line 141 of file mlDICOMCachedIOTreeCacheMap.h.
|
protected |
Total number of bytes in all DICOM trees.
Definition at line 147 of file mlDICOMCachedIOTreeCacheMap.h.
|
protected |
Vector of loader plugins.
Definition at line 156 of file mlDICOMCachedIOTreeCacheMap.h.
|
protected |
Vector of writer plugins.
Definition at line 159 of file mlDICOMCachedIOTreeCacheMap.h.