DcmDataset Class Reference

a class handling the DICOM dataset format (files without meta header) More...

Inheritance diagram for DcmDataset:

DcmItem DcmObject List of all members.

Public Member Functions

 DcmDataset ()
 default constructor
 DcmDataset (const DcmDataset &old)
 copy constructor
virtual ~DcmDataset ()
 destructor
virtual DcmObjectclone () const
 clone method
virtual DcmEVR ident () const
 get type identifier
E_TransferSyntax getOriginalXfer () const
virtual void print (ostream &out, const size_t flags=0, const int level=0, const char *pixelFileName=NULL, size_t *pixelCounter=NULL)
 print all elements of the dataset to a stream
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)
 This function reads the information of all attributes which are captured in the input stream and captures this information in this->elementList.
virtual OFCondition write (DcmOutputStream &outStream, const E_TransferSyntax oxfer, const E_EncodingType enctype=EET_UndefinedLength)
 write dataset 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)
 This function writes data values which are contained in this DcmDataset object to the stream which is passed as first argument.
virtual OFCondition writeSignatureFormat (DcmOutputStream &outStream, const E_TransferSyntax oxfer, const E_EncodingType enctype=EET_UndefinedLength)
 special write method for creation of digital signatures
virtual OFCondition writeXML (ostream &out, const size_t flags=0)
 write object in XML format.
virtual OFCondition clear ()
virtual OFCondition loadFile (const char *fileName, const E_TransferSyntax readXfer=EXS_Unknown, const E_GrpLenEncoding groupLength=EGL_noChange, const Uint32 maxReadLength=DCM_MaxReadLength)
 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)
 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 and sets the original representation to current

Private Member Functions

DcmDatasetoperator= (const DcmDataset &)
 private undefined copy assignment operator

Private Attributes

E_TransferSyntax Xfer
 current transfer syntax of the dataset

Detailed Description

a class handling the DICOM dataset format (files without meta header)

Definition at line 54 of file dcdatset.h.


Constructor & Destructor Documentation

DcmDataset::DcmDataset const DcmDataset old  ) 
 

copy constructor

Parameters:
old dataset to be copied


Member Function Documentation

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

clone method

Returns:
deep copy of this object

Reimplemented from DcmItem.

Definition at line 76 of file dcdatset.h.

References DcmDataset().

virtual DcmEVR DcmDataset::ident  )  const [virtual]
 

get type identifier

Returns:
type identifier of this class (EVR_dataset)

Reimplemented from DcmItem.

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

load object from a DICOM file.

This method only supports DICOM objects stored as a dataset, i.e. without meta header. Use DcmFileFormat::loadFile() to load files with meta header.

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.
Returns:
status, EC_Normal if successful, an error code otherwise

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

print all elements of the 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 DcmItem.

virtual OFCondition DcmDataset::read DcmInputStream inStream,
const E_TransferSyntax  xfer = EXS_Unknown,
const E_GrpLenEncoding  glenc = EGL_noChange,
const Uint32  maxReadLength = DCM_MaxReadLength
[virtual]
 

This function reads the information of all attributes which are captured in the input stream and captures this information in this->elementList.

Each attribute is represented as an element in this list. Having read all information for this particular data set or command, this function will also take care of group length (according to what is specified in glenc) and padding elements (don't change anything).

Parameters:
inStream The stream which contains the information.
xfer The transfer syntax which was used to encode the information in inStream.
glenc Encoding type for group length; specifies what will be done with group length tags.
maxReadLength Maximum read length for reading an attribute value.
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmItem.

virtual OFCondition DcmDataset::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
[virtual]
 

save object to a DICOM file.

This method only supports DICOM objects stored as a dataset, i.e. without meta header. Use DcmFileFormat::saveFile() to save files with meta header.

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)
Returns:
status, EC_Normal if successful, an error code otherwise

virtual OFCondition DcmDataset::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]
 

This function writes data values which are contained in this DcmDataset object to the stream which is passed as first argument.

With regard to the writing of information, the other parameters which are passed are accounted for. The function will return EC_Normal, if the information from all elements of this data set has been written to the buffer, it will return EC_StreamNotifyClient, if there is no more space in the buffer and _not_ all elements have been written to it, and it will return some other (error) value if there was an error.

Parameters:
outStream The stream that the information will be written to.
oxfer The transfer syntax which shall be used.
enctype Encoding type for sequences; specifies how sequences will be handled.
glenc Encoding type for group length; specifies what will be done with group length tags.
padenc Encoding type for padding. Specifies what will be done with padding tags.
padlen The length up to which the dataset shall be padded, if padding is desired.
subPadlen For sequences (ie sub elements), the length up to which item shall be padded, if padding is desired.
instanceLength Number of extra bytes added to the item/dataset length used when computing the padding; this parameter is for instance used to pass the length of the file meta header from the DcmFileFormat to the DcmDataset object.
Returns:
status, EC_Normal if successful, an error code otherwise

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

write dataset 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 DcmItem.

virtual OFCondition DcmDataset::writeSignatureFormat DcmOutputStream outStream,
const E_TransferSyntax  oxfer,
const E_EncodingType  enctype = EET_UndefinedLength
[virtual]
 

special write method for creation of digital signatures

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 DcmItem.

virtual OFCondition DcmDataset::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 DcmItem.


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