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
19ML_START_NAMESPACE
21
23 template<typename CT> class DICOMCachedIOFileHandleBase;
24
26 typedef DICOMCachedIOFileHandleBase<char> DICOMCachedIOFileHandle;
28ML_END_NAMESPACE
29
33
36
37public:
40
43
46
49
54
59 void removeAssociatedEntries(const ML_NAMESPACE::DICOMCachedIOFileHandle &fileHandle);
60
63 bool hasMultiFrameCache(const ML_NAMESPACE::DICOMCachedIOFileHandle &fileHandle,
64 size_t numFrames) const;
65
81 const ML_NAMESPACE::DICOMCachedIOFileHandle &fileNamePath,
82 size_t &numFoundFrames,
83 std::string &warnDesc,
84 std::string &errDesc);
85
96 DCMTree::MFPixelTag::pixel_cont_t getCachedPixFrameData(const ML_NAMESPACE::DICOMCachedIOFileHandle &fileName,
97 size_t frameIdx,
99 size_t numFrames);
100
103 MLMFPixDataFramesCacheEntry* getCachedPixFrameCacheEntry(const ML_NAMESPACE::DICOMCachedIOFileHandle &fileName);
104
106 void clear();
107
110
111private:
112
114 static MLDICOMCachedIOPixelFrameCacheContainer *_pixelFrameCachePtr;
115
118 static MLuint _instanceCounter;
119
121 MLDICOMCachedIOPixelFrameCacheContainer& _getCachedIOPixelFrameCacheContainer() const;
122};
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 & operator=(const MLDICOMCachedIOPixelFrameCache &)=default
Default assignment operator.
~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...
MLDICOMCachedIOPixelFrameCache(const MLDICOMCachedIOPixelFrameCache &)=default
Default copy constructor.
Small helper class to manage a list of data frames related to a filename.
MLuint64 MLuint
An unsigned ML integer type with at least 64 bits used for index calculations on very large images ev...
Definition mlTypeDefs.h:505
boost::shared_ptr< const Tree > Const_TreePtr
Definition DCMTree_Lib.h:67
DICOMCachedIOFileHandleBase< char > DICOMCachedIOFileHandle
"Forward" to DICOMCachedIOFileHandle.