MeVisLab Toolbox Reference
ml::DICOMCachedIOFileHandleBase< CT > Class Template Reference

Forward template declaration for typedef'ing. More...

#include <mlDICOMCachedIOFileHandle.h>

Inheritance diagram for ml::DICOMCachedIOFileHandleBase< CT >:

Public Member Functions

 DICOMCachedIOFileHandleBase ()
 Default Constructor creating a handle with an empty string.
 
 DICOMCachedIOFileHandleBase (const std::basic_string< CT > &str)
 Copy constructor.
 
bool isMultiFrameHandle () const
 Returns true if the handle is of the format "*" + fileHandlePathOrURL + "#<frameIdx>" with frameIndex from [0, ML_UINT32_MAX], otherwise false is returned; such a handle references a frame inside of a multi-frame DICOM tree.
 
bool fileExists (bool allowEmpty) const
 Returns true if the file handle can be found as file on disk, otherwise false.
 
DICOMCachedIOFileHandleBase getOriginalFrameHandle () const
 Returns the original file handle of a multi-frame handle; if the handle is no multi-frame handle then the file handle itself is returned unchanged; a multi-frame handle is assumed to be non-empty and in the format "*" + fileHandlePathOrURL + "#<frameIdx>" with frameIndex from [0, ML_UINT32_MAX].
 
unsigned int getFrameIndex () const
 Returns the unsigned index position of the referenced frame index if the handle is a multi-frame handle; if the handle is no multi-frame handle then 0 is returned; a multi-frame handle is assumed to be non-empty and in the format "*" + fileHandlePathOrURL + "#<frameIdx>" with frameIndex from [0, ML_UINT32_MAX].
 
std::basic_string< CTgetFilename () const
 Returns the resolved filename, returned by a registered DICOMCachedIOFileHandlePlugin or an empty string otherwise; the default implementation is just a return of the handle itself as a string.
 

Detailed Description

template<typename CT>
class ml::DICOMCachedIOFileHandleBase< CT >

Forward template declaration for typedef'ing.

Forward declaration to avoid include of mlDICOMCachedIOFileHandle.h.

FileHandle class which should be used in DICOM importing modules to resolve the filename for a given identifier.

The class can be used as abstraction layer to support a more generic file handling. Therefore a plugin mechanism was implemented. A DICOMCachedIOFileHandleProvider singleton registers one or more DICOMCachedIOFileHandlePlugins which implement the resolveFilename method. When DICOM importing modules need to retrieve a file, getFilename of the DICOMCachedIOFileHandle is called. The DICOMCachedIOFileHandle calls the resolveFilename method of all registered DICOMCachedIOFileHandlePlugin and returns the first string which is not empty.

Definition at line 41 of file mlDICOMCachedIOFileHandle.h.

Constructor & Destructor Documentation

◆ DICOMCachedIOFileHandleBase() [1/2]

template<typename CT >
ml::DICOMCachedIOFileHandleBase< CT >::DICOMCachedIOFileHandleBase ( )
inline

Default Constructor creating a handle with an empty string.

Definition at line 47 of file mlDICOMCachedIOFileHandle.h.

◆ DICOMCachedIOFileHandleBase() [2/2]

template<typename CT >
ml::DICOMCachedIOFileHandleBase< CT >::DICOMCachedIOFileHandleBase ( const std::basic_string< CT > & str)
inline

Copy constructor.

Definition at line 50 of file mlDICOMCachedIOFileHandle.h.

References mlrange_cast().

Member Function Documentation

◆ fileExists()

template<typename CT >
bool ml::DICOMCachedIOFileHandleBase< CT >::fileExists ( bool allowEmpty) const
inline

Returns true if the file handle can be found as file on disk, otherwise false.

If isMultiFrameHandle is true then the original file name is checked instead of the specific frame.

Parameters
allowEmptyIf true then an empty file name is considered as existing file, otherwise not.
Returns
True if the file handle exists as file on disk, otherwise false.

Definition at line 70 of file mlDICOMCachedIOFileHandle.h.

References MLFileExists(), and mlrange_cast().

◆ getFilename()

template<typename CT >
std::basic_string< CT > ml::DICOMCachedIOFileHandleBase< CT >::getFilename ( ) const
inline

Returns the resolved filename, returned by a registered DICOMCachedIOFileHandlePlugin or an empty string otherwise; the default implementation is just a return of the handle itself as a string.

If the handle is a valid multi-frame handle then the full handle including '*' at the beginning and "#<frameIdx>" at its end is returned.

Definition at line 110 of file mlDICOMCachedIOFileHandle.h.

References mlrange_cast().

◆ getFrameIndex()

template<typename CT >
unsigned int ml::DICOMCachedIOFileHandleBase< CT >::getFrameIndex ( ) const
inline

Returns the unsigned index position of the referenced frame index if the handle is a multi-frame handle; if the handle is no multi-frame handle then 0 is returned; a multi-frame handle is assumed to be non-empty and in the format "*" + fileHandlePathOrURL + "#<frameIdx>" with frameIndex from [0, ML_UINT32_MAX].

Definition at line 98 of file mlDICOMCachedIOFileHandle.h.

References mlrange_cast().

◆ getOriginalFrameHandle()

template<typename CT >
DICOMCachedIOFileHandleBase ml::DICOMCachedIOFileHandleBase< CT >::getOriginalFrameHandle ( ) const
inline

Returns the original file handle of a multi-frame handle; if the handle is no multi-frame handle then the file handle itself is returned unchanged; a multi-frame handle is assumed to be non-empty and in the format "*" + fileHandlePathOrURL + "#<frameIdx>" with frameIndex from [0, ML_UINT32_MAX].

Definition at line 82 of file mlDICOMCachedIOFileHandle.h.

References mlrange_cast().

◆ isMultiFrameHandle()

template<typename CT >
bool ml::DICOMCachedIOFileHandleBase< CT >::isMultiFrameHandle ( ) const
inline

Returns true if the handle is of the format "*" + fileHandlePathOrURL + "#<frameIdx>" with frameIndex from [0, ML_UINT32_MAX], otherwise false is returned; such a handle references a frame inside of a multi-frame DICOM tree.

Definition at line 59 of file mlDICOMCachedIOFileHandle.h.


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