MeVisLab Toolbox Reference
MLDICOMCachedIOPixelFrameCache Class Reference

Class for cached DICOM tag loading from files for DICOM importing modules. More...

#include <mlDICOMCachedIOPixelFrameCache.h>

Public Member Functions

 MLDICOMCachedIOPixelFrameCache ()
 Constructor. Increments the reference counting and creates a cache if the count is 0.
 
 ~MLDICOMCachedIOPixelFrameCache ()
 Destructor. Decrements the reference counting and deletes the cache if the new count is 0.
 
void removeAssociatedEntries (const ml::DICOMCachedIOFileHandle &fileHandle)
 Searches all tags and pixel data frames with the given fileHandle in the cache and removes them; note that this function has complexity O(n) since it has to check all cache entries.
 
bool hasMultiFrameCache (const ml::DICOMCachedIOFileHandle &fileHandle, size_t numFrames) const
 Returns true if a frame data cache is available for the fileHandle which has numFrames frames, otherwise false.
 
void loadMultiFramesInCache (DCMTree::Const_TreePtr mfTree, const ml::DICOMCachedIOFileHandle &fileNamePath, size_t &numFoundFrames, std::string &warnDesc, std::string &errDesc)
 If the given tree is a multi-frame tree then load all frame into the multi-frame tag cache; otherwise the multi-frame cache is not changed.
 
DCMTree::MFPixelTag::pixel_cont_t getCachedPixFrameData (const ml::DICOMCachedIOFileHandle &fileName, size_t frameIdx, DCMTree::MFPixelTag::pixel_cont_t pixFrameData, size_t numFrames)
 Function to create a multi-frame pixel data cache associated to a filename and to cache a data frame in it or if that one already exists, to read a frame from it.
 
MLMFPixDataFramesCacheEntrygetCachedPixFrameCacheEntry (const ml::DICOMCachedIOFileHandle &fileName)
 Return the entry of the frame cache in MLDICOMCachedIOPixelFrameCacheContainer associated with the handle for direct access; this breaks interfaces and future implementations will fix this, use this with care!
 
void clear ()
 Clears the DICOM tag cache container.
 
const MLDICOMCachedIOPixelFrameCacheContainergetCachedIOPixelFrameCacheContainer () const
 Returns a constant pointer to the singleton object.
 

Static Public Member Functions

static MLDICOMCachedIOPixelFrameCache singletonProxy ()
 Singleton and cache management: Singleton returning the global pixel frame cache.
 

Detailed Description

Class for cached DICOM tag loading from files for DICOM importing modules.

Definition at line 35 of file mlDICOMCachedIOPixelFrameCache.h.

Constructor & Destructor Documentation

◆ MLDICOMCachedIOPixelFrameCache()

MLDICOMCachedIOPixelFrameCache::MLDICOMCachedIOPixelFrameCache ( )

Constructor. Increments the reference counting and creates a cache if the count is 0.

◆ ~MLDICOMCachedIOPixelFrameCache()

MLDICOMCachedIOPixelFrameCache::~MLDICOMCachedIOPixelFrameCache ( )

Destructor. Decrements the reference counting and deletes the cache if the new count is 0.

Member Function Documentation

◆ clear()

void MLDICOMCachedIOPixelFrameCache::clear ( )

Clears the DICOM tag cache container.

◆ getCachedIOPixelFrameCacheContainer()

const MLDICOMCachedIOPixelFrameCacheContainer * MLDICOMCachedIOPixelFrameCache::getCachedIOPixelFrameCacheContainer ( ) const

Returns a constant pointer to the singleton object.

◆ getCachedPixFrameCacheEntry()

MLMFPixDataFramesCacheEntry * MLDICOMCachedIOPixelFrameCache::getCachedPixFrameCacheEntry ( const ml::DICOMCachedIOFileHandle & fileName)

Return the entry of the frame cache in MLDICOMCachedIOPixelFrameCacheContainer associated with the handle for direct access; this breaks interfaces and future implementations will fix this, use this with care!

◆ getCachedPixFrameData()

DCMTree::MFPixelTag::pixel_cont_t MLDICOMCachedIOPixelFrameCache::getCachedPixFrameData ( const ml::DICOMCachedIOFileHandle & fileName,
size_t frameIdx,
DCMTree::MFPixelTag::pixel_cont_t pixFrameData,
size_t numFrames )

Function to create a multi-frame pixel data cache associated to a filename and to cache a data frame in it or if that one already exists, to read a frame from it.

If pixFrameData is passed as a non nullptr pointer and numFrames is > 0 then it is inserted in the cache associated to fileName; if necessary a new cache entry for that file name is created. If numFrames is 0 or the pixFrameData is empty then it is tried to get a frame for frameIdx from file fileName if possible. If that is not possible then an empty frame data is returned. This cache manages only a very small amount of caches for filenames. If necessary the older caches are thrown away to add newly requested ones.

◆ hasMultiFrameCache()

bool MLDICOMCachedIOPixelFrameCache::hasMultiFrameCache ( const ml::DICOMCachedIOFileHandle & fileHandle,
size_t numFrames ) const

Returns true if a frame data cache is available for the fileHandle which has numFrames frames, otherwise false.

◆ loadMultiFramesInCache()

void MLDICOMCachedIOPixelFrameCache::loadMultiFramesInCache ( DCMTree::Const_TreePtr mfTree,
const ml::DICOMCachedIOFileHandle & fileNamePath,
size_t & numFoundFrames,
std::string & warnDesc,
std::string & errDesc )

If the given tree is a multi-frame tree then load all frame into the multi-frame tag cache; otherwise the multi-frame cache is not changed.

IMPORTANT: This routine does not handle negative slice spacings as they are appearing e.g. in NM modality data which requires inverse data stacking. This stacking must be handled in data copy routines independently.

Parameters
mfTreeThe DICOM tag tree from which all single frame trees will be extracted.
fileNamePathIs the absolute file name of the multi-frame file.
numFoundFramesIs set to the number of frames found in the tree or 0 on error or if no frames are found.
warnDescis returned empty on success or if the data set is no multi-frame file, otherwise it is set to a string describing the problem, for example that a data set can only be imported partially.
errDescis returned empty on success or if the data set is no multi-frame file, otherwise it is set to a string describing the problem.

◆ removeAssociatedEntries()

void MLDICOMCachedIOPixelFrameCache::removeAssociatedEntries ( const ml::DICOMCachedIOFileHandle & fileHandle)

Searches all tags and pixel data frames with the given fileHandle in the cache and removes them; note that this function has complexity O(n) since it has to check all cache entries.

If the incoming handle is not an enhanced handle then also tags are cleared which have multi-frame handles built from fileHandle.

◆ singletonProxy()

static MLDICOMCachedIOPixelFrameCache MLDICOMCachedIOPixelFrameCache::singletonProxy ( )
static

Singleton and cache management: Singleton returning the global pixel frame cache.

The instance will be created automatically if still not existent.


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