DCMTK  Version 3.6.1 20120515
OFFIS DICOM Toolkit
Public Member Functions | Private Attributes
DcmPolymorphOBOW Class Reference

a class representing DICOM elements (such as uncompressed pixel data) that can be interpreted either as OB or as OW, i.e. More...

+ Inheritance diagram for DcmPolymorphOBOW:

List of all members.

Public Member Functions

 DcmPolymorphOBOW (const DcmTag &tag, const Uint32 len=0)
 constructor
 DcmPolymorphOBOW (const DcmPolymorphOBOW &old)
 copy constructor
virtual ~DcmPolymorphOBOW ()
 destructor
DcmPolymorphOBOWoperator= (const DcmPolymorphOBOW &obj)
 copy assignment operator
virtual DcmObjectclone () const
 clone method
virtual OFCondition copyFrom (const DcmObject &rhs)
 Virtual object copying.
virtual OFCondition read (DcmInputStream &inStream, const E_TransferSyntax ixfer, const E_GrpLenEncoding glenc, const Uint32 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, DcmWriteCache *wcache)
 This function writes this element's value to the outstream which was passed.
virtual OFCondition writeSignatureFormat (DcmOutputStream &outStream, const E_TransferSyntax oxfer, const E_EncodingType enctype, DcmWriteCache *wcache)
 special write method for creation of digital signatures
virtual void transferInit ()
 initialize the transfer state of this object.
virtual void transferEnd ()
 finalize the transfer state of this object.
virtual OFCondition getUint8Array (Uint8 *&val)
 get a pointer to the element value of the current element as type string.
virtual OFCondition getUint16Array (Uint16 *&val)
 get a pointer to the element value of the current element as type Uint16.
virtual OFCondition putUint8Array (const Uint8 *vals, const unsigned long num)
 replace the element value by a copy of the given Uint8 array (which is possibly multi-valued).
virtual OFCondition putUint16Array (const Uint16 *vals, const unsigned long num)
 replace the element value by a copy of the given Uint16 array (which is possibly multi-valued).
virtual OFCondition createUint8Array (const Uint32 numBytes, Uint8 *&bytes)
 create an empty Uint8 array of given number of bytes and set it.
virtual OFCondition createUint16Array (const Uint32 numWords, Uint16 *&words)
 create an empty Uint16 array of given number of words and set it.

Private Attributes

OFBool changeVR
 this flag is used during write operations in Implicit VR Little Endian and notes that the VR has temporarily been changed from OB to OW at the beginning to the write operation and needs to be changed back once the operation has finished.
DcmEVR currentVR
 the current VR of value field, which can change over time

Detailed Description

a class representing DICOM elements (such as uncompressed pixel data) that can be interpreted either as OB or as OW, i.e.

are polymorph.


Constructor & Destructor Documentation

DcmPolymorphOBOW::DcmPolymorphOBOW ( const DcmTag tag,
const Uint32  len = 0 
)

constructor

Parameters:
tagattribute tag
lenlength of the attribute value

Member Function Documentation

virtual DcmObject* DcmPolymorphOBOW::clone ( ) const [inline, virtual]

clone method

Returns:
deep copy of this object

Reimplemented from DcmOtherByteOtherWord.

Reimplemented in DcmPixelData, and DcmOverlayData.

virtual OFCondition DcmPolymorphOBOW::copyFrom ( const DcmObject rhs) [virtual]

Virtual object copying.

This method can be used for DcmObject and derived classes to get a deep copy of an object. Internally the assignment operator is called if the given DcmObject parameter is of the same type as "this" object instance. If not, an error is returned. This function permits copying an object by value in a virtual way which therefore is different to just calling the assignment operator of DcmElement which could result in slicing the object.

Parameters:
rhs- [in] The instance to copy from. Has to be of the same class type as "this" object
Returns:
EC_Normal if copying was successful, error otherwise

Reimplemented from DcmOtherByteOtherWord.

Reimplemented in DcmPixelData, and DcmOverlayData.

virtual OFCondition DcmPolymorphOBOW::createUint16Array ( const Uint32  numWords,
Uint16 *&  words 
) [virtual]

create an empty Uint16 array of given number of words and set it.

All array elements are initialized with a value of 0 (using 'memzero'). This method is only applicable to OW data.

Parameters:
numWordsnumber of words (16 bit) to be created
wordsstores the pointer to the resulting buffer
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmOtherByteOtherWord.

Reimplemented in DcmPixelData.

virtual OFCondition DcmPolymorphOBOW::createUint8Array ( const Uint32  numBytes,
Uint8 *&  bytes 
) [virtual]

create an empty Uint8 array of given number of bytes and set it.

All array elements are initialized with a value of 0 (using 'memzero'). This method is only applicable to certain VRs, e.g. OB.

Parameters:
numBytesnumber of bytes (8 bit) to be created
bytesstores the pointer to the resulting buffer
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmOtherByteOtherWord.

Reimplemented in DcmPixelData.

virtual OFCondition DcmPolymorphOBOW::getUint16Array ( Uint16 *&  val) [virtual]

get a pointer to the element value of the current element as type Uint16.

Requires element to be of corresponding VR, otherwise an error is returned. This method does not copy, but returns a pointer to the element value, which remains under control of this object and is valid only until the next read, write or put operation.

Parameters:
valpointer to value returned in this parameter upon success
Returns:
EC_Normal upon success, an error code otherwise

Reimplemented from DcmOtherByteOtherWord.

virtual OFCondition DcmPolymorphOBOW::getUint8Array ( Uint8 *&  val) [virtual]

get a pointer to the element value of the current element as type string.

Requires element to be of corresponding VR, otherwise an error is returned. This method does not copy, but returns a pointer to the element value, which remains under control of this object and is valid only until the next read, write or put operation.

Parameters:
valpointer to value returned in this parameter upon success
Returns:
EC_Normal upon success, an error code otherwise

Reimplemented from DcmOtherByteOtherWord.

DcmPolymorphOBOW& DcmPolymorphOBOW::operator= ( const DcmPolymorphOBOW obj)

copy assignment operator

Parameters:
objelement to be copied
virtual OFCondition DcmPolymorphOBOW::putUint16Array ( const Uint16 *  vals,
const unsigned long  num 
) [virtual]

replace the element value by a copy of the given Uint16 array (which is possibly multi-valued).

Requires element to be of corresponding VR, otherwise an error is returned.

Parameters:
valsnew attribute value
numnumber of values in array vals
Returns:
EC_Normal upon success, an error code otherwise

Reimplemented from DcmOtherByteOtherWord.

Reimplemented in DcmPixelData.

virtual OFCondition DcmPolymorphOBOW::putUint8Array ( const Uint8 *  vals,
const unsigned long  num 
) [virtual]

replace the element value by a copy of the given Uint8 array (which is possibly multi-valued).

Requires element to be of corresponding VR, otherwise an error is returned.

Parameters:
valsnew attribute value
numnumber of values in array vals
Returns:
EC_Normal upon success, an error code otherwise

Reimplemented from DcmOtherByteOtherWord.

Reimplemented in DcmPixelData.

virtual OFCondition DcmPolymorphOBOW::read ( DcmInputStream inStream,
const E_TransferSyntax  ixfer,
const E_GrpLenEncoding  glenc,
const Uint32  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:
inStreamThe stream which contains the information.
ixferThe transfer syntax which was used to encode the information in inStream.
glencEncoding type for group length; specifies what will be done with group length tags.
maxReadLengthMaximum read length for reading an attribute value.
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmElement.

Reimplemented in DcmPixelData.

virtual void DcmPolymorphOBOW::transferEnd ( ) [virtual]

finalize the transfer state of this object.

This method must be called when reading/writing this object from/to a stream has been completed.

Reimplemented from DcmObject.

Reimplemented in DcmPixelData.

virtual void DcmPolymorphOBOW::transferInit ( ) [virtual]

initialize the transfer state of this object.

This method must be called before this object is written to a stream or read (parsed) from a stream.

Reimplemented from DcmElement.

Reimplemented in DcmPixelData.

virtual OFCondition DcmPolymorphOBOW::write ( DcmOutputStream outStream,
const E_TransferSyntax  oxfer,
const E_EncodingType  enctype,
DcmWriteCache wcache 
) [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:
outStreamThe stream the information will be written to.
oxferThe transfer syntax which shall be used.
enctypeencoding types (undefined or explicit length) (actually unused)
wcachepointer to write cache object, may be NULL
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmOtherByteOtherWord.

Reimplemented in DcmPixelData.

virtual OFCondition DcmPolymorphOBOW::writeSignatureFormat ( DcmOutputStream outStream,
const E_TransferSyntax  oxfer,
const E_EncodingType  enctype,
DcmWriteCache wcache 
) [virtual]

special write method for creation of digital signatures

Parameters:
outStreamDICOM output stream
oxferoutput transfer syntax
enctypeencoding types (undefined or explicit length)
wcachepointer to write cache object, may be NULL
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmOtherByteOtherWord.

Reimplemented in DcmPixelData.


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


Generated on Tue May 15 2012 for DCMTK Version 3.6.1 20120515 by Doxygen 1.7.5.1-20111027