MeVisLab Toolbox Reference
mlDICOMCachedIOTools.h File Reference

Some DICOM related tools functions. More...

#include "MLDICOMCachedIOSystem.h"
#include "mlTypeDefs.h"
#include <FMEThirdPartyWarningsDisable.h>
#include <string>
#include <sstream>
#include <FMEThirdPartyWarningsRestore.h>
#include <DCMTree_Lib.h>

Go to the source code of this file.

Namespaces

namespace  ml
 Main documentation file for ML users and developers.
 
namespace  ml::DICOMCachedIOTools
 

Enumerations

enum  { ml::DICOMCachedIOTools::NumLosslessTransferSyntaxes = 8 }
 Number of supported lossless compression transfer syntax modes. More...
 

Functions

MLDICOMCachedIO_EXPORT void ml::DICOMCachedIOTools::pushMessageCollecting ()
 Takes current message handles of DCMTree library and uses redirectStream() to push current handler and message states on a stack and sets up own handlers to collect all messages from that handler and from std::cerr stream; needs to be restored with popMessageCollecting();.
 
MLDICOMCachedIO_EXPORT void ml::DICOMCachedIOTools::popMessageCollecting (DicomMessageCollector &dcmMsgCollector, const std::string &callersMessage, size_t outStrMaxSize=std::string::npos, bool addClampInfo=true)
 Restores states which must have been saved before with pushMessageCollecting() and sends collected (and possibly processed) messages to dcmMsgCollector for further processing.
 
MLDICOMCachedIO_EXPORT void ml::DICOMCachedIOTools::redirectStream (std::ostream &outputStream, std::streambuf *&tempBuf, std::stringbuf *&stringBuffer)
 Redirect outputs to outputStream into the temporary buffer tmpBuf.
 
MLDICOMCachedIO_EXPORT std::string ml::DICOMCachedIOTools::unRedirectStream (std::ostream &outputStream, std::streambuf *&tmpBuf, std::stringbuf *&stringBuffer, size_t outStrMaxSize=std::string::npos, bool addClampInfo=true)
 Undo the redirected output of outputStream into the temporary buffer tmpBuf.
 
MLDICOMCachedIO_EXPORT void ml::DICOMCachedIOTools::makeWarningsWarningsAndErrorsErrors (std::string &messageString)
 Some messages for example from DCMTree(_OFFIS) are not marked with "error" or "warnings" and cannot be filtered correctly therefore in DicomMessageFilters.
 
MLDICOMCachedIO_EXPORT DCMTree::TreePtr ml::DICOMCachedIOTools::getDirectDCMTree (const std::string &fName, DicomMessageCollector &dcmMsgCollector, bool loadPixelData=false)
 Tries to open a file directly by reading it with the DCMTree interfaces and returns a non constant TreePtr pointer on success or a nullptr TreePtr on failure.
 
MLDICOMCachedIO_EXPORT DCMTree::TransferSyntax ml::DICOMCachedIOTools::getLosslessStorageTransferSyntax (DCMTree::Const_TreePtr dcmTree)
 If dcmTree has a TransferSyntaxUID tag matching one form LosslessTransferSyntaxUIDs then the corresponding DCMTree::TransferSyntax is returned, otherwise DCMTree::EXPLICIT_LITTLE_ENDIAN is returned.
 
MLDICOMCachedIO_EXPORT DCMTree::Const_TagPtr ml::DICOMCachedIOTools::getPrivateTag (const std::string &privateCreatorString, unsigned short groupId, DCMTree::RawTagId lowerEightBitOfElementId, DCMTree::Const_TreePtr dcmTree)
 If a private creator tag with value privateCreatorString in a private slot with groupId and a tag with element id lowerEightBitOfElementId is found then the private tag is returned; in all other cases nullptr is returned.
 
MLDICOMCachedIO_EXPORT bool ml::DICOMCachedIOTools::isPhilips3D (DCMTree::Const_TreePtr dcmTree, MLint *spatialExtent=nullptr)
 Looks for Philips3D format and if there is an extra spatial extent then it is returned in spatialExtent (if non-nullptr) and true is returned, in all other cases false is returned and spatialExtent is unchanged.
 
MLDICOMCachedIO_EXPORT unsigned int ml::DICOMCachedIOTools::getNumberOfFrames (DCMTree::Const_TreePtr dcmTree, unsigned int *fromTagOnly=nullptr)
 Returns the number of real frames in the data set from Number of Frames tag if possible including a possible private extensions such as Philips 3D; if the number of frames cannot be determined for any reason then 0 is returned; if fromTagOnly is not nullptr then the value of the Number Of Frames tag is returned or 0 if not possible.
 
MLDICOMCachedIO_EXPORT DCMTree::PixelData ml::DICOMCachedIOTools::getPixelDataPtrFromTree (DCMTree::Const_TreePtr treePtr, size_t *valSizeInBytes, DicomMessageCollector &dcmMsgCollector)
 Returns the pointer to the pixel data tag value.
 
MLDICOMCachedIO_EXPORT void ml::DICOMCachedIOTools::removeAssociatedCacheEntries (const DICOMCachedIOFileHandle &fileHandle)
 Flush all cached entries related to the given file handle.
 
MLDICOMCachedIO_EXPORT void ml::DICOMCachedIOTools::clearDICOMCaches ()
 Clears all cached DICOM date including tags, trees, pixel frames and decomposed multi-frame trees.
 

Variables

MLDICOMCachedIO_EXPORT const char *const ml::DICOMCachedIOTools::LosslessTransferSyntaxUIDs [NumLosslessTransferSyntaxes]
 Supported lossless compression transfer syntax UIDs.
 
MLDICOMCachedIO_EXPORT const char *const ml::DICOMCachedIOTools::LosslessTransferSyntaxNames [NumLosslessTransferSyntaxes]
 Supported lossless compression transfer syntax names.
 
MLDICOMCachedIO_EXPORT DCMTree::TransferSyntax ml::DICOMCachedIOTools::LosslessTransferSyntaxCodes [NumLosslessTransferSyntaxes]
 DCMTree::TransferSyntax enums for supported lossless compression transfer syntax.
 

Detailed Description

Some DICOM related tools functions.

Author
Wolf Spindler
Date
2010-01-26

Definition in file mlDICOMCachedIOTools.h.