16 #include <ThirdPartyWarningsDisable.h>
19 #include <boost/unordered_map.hpp>
20 #include <ThirdPartyWarningsRestore.h>
29 namespace ML_NAMESPACE {
43 _subImagesFlipped(false)
45 _pixDatas.resize(numFrames);
52 std::vector<DCMTree::MFPixelTag::pixel_cont_t>
_pixDatas;
72 enum { MaxPixFrameDataCacheEntries = 3 };
96 size_t &numFoundFrames,
97 std::string &warnDesc,
98 std::string &errDesc);
121 size_t &numFoundFrames,
122 std::string &errDesc);
126 const boost::uint32_t numFrames,
127 std::string &warnDesc,
128 std::string &errDesc);
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.
void removeAssociatedEntries(const std::string &fileName)
Clears the entrie(s) of the MLDICOMCachedIOPixelFrameCacheContainer which belong to fileName.
void clear()
Clears the MLDICOMCachedIOPixelFrameCacheContainer, the pixel frame caches, and resets all counters.
size_t _recentMFPixTagCacheIdx
Index to the recently created MFPixTagCache object.
MLMFPixDataFramesCacheEntry * getPixFrameCacheEntry(const std::string &fileName)
Return the vector of subimages associated with with pixel frame data; it depends by the application w...
void _fillMFCacheWithFloatData(DCMTree::Const_TreePtr mfTree, const ml::DICOMCachedIOFileHandle &fileNamePath, const boost::uint32_t numFrames, std::string &warnDesc, std::string &errDesc)
Helper function.
MLDICOMCachedIOPixelFrameCacheContainer()
Constructor; it is initialized with 25 MB of cache for DICOM tree tag data.
bool hasPixFrameDataCache(const std::string &fileName, size_t numFrames) const
If there is a pixel data cache for file name with numFrames then it returns true, otherwise false.
void _fillMFCacheFromMFPixelTag(const DCMTree::MFPixelTag &mfPixelDataTag, const ml::DICOMCachedIOFileHandle &fileNamePath, size_t &numFoundFrames, std::string &errDesc)
Helper function.
~MLDICOMCachedIOPixelFrameCacheContainer()
Destructor, cleaning up internal objects.
void loadMultiFramesInCache(DCMTree::Const_TreePtr mfTree, const ml::DICOMCachedIOFileHandle &fileNamePath, size_t &numFoundFrames, std::string &warnDesc, std::string &errDesc)
See MLDICOMCachedIOPixelFrameCache::loadMultiFramesInCache().
DCMTree::MFPixelTag::pixel_cont_t getPixFrameData(const std::string &fileName, size_t frameIdx, size_t numFrames)
If there is a pixel data cache for a file name then return a cache reference, otherwise nullptr is re...
DCMTree::MFPixelTag::pixel_cont_t getCachedPixFrameData(const ml::DICOMCachedIOFileHandle &fileName, size_t frameIdx, DCMTree::MFPixelTag::pixel_cont_t pixFrameData, size_t numFrames)
See MLDICOMCachedIOPixelFrameCache::getCachedPixFrameData().
void addPixFrameData(const std::string &fileName, size_t frameIdx, DCMTree::MFPixelTag::pixel_cont_t pixFrameData, size_t numFrames)
Add DICOM pixel data frame to the cache under the fileName as key; addPixFrameData requests with an e...
Small helper class to manage a list of data frames related to a filename.
std::vector< ml::SubImage > _frameSubImages
Array of fully constructed subimages containing the frames.
bool _subImagesFlipped
Indicates that subimages have been flipped, for example to compensate a negative slice spacing.
MLMFPixDataFramesCacheEntry(const std::string &fileName, size_t numFrames)
Constructor to store the filename and to set the size of the array for its data frames.
std::string _fileName
Name of the file from which the frames come.
std::vector< DCMTree::MFPixelTag::pixel_cont_t > _pixDatas
Array of raw frame data pointers.
Header of FileHandle class which should be used in DICOM importing modules to resolve the filename fo...
boost::shared_ptr< const Tree > Const_TreePtr
DICOMCachedIOFileHandleBase< char > DICOMCachedIOFileHandle
"Forward" to DICOMCachedIOFileHandle.