MeVisLab Toolbox Reference
mlDICOMCachedIOPixelFrameCache.h
Go to the documentation of this file.
1// Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2// **InsertLicense** code
3//----------------------------------------------------------------------------------
5
10//----------------------------------------------------------------------------------
11
12#pragma once
13
15#include <mlTypeDefs.h>
16#include <DCMTree_Lib.h>
17#include "DCMTree_MFPixelTag.h"
18
21
23 template<typename CT> class DICOMCachedIOFileHandleBase;
24
26 typedef DICOMCachedIOFileHandleBase<char> DICOMCachedIOFileHandle;
29
33
36
37public:
40
43
48
53 void removeAssociatedEntries(const ML_NAMESPACE::DICOMCachedIOFileHandle &fileHandle);
54
57 bool hasMultiFrameCache(const ML_NAMESPACE::DICOMCachedIOFileHandle &fileHandle,
58 size_t numFrames) const;
59
75 const ML_NAMESPACE::DICOMCachedIOFileHandle &fileNamePath,
76 size_t &numFoundFrames,
77 std::string &warnDesc,
78 std::string &errDesc);
79
90 DCMTree::MFPixelTag::pixel_cont_t getCachedPixFrameData(const ML_NAMESPACE::DICOMCachedIOFileHandle &fileName,
91 size_t frameIdx,
93 size_t numFrames);
94
97 MLMFPixDataFramesCacheEntry* getCachedPixFrameCacheEntry(const ML_NAMESPACE::DICOMCachedIOFileHandle &fileName);
98
100 void clear();
101
104
105private:
106
108 static MLDICOMCachedIOPixelFrameCacheContainer *_pixelFrameCachePtr;
109
112 static MLuint _instanceCounter;
113
115 MLDICOMCachedIOPixelFrameCacheContainer& _getCachedIOPixelFrameCacheContainer() const;
116};
Project global and OS specific declarations.
#define MLDICOMCachedIO_EXPORT
If included by external modules, exported symbols are declared as import symbols.
DCMTree::pixel_cont_t pixel_cont_t
Structure containing a container for pixel frames and an index of the most recently used one.
Class for cached DICOM tag loading from files for DICOM importing modules.
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 ...
~MLDICOMCachedIOPixelFrameCache()
Destructor. Decrements the reference counting and deletes the cache if the new count is 0.
const MLDICOMCachedIOPixelFrameCacheContainer * getCachedIOPixelFrameCacheContainer() const
Returns a constant pointer to the singleton object.
void removeAssociatedEntries(const ml::DICOMCachedIOFileHandle &fileHandle)
Searches all tags and pixel data frames with the given fileHandle in the cache and removes them; note...
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,...
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...
static MLDICOMCachedIOPixelFrameCache singletonProxy()
Singleton and cache management: Singleton returning the global pixel frame cache.
MLDICOMCachedIOPixelFrameCache()
Constructor. Increments the reference counting and creates a cache if the count is 0.
void clear()
Clears the DICOM tag cache container.
MLMFPixDataFramesCacheEntry * getCachedPixFrameCacheEntry(const ml::DICOMCachedIOFileHandle &fileName)
Return the entry of the frame cache in MLDICOMCachedIOPixelFrameCacheContainer associated with the ha...
Small helper class to manage a list of data frames related to a filename.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
MLuint64 MLuint
An unsigned ML integer type with at least 64 bits used for index calculations on very large images ev...
Definition mlTypeDefs.h:506
boost::shared_ptr< const Tree > Const_TreePtr
Definition DCMTree_Lib.h:73
DICOMCachedIOFileHandleBase< char > DICOMCachedIOFileHandle
"Forward" to DICOMCachedIOFileHandle.