DcmFileFormat Class Reference

a class handling the DICOM file format (with meta header) More...

Inheritance diagram for DcmFileFormat:

DcmSequenceOfItems DcmElement DcmObject List of all members.

Public Member Functions

 DcmFileFormat ()
 default constructor
 DcmFileFormat (DcmDataset *dataset)
 DcmFileFormat (const DcmFileFormat &old)
 copy constructor
virtual ~DcmFileFormat ()
 destructor
DcmFileFormatoperator= (const DcmFileFormat &obj)
 assignment operator
virtual DcmObjectclone () const
 clone method
virtual DcmEVR ident () const
 get type identifier
virtual void print (ostream &out, const size_t flags=0, const int level=0, const char *pixelFileName=NULL, size_t *pixelCounter=NULL)
 print meta header and dataset to a stream
virtual OFCondition validateMetaInfo (E_TransferSyntax oxfer)
DcmMetaInfogetMetaInfo ()
DcmDatasetgetDataset ()
DcmDatasetgetAndRemoveDataset ()
virtual Uint32 calcElementLength (const E_TransferSyntax xfer, const E_EncodingType enctype)
virtual OFBool canWriteXfer (const E_TransferSyntax newXfer, const E_TransferSyntax oldXfer=EXS_Unknown)
virtual OFCondition read (DcmInputStream &inStream, const E_TransferSyntax xfer=EXS_Unknown, const E_GrpLenEncoding glenc=EGL_noChange, const Uint32 maxReadLength=DCM_MaxReadLength)
virtual OFCondition write (DcmOutputStream &outStream, const E_TransferSyntax oxfer, const E_EncodingType enctype=EET_UndefinedLength)
 write fileformat to a stream
virtual OFCondition write (DcmOutputStream &outStream, const E_TransferSyntax oxfer, const E_EncodingType enctype, const E_GrpLenEncoding glenc, const E_PaddingEncoding padenc=EPD_noChange, const Uint32 padlen=0, const Uint32 subPadlen=0, Uint32 instanceLength=0)
virtual OFCondition writeXML (ostream &out, const size_t flags=0)
 write object in XML format.
virtual OFCondition loadFile (const char *fileName, const E_TransferSyntax readXfer=EXS_Unknown, const E_GrpLenEncoding groupLength=EGL_noChange, const Uint32 maxReadLength=DCM_MaxReadLength, const E_FileReadMode readMode=ERM_autoDetect)
 load object from a DICOM file.
virtual OFCondition saveFile (const char *fileName, const E_TransferSyntax writeXfer=EXS_Unknown, const E_EncodingType encodingType=EET_UndefinedLength, const E_GrpLenEncoding groupLength=EGL_recalcGL, const E_PaddingEncoding padEncoding=EPD_noChange, const Uint32 padLength=0, const Uint32 subPadLength=0, const OFBool isDataset=OFFalse)
 save object to a DICOM file.
OFCondition chooseRepresentation (const E_TransferSyntax repType, const DcmRepresentationParameter *repParam)
OFBool hasRepresentation (const E_TransferSyntax repType, const DcmRepresentationParameter *repParam)
void removeAllButOriginalRepresentations ()
 removes all but the original representation in all pixel data elements
void removeAllButCurrentRepresentations ()
 removes all but the current representation in all pixel data elements.
E_FileReadMode getReadMode () const
 get current file read mode.
void setReadMode (const E_FileReadMode readMode)
 set current file read mode.
virtual OFCondition insertItem (DcmItem *item, const unsigned long where=DCM_EndOfListIndex)
virtual DcmItemremove (const unsigned long num)
virtual DcmItemremove (DcmItem *item)
virtual OFCondition clear ()

Private Member Functions

OFCondition checkValue (DcmMetaInfo *metainfo, DcmDataset *dataset, const DcmTagKey &atagkey, DcmObject *obj, const E_TransferSyntax oxfer)
E_TransferSyntax lookForXfer (DcmMetaInfo *metainfo)

Private Attributes

E_FileReadMode FileReadMode
 file read mode, specifies whether to read the meta header or not

Detailed Description

a class handling the DICOM file format (with meta header)

Definition at line 55 of file dcfilefo.h.


Constructor & Destructor Documentation

DcmFileFormat::DcmFileFormat const DcmFileFormat old  ) 
 

copy constructor

Parameters:
old element to be copied


Member Function Documentation

virtual DcmObject* DcmFileFormat::clone  )  const [inline, virtual]
 

clone method

Returns:
deep copy of this object

Reimplemented from DcmSequenceOfItems.

Definition at line 85 of file dcfilefo.h.

References DcmFileFormat().

E_FileReadMode DcmFileFormat::getReadMode  )  const [inline]
 

get current file read mode.

This mode specifies whether a file is read as a fileformat or dataset (without meta header). In addition, the reading can be restricted to DICOM files only.

Returns:
file read mode

Definition at line 234 of file dcfilefo.h.

References FileReadMode.

virtual DcmEVR DcmFileFormat::ident  )  const [virtual]
 

get type identifier

Returns:
type identifier of this class (EVR_fileFormat)

Reimplemented from DcmSequenceOfItems.

virtual OFCondition DcmFileFormat::loadFile const char *  fileName,
const E_TransferSyntax  readXfer = EXS_Unknown,
const E_GrpLenEncoding  groupLength = EGL_noChange,
const Uint32  maxReadLength = DCM_MaxReadLength,
const E_FileReadMode  readMode = ERM_autoDetect
[virtual]
 

load object from a DICOM file.

This method supports DICOM objects stored as a file (with meta header) or as a dataset (without meta header). By default, the presence of a meta header is detected automatically.

Parameters:
fileName name of the file to load
readXfer transfer syntax used to read the data (auto detection if EXS_Unknown)
groupLength flag, specifying how to handle the group length tags
maxReadLength maximum number of bytes to be read for an element value. Element values with a larger size are not loaded until their value is retrieved (with getXXX()) or loadAllDataElements() is called.
readMode read file with or without meta header, i.e. as a fileformat or a dataset. Use ERM_fileOnly in order to force the presence of a meta header.
Returns:
status, EC_Normal if successful, an error code otherwise

DcmFileFormat& DcmFileFormat::operator= const DcmFileFormat obj  ) 
 

assignment operator

Parameters:
obj fileformat to be assigned/copied
Returns:
reference to this object

virtual void DcmFileFormat::print ostream &  out,
const size_t  flags = 0,
const int  level = 0,
const char *  pixelFileName = NULL,
size_t *  pixelCounter = NULL
[virtual]
 

print meta header and dataset to a stream

Parameters:
out output stream
flags optional flag used to customize the output (see DCMTypes::PF_xxx)
level current level of nested items. Used for indentation.
pixelFileName not used
pixelCounter not used

Reimplemented from DcmSequenceOfItems.

void DcmFileFormat::removeAllButCurrentRepresentations  )  [inline]
 

removes all but the current representation in all pixel data elements.

Makes the current representation original.

Definition at line 224 of file dcfilefo.h.

References DcmDataset::removeAllButCurrentRepresentations().

virtual OFCondition DcmFileFormat::saveFile const char *  fileName,
const E_TransferSyntax  writeXfer = EXS_Unknown,
const E_EncodingType  encodingType = EET_UndefinedLength,
const E_GrpLenEncoding  groupLength = EGL_recalcGL,
const E_PaddingEncoding  padEncoding = EPD_noChange,
const Uint32  padLength = 0,
const Uint32  subPadLength = 0,
const OFBool  isDataset = OFFalse
[virtual]
 

save object to a DICOM file.

Parameters:
fileName name of the file to save
writeXfer transfer syntax used to write the data (EXS_Unknown means use current)
encodingType flag, specifying the encoding with undefined or explicit length
groupLength flag, specifying how to handle the group length tags
padEncoding flag, specifying how to handle the padding tags
padLength number of bytes used for the dataset padding (has to be an even number)
subPadLength number of bytes used for the item padding (has to be an even number)
isDataset if true, file is stored without meta header, i.e. as pure dataset
Returns:
status, EC_Normal if successful, an error code otherwise

void DcmFileFormat::setReadMode const E_FileReadMode  readMode  )  [inline]
 

set current file read mode.

This mode specifies whether a file is read as a fileformat or dataset (without meta header). In addition, the reading can be restricted to DICOM files only.

Parameters:
readMode file read mode to be set

Definition at line 244 of file dcfilefo.h.

References FileReadMode.

virtual OFCondition DcmFileFormat::write DcmOutputStream outStream,
const E_TransferSyntax  oxfer,
const E_EncodingType  enctype = EET_UndefinedLength
[virtual]
 

write fileformat to a stream

Parameters:
outStream DICOM output stream
oxfer output transfer syntax
enctype encoding types (undefined or explicit length)
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmSequenceOfItems.

virtual OFCondition DcmFileFormat::writeXML ostream &  out,
const size_t  flags = 0
[virtual]
 

write object in XML format.

The XML declaration (e.g. <?xml version="1.0"?>) is not written by this function.

Parameters:
out output stream to which the XML document is written
flags optional flag used to customize the output (see DCMTypes::XF_xxx)
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmSequenceOfItems.


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


Generated on 20 Dec 2005 for OFFIS DCMTK Version 3.5.4 by Doxygen 1.4.5