DcmElement Class Reference

abstract base class for all DICOM elements More...

Inheritance diagram for DcmElement:

DcmObject DcmAttributeTag DcmByteString DcmFloatingPointDouble DcmFloatingPointSingle DcmOtherByteOtherWord DcmSequenceOfItems DcmSignedLong DcmSignedShort DcmUnsignedLong DcmUnsignedShort List of all members.

Public Member Functions

 DcmElement (const DcmTag &tag, const Uint32 len=0)
 constructor.
 DcmElement (const DcmElement &old)
 copy constructor
virtual ~DcmElement ()
 destructor
DcmElementoperator= (const DcmElement &obj)
 assignment operator
virtual Uint32 calcElementLength (const E_TransferSyntax xfer, const E_EncodingType enctype)
virtual Uint32 getLength (const E_TransferSyntax=EXS_LittleEndianImplicit, const E_EncodingType=EET_UndefinedLength)
virtual OFBool isLeaf () const
OFBool valueLoaded ()
virtual void transferInit ()
virtual OFBool canWriteXfer (const E_TransferSyntax newXfer, const E_TransferSyntax oldXfer)
virtual OFCondition read (DcmInputStream &inStream, const E_TransferSyntax ixfer, const E_GrpLenEncoding glenc=EGL_noChange, const Uint32 maxReadLength=DCM_MaxReadLength)
 This function reads the data value of an attribute which is captured in the input stream and captures this information in this.
virtual OFCondition write (DcmOutputStream &outStream, const E_TransferSyntax oxfer, const E_EncodingType enctype=EET_UndefinedLength)
 This function writes this element's value to the outstream which was passed.
virtual OFCondition writeXML (ostream &out, const size_t flags=0)
 write object in XML format
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 clear ()
virtual OFCondition loadAllDataIntoMemory ()
virtual OFCondition getUint8 (Uint8 &val, const unsigned long pos=0)
virtual OFCondition getSint16 (Sint16 &val, const unsigned long pos=0)
virtual OFCondition getUint16 (Uint16 &val, const unsigned long pos=0)
virtual OFCondition getSint32 (Sint32 &val, const unsigned long pos=0)
virtual OFCondition getUint32 (Uint32 &val, const unsigned long pos=0)
virtual OFCondition getFloat32 (Float32 &val, const unsigned long pos=0)
virtual OFCondition getFloat64 (Float64 &val, const unsigned long pos=0)
virtual OFCondition getTagVal (DcmTagKey &val, const unsigned long pos=0)
virtual OFCondition getOFString (OFString &str, const unsigned long pos, OFBool normalize=OFTrue)
virtual OFCondition getOFStringArray (OFString &value, OFBool normalize=OFTrue)
 get entire element value as a character string.
virtual OFCondition getString (char *&val)
virtual OFCondition getUint8Array (Uint8 *&val)
virtual OFCondition getSint16Array (Sint16 *&val)
virtual OFCondition getUint16Array (Uint16 *&val)
virtual OFCondition getSint32Array (Sint32 *&val)
virtual OFCondition getUint32Array (Uint32 *&val)
virtual OFCondition getFloat32Array (Float32 *&val)
virtual OFCondition getFloat64Array (Float64 *&val)
OFCondition detachValueField (OFBool copy=OFFalse)
virtual OFCondition putOFStringArray (const OFString &stringValue)
virtual OFCondition putString (const char *val)
virtual OFCondition putSint16 (const Sint16 val, const unsigned long pos=0)
virtual OFCondition putUint16 (const Uint16 val, const unsigned long pos=0)
virtual OFCondition putSint32 (const Sint32 val, const unsigned long pos=0)
virtual OFCondition putUint32 (const Uint32 val, const unsigned long pos=0)
virtual OFCondition putFloat32 (const Float32 val, const unsigned long pos=0)
virtual OFCondition putFloat64 (const Float64 val, const unsigned long pos=0)
virtual OFCondition putTagVal (const DcmTagKey &attrTag, const unsigned long pos=0)
virtual OFCondition putUint8Array (const Uint8 *vals, const unsigned long num)
virtual OFCondition putSint16Array (const Sint16 *vals, const unsigned long num)
virtual OFCondition putUint16Array (const Uint16 *vals, const unsigned long num)
virtual OFCondition putSint32Array (const Sint32 *vals, const unsigned long num)
virtual OFCondition putUint32Array (const Uint32 *vals, const unsigned long num)
virtual OFCondition putFloat32Array (const Float32 *vals, const unsigned long num)
virtual OFCondition putFloat64Array (const Float64 *vals, const unsigned long num)

Protected Member Functions

void * getValue (const E_ByteOrder newByteOrder=gLocalByteOrder)
 This function returns this element's value.
OFCondition changeValue (const void *value, const Uint32 position, const Uint32 num)
OFCondition putValue (const void *value, const Uint32 length)
OFCondition createEmptyValue (const Uint32 length)
OFCondition loadValue (DcmInputStream *inStream=NULL)
 This function reads the data value of an attribute and stores the information which was read in this.
virtual void postLoadValue ()
virtual Uint8 * newValueField ()
 This function creates a byte array of Length bytes and returns this array.
void swapValueField (size_t valueWidth)
virtual void writeXMLStartTag (ostream &out, const size_t flags, const char *attrText=NULL)
 write element start tag in XML format
virtual void writeXMLEndTag (ostream &out, const size_t flags)
 write element end tag in XML format

Protected Attributes

E_ByteOrder fByteOrder

Private Attributes

DcmInputStreamFactoryfLoadValue
 required information to load value later
Uint8 * fValue
 value of the element

Detailed Description

abstract base class for all DICOM elements

Definition at line 51 of file dcelem.h.


Constructor & Destructor Documentation

DcmElement::DcmElement const DcmTag tag,
const Uint32  len = 0
 

constructor.

Create new element from given tag and length.

Parameters:
tag DICOM tag for the new element
len value length for the new element

DcmElement::DcmElement const DcmElement old  ) 
 

copy constructor

Parameters:
old element to be copied


Member Function Documentation

virtual OFCondition DcmElement::getOFStringArray OFString value,
OFBool  normalize = OFTrue
[virtual]
 

get entire element value as a character string.

In case of VM > 1 the single values are separated by a backslash ('\'). This method implements a general approach by concatenating the results of getOFString() for each value component. Derived class may implement more sophisticated methods.

Parameters:
value variable in which the result value is stored
normalize normalize each element value prior to concatenation
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented in DcmLongText, DcmOtherByteOtherWord, DcmShortText, and DcmUnlimitedText.

void* DcmElement::getValue const E_ByteOrder  newByteOrder = gLocalByteOrder  )  [protected]
 

This function returns this element's value.

The returned value corresponds to the byte ordering (little or big endian) that was passed.

Parameters:
newByteOrder The byte ordering that shall be accounted for (little or big endian).

OFCondition DcmElement::loadValue DcmInputStream inStream = NULL  )  [protected]
 

This function reads the data value of an attribute and stores the information which was read in this.

The information is either read from the inStream or (if inStream is NULL) from a different stream which was created earlier and which is accessible through the fLoadValue member variable. Note that if not all information for an attribute could be read from the stream, the function returns EC_StreamNotifyClient.

Parameters:
inStream The stream which contains the information.
Returns:
status, EC_Normal if successful, an error code otherwise

virtual Uint8* DcmElement::newValueField  )  [protected, virtual]
 

This function creates a byte array of Length bytes and returns this array.

In case Length is odd, an array of Length+1 bytes will be created and Length will be increased by 1.

Reimplemented in DcmByteString.

DcmElement& DcmElement::operator= const DcmElement obj  ) 
 

assignment operator

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

virtual OFCondition DcmElement::read DcmInputStream inStream,
const E_TransferSyntax  ixfer,
const E_GrpLenEncoding  glenc = EGL_noChange,
const Uint32  maxReadLength = DCM_MaxReadLength
[virtual]
 

This function reads the data value of an attribute which is captured in the input stream and captures this information in this.

If not all information for an attribute could be read from the stream, the function returns EC_StreamNotifyClient. Note that if certain conditions are met, this function does not actually load the data value but creates and stores an object that enables us to load this information later.

Parameters:
inStream The stream which contains the information.
ixfer 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

Implements DcmObject.

Reimplemented in DcmPixelData.

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

This function writes this element's value to the outstream which was passed.

When writing information, the byte ordering (little or big endian) of the transfer syntax which was passed will be accounted for. In case the outstream does not provide enough space for all bytes of the current element's value, only a certain part of the value will be written to the stream. This element's transfer state indicates if the all bytes of value have already been written to the stream (ERW_ready), if the writing is still in progress and more bytes need to be written to the stream (ERW_inWork) or if the writing of the bytes of this element's value has not even begun yet (ERW_init). The member variable fTransferredBytes indicates how many bytes (starting from byte 0) of this element's value have already been written to the stream. This function will return EC_Normal, if the entire value of this element has been written to the stream, it will return EC_StreamNotifyClient, if there is no more space in the buffer and _not_ all bytes of this element's value have been written, and it will return some other (error) value if there was an error.

Parameters:
outStream The stream the information will be written to.
oxfer The transfer syntax which shall be used.
enctype encoding types (undefined or explicit length) (actually unused)
Returns:
status, EC_Normal if successful, an error code otherwise

Implements DcmObject.

Reimplemented in DcmByteString, DcmFileFormat, DcmPixelData, and DcmOtherByteOtherWord.

virtual OFCondition DcmElement::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

Implements DcmObject.

Reimplemented in DcmByteString, DcmPixelData, DcmPixelSequence, DcmPixelItem, DcmSequenceOfItems, DcmOtherByteOtherWord, and DcmPolymorphOBOW.

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

write object in XML format

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

Reimplemented in DcmFileFormat, DcmPixelData, DcmPixelItem, DcmSequenceOfItems, and DcmOtherByteOtherWord.

virtual void DcmElement::writeXMLEndTag ostream &  out,
const size_t  flags
[protected, virtual]
 

write element end tag in XML format

Parameters:
out output stream to which the XML end tag is written
flags flag used to customize the output (not yet used)

virtual void DcmElement::writeXMLStartTag ostream &  out,
const size_t  flags,
const char *  attrText = NULL
[protected, virtual]
 

write element start tag in XML format

Parameters:
out output stream to which the XML start tag is written
flags flag used to customize the output (not yet used)
attrText extra attribute text to be added to the element tag


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