MeVisLab Toolbox Reference
DCMTree::IOParameter Class Referenceabstract

Base class to wrap parameters to be used for reading/writing messages. More...

#include <DCMTree_IOParameter.h>

Public Types

enum  Flags { ReadPixelData = 1 , ReadPixelDataLazily = 2 , ReadPrivateTags = 4 , ConvertToUTF8 = 8 }
 Flags to be OR'd together for create(). More...

Public Member Functions

 IOParameter ()
 Constructor.
 IOParameter (const IOParameter &other)
 Copy constructor.
virtual void setDicomContent (const std::string &content)=0
 If a DICOM content is set, any further read operation will use this content instead of a filename (which is even resetted inside setDicomContent()).
virtual std::string filename () const =0
 Returns the name of the file to be read or written.
virtual const std::string & dicomContent () const =0
 Returns the content of a (virtual) DICOM file.
virtual std::string pixelBufferFilename () const =0
 Returns the name of the optional pixel buffer file containing the image data to be written.
virtual int getFlags () const =0
 Returns the flags passed to the constructor.
virtual bool readPixelData () const =0
 Returns true if the reader should read the binary pixel data.
virtual bool readPrivateTags () const =0
 Returns true if private tags should be read.
virtual bool convertToUTF8 () const =0
 Returns true if character should be converted to UTF-8.
virtual ~IOParameter ()
 Destructor.
IOParameteroperator= (const IOParameter &other)
 Assignment operator that makes a deep copy.
virtual void setNumberOfToleratedBadTags (unsigned int numBadTags=5)
 Sets the number of tolerated bad tags that are found in a file before skipping it as bad.
virtual unsigned int getNumberOfToleratedBadTags () const
 Returns the number of tolerated bad tags that are found in a file before skipping it as bad.

Static Public Member Functions

static IOParameterPtr create (const std::string &filename, bool readImage=true, bool readPrivateTags=true, bool convertToUTF8=true, const std::string &pixelBufferFilename=std::string())
 Abstract factory create method.
static IOParameterPtr create (const std::string &filename, int flags, const std::string &pixelBufferFilename=std::string())
 Abstract factory create method.

Protected Member Functions

virtual IOParameterPtr createConcrete (const std::string &filename, int flags, const std::string &pixelBufferFilename) const =0
 Concrete factory create method of the implementing prototype, called by the abstract one.

Static Protected Member Functions

static Const_IOParameterPtr prototype ()
 Returns the current concrete prototype.
static void setPrototype (Const_IOParameterPtr prototype)
 The concrete prototype is set by the implementing DLL.

Detailed Description

Base class to wrap parameters to be used for reading/writing messages.

This is needed because the toolkits have different capabilities (Merge needs filenames, OFFIS seems to work with streams, too, etc.).

The tags to be processed can be filtered by the additional members of this class. processVR and processTagId shall be used by read/writer implementation to get the correct decision (may be changed to a more practical rule matching). Order of 'rules' is

  • ignore
  • process
  • interval (including first, excluding second)

Definition at line 43 of file DCMTree_IOParameter.h.

Member Enumeration Documentation

◆ Flags

Flags to be OR'd together for create().

Enumerator
ReadPixelData 

Enables loading of pixel data as normal DCMTree::Tag with decompressed image data.

ReadPixelDataLazily 

Enables lazy loading of PixelData as PixelDataTag.

ReadPrivateTags 

Enables reading of private tags.

ConvertToUTF8 

If enabled, converts to character set to UTF-8.

Definition at line 53 of file DCMTree_IOParameter.h.

Constructor & Destructor Documentation

◆ IOParameter() [1/2]

DCMTree::IOParameter::IOParameter ( )

Constructor.

Referenced by IOParameter(), and operator=().

◆ IOParameter() [2/2]

DCMTree::IOParameter::IOParameter ( const IOParameter & other)
explicit

Copy constructor.

References IOParameter().

◆ ~IOParameter()

virtual DCMTree::IOParameter::~IOParameter ( )
virtual

Destructor.

Member Function Documentation

◆ convertToUTF8()

virtual bool DCMTree::IOParameter::convertToUTF8 ( ) const
pure virtual

Returns true if character should be converted to UTF-8.

Referenced by create().

◆ create() [1/2]

IOParameterPtr DCMTree::IOParameter::create ( const std::string & filename,
bool readImage = true,
bool readPrivateTags = true,
bool convertToUTF8 = true,
const std::string & pixelBufferFilename = std::string() )
static

Abstract factory create method.

Parameters
filename- Full path of the input DICOM file.
readImage- If false, pixel data are skipped.
readPrivateTags- If false, private tags are skipped.
convertToUTF8- If true, performs character set conversion.
pixelBufferFilename- Full path of the optional pixel buffer file containing the image data to be written.

References convertToUTF8(), filename(), pixelBufferFilename(), and readPrivateTags().

◆ create() [2/2]

IOParameterPtr DCMTree::IOParameter::create ( const std::string & filename,
int flags,
const std::string & pixelBufferFilename = std::string() )
static

Abstract factory create method.

Parameters
filename- Full path of the input DICOM file.
flags- Combination of Flags enum.
pixelBufferFilename- Full path of the optional pixel buffer file containing the image data to be written.

References filename(), and pixelBufferFilename().

◆ createConcrete()

virtual IOParameterPtr DCMTree::IOParameter::createConcrete ( const std::string & filename,
int flags,
const std::string & pixelBufferFilename ) const
protectedpure virtual

Concrete factory create method of the implementing prototype, called by the abstract one.

Parameters
filename- Full path of the input DICOM file.
flags- OR'd flags
pixelBufferFilename- Full path of the optional pixel buffer file containing the image data to be written.

References filename(), and pixelBufferFilename().

◆ dicomContent()

virtual const std::string & DCMTree::IOParameter::dicomContent ( ) const
pure virtual

Returns the content of a (virtual) DICOM file.

◆ filename()

virtual std::string DCMTree::IOParameter::filename ( ) const
pure virtual

Returns the name of the file to be read or written.

Referenced by create(), create(), and createConcrete().

◆ getFlags()

virtual int DCMTree::IOParameter::getFlags ( ) const
pure virtual

Returns the flags passed to the constructor.

◆ getNumberOfToleratedBadTags()

virtual unsigned int DCMTree::IOParameter::getNumberOfToleratedBadTags ( ) const
virtual

Returns the number of tolerated bad tags that are found in a file before skipping it as bad.

◆ operator=()

IOParameter & DCMTree::IOParameter::operator= ( const IOParameter & other)

Assignment operator that makes a deep copy.

References IOParameter().

◆ pixelBufferFilename()

virtual std::string DCMTree::IOParameter::pixelBufferFilename ( ) const
pure virtual

Returns the name of the optional pixel buffer file containing the image data to be written.

Referenced by create(), create(), and createConcrete().

◆ prototype()

Const_IOParameterPtr DCMTree::IOParameter::prototype ( )
staticprotected

Returns the current concrete prototype.

Referenced by setPrototype().

◆ readPixelData()

virtual bool DCMTree::IOParameter::readPixelData ( ) const
pure virtual

Returns true if the reader should read the binary pixel data.

◆ readPrivateTags()

virtual bool DCMTree::IOParameter::readPrivateTags ( ) const
pure virtual

Returns true if private tags should be read.

Referenced by create().

◆ setDicomContent()

virtual void DCMTree::IOParameter::setDicomContent ( const std::string & content)
pure virtual

If a DICOM content is set, any further read operation will use this content instead of a filename (which is even resetted inside setDicomContent()).

◆ setNumberOfToleratedBadTags()

virtual void DCMTree::IOParameter::setNumberOfToleratedBadTags ( unsigned int numBadTags = 5)
virtual

Sets the number of tolerated bad tags that are found in a file before skipping it as bad.

◆ setPrototype()

void DCMTree::IOParameter::setPrototype ( Const_IOParameterPtr prototype)
staticprotected

The concrete prototype is set by the implementing DLL.

References prototype().


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