DcmOtherByteOtherWord Class Reference

a class representing the DICOM value representations 'Other Byte String' (OB) and 'Other Word String' (OW) More...

Inheritance diagram for DcmOtherByteOtherWord:

DcmElement DcmObject DcmPixelItem DcmPolymorphOBOW DcmOverlayData DcmPixelData List of all members.

Public Member Functions

 DcmOtherByteOtherWord (const DcmTag &tag, const Uint32 len=0)
 constructor.
 DcmOtherByteOtherWord (const DcmOtherByteOtherWord &old)
 copy constructor
virtual ~DcmOtherByteOtherWord ()
 destructor
DcmOtherByteOtherWordoperator= (const DcmOtherByteOtherWord &obj)
 assignment operator
virtual DcmObjectclone () const
 clone method
virtual OFCondition copyFrom (const DcmObject &rhs)
 Virtual object copying.
virtual DcmEVR ident () const
 get element type identifier
virtual OFCondition checkValue (const OFString &vm="", const OFBool oldFormat=OFFalse)
 check whether stored value conforms to the VR and to the specified VM
virtual unsigned long getVM ()
 get value multiplicity
virtual OFCondition setVR (DcmEVR vr)
 set/change the current value representation
virtual void print (STD_NAMESPACE ostream &out, const size_t flags=0, const int level=0, const char *pixelFileName=NULL, size_t *pixelCounter=NULL)
 print the current value to a stream.
virtual OFBool canWriteXfer (const E_TransferSyntax newXfer, const E_TransferSyntax oldXfer)
 check whether the transfer syntax can be changed as specified
virtual OFCondition write (DcmOutputStream &outStream, const E_TransferSyntax oxfer, const E_EncodingType enctype, DcmWriteCache *wcache)
 write object to a stream
virtual OFCondition writeXML (STD_NAMESPACE ostream &out, const size_t flags=0)
 write object in XML format to a stream
virtual OFCondition writeSignatureFormat (DcmOutputStream &outStream, const E_TransferSyntax oxfer, const E_EncodingType enctype, DcmWriteCache *wcache)
 special write method for creation of digital signatures
virtual OFCondition getUint8 (Uint8 &byteVal, const unsigned long pos=0)
 get particular 8 bit value.
virtual OFCondition getUint16 (Uint16 &wordVal, const unsigned long pos=0)
 get particular 16 bit value.
virtual OFCondition getUint8Array (Uint8 *&byteVals)
 get reference to stored 8 bit data.
virtual OFCondition getUint16Array (Uint16 *&wordVals)
 get reference to stored 16 bit data.
virtual OFCondition getOFString (OFString &stringVal, const unsigned long pos, OFBool normalize=OFTrue)
 get a particular value as a character string.
virtual OFCondition getOFStringArray (OFString &stringVal, OFBool normalize=OFTrue)
 get element value as a character string.
virtual OFCondition putUint8Array (const Uint8 *byteValue, const unsigned long numBytes)
 set element value to given 8 bit data.
virtual OFCondition putUint16Array (const Uint16 *wordValue, const unsigned long numWords)
 set element value to given 16 bit data.
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.
virtual OFCondition putString (const char *stringVal)
 set element value from the given character string.
virtual OFCondition verify (const OFBool autocorrect=OFFalse)
 check the currently stored element value

Protected Member Functions

virtual void postLoadValue ()
 method is called after the element value has been loaded.
OFCondition alignValue ()
 align the element value to an even length (padding)
void printPixel (STD_NAMESPACE ostream &out, const size_t flags, const int level, const char *pixelFileName, size_t *pixelCounter)
 print pixel data and optionally write it to a binary file.

Private Attributes

OFBool compactAfterTransfer
 this flag is used during write operations and indicates that compact() should be called once the write operation finishes.

Detailed Description

a class representing the DICOM value representations 'Other Byte String' (OB) and 'Other Word String' (OW)

Definition at line 40 of file dcvrobow.h.


Constructor & Destructor Documentation

DcmOtherByteOtherWord::DcmOtherByteOtherWord ( 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

Referenced by clone().

DcmOtherByteOtherWord::DcmOtherByteOtherWord ( const DcmOtherByteOtherWord old  ) 

copy constructor

Parameters:
old element to be copied


Member Function Documentation

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

assignment operator

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

Referenced by DcmPixelItem::operator=().

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

clone method

Returns:
deep copy of this object

Implements DcmObject.

Reimplemented in DcmOverlayData, DcmPixelData, DcmPixelItem, and DcmPolymorphOBOW.

Definition at line 72 of file dcvrobow.h.

References DcmOtherByteOtherWord().

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

Reimplemented in DcmOverlayData, DcmPixelData, DcmPixelItem, and DcmPolymorphOBOW.

virtual DcmEVR DcmOtherByteOtherWord::ident (  )  const [virtual]

get element type identifier

Returns:
type identifier of this class

Implements DcmObject.

Reimplemented in DcmOverlayData, DcmPixelData, and DcmPixelItem.

virtual OFCondition DcmOtherByteOtherWord::checkValue ( const OFString vm = "",
const OFBool  oldFormat = OFFalse 
) [virtual]

check whether stored value conforms to the VR and to the specified VM

Parameters:
vm parameter not used for this VR
oldFormat parameter not used for this VR (only for DA, TM, PN)
Returns:
always returns EC_Normal, i.e. currently no checks are performed

Reimplemented from DcmElement.

virtual unsigned long DcmOtherByteOtherWord::getVM (  )  [virtual]

get value multiplicity

Returns:
always returns 1 (according to the DICOM standard)

Implements DcmObject.

virtual OFCondition DcmOtherByteOtherWord::setVR ( DcmEVR  vr  )  [virtual]

set/change the current value representation

Parameters:
vr new value representation to be set. All VRs except for OW (Other Word String) are treated as 8 bit data (OB). This is particularily useful for unknown (UN) or unsupported VRs.
Returns:
status status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmObject.

Reimplemented in DcmPixelData.

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

print the current value to a stream.

The output format of the binary value is a backslash separated sequence of 2- or 4-digit hex numbers, e.g. "00\01\dd" or "0000\7777\aaaa\ffff".

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

Implements DcmObject.

Reimplemented in DcmPixelData, and DcmPixelItem.

virtual OFBool DcmOtherByteOtherWord::canWriteXfer ( const E_TransferSyntax  newXfer,
const E_TransferSyntax  oldXfer 
) [virtual]

check whether the transfer syntax can be changed as specified

Parameters:
newXfer transfer syntax to be checked
oldXfer not used
Returns:
OFTrue if transfer syntax can be changed to the new one, OFFalse otherwise

Reimplemented from DcmElement.

Reimplemented in DcmPixelData.

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

write object to a stream

Parameters:
outStream DICOM output stream
oxfer output transfer syntax
enctype encoding types (undefined or explicit length)
wcache pointer to write cache object, may be NULL
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmElement.

Reimplemented in DcmPixelData, and DcmPolymorphOBOW.

virtual OFCondition DcmOtherByteOtherWord::writeXML ( STD_NAMESPACE ostream &  out,
const size_t  flags = 0 
) [virtual]

write object in XML format to a stream

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

Reimplemented in DcmPixelData, and DcmPixelItem.

virtual OFCondition DcmOtherByteOtherWord::writeSignatureFormat ( DcmOutputStream outStream,
const E_TransferSyntax  oxfer,
const E_EncodingType  enctype,
DcmWriteCache wcache 
) [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)
wcache pointer to write cache object, may be NULL
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmElement.

Reimplemented in DcmPixelData, DcmPixelItem, and DcmPolymorphOBOW.

virtual OFCondition DcmOtherByteOtherWord::getUint8 ( Uint8 &  byteVal,
const unsigned long  pos = 0 
) [virtual]

get particular 8 bit value.

This method is only applicable to non-OW data, e.g. OB.

Parameters:
byteVal reference to result variable (cleared in case of error)
pos index of the value to be retrieved (0..vm-1)
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmElement.

virtual OFCondition DcmOtherByteOtherWord::getUint16 ( Uint16 &  wordVal,
const unsigned long  pos = 0 
) [virtual]

get particular 16 bit value.

This method is only applicable to OW data.

Parameters:
wordVal reference to result variable (cleared in case of error)
pos index of the value to be retrieved (0..vm-1)
Returns:
status status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmElement.

virtual OFCondition DcmOtherByteOtherWord::getUint8Array ( Uint8 *&  byteVals  )  [virtual]

get reference to stored 8 bit data.

This method is only applicable to non-OW data, e.g. OB.

Parameters:
byteVals reference to result variable
Returns:
status status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmElement.

Reimplemented in DcmPolymorphOBOW.

virtual OFCondition DcmOtherByteOtherWord::getUint16Array ( Uint16 *&  wordVals  )  [virtual]

get reference to stored 16 bit data.

This method is only applicable to OW data.

Parameters:
wordVals reference to result variable
Returns:
status status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmElement.

Reimplemented in DcmPolymorphOBOW.

virtual OFCondition DcmOtherByteOtherWord::getOFString ( OFString stringVal,
const unsigned long  pos,
OFBool  normalize = OFTrue 
) [virtual]

get a particular value as a character string.

The numeric value is converted to hex mode, i.e. an 8 bit value is represented by 2 characters (00..ff) and a 16 bit value by 4 characters (0000..ffff).

Parameters:
stringVal variable in which the result value is stored
pos index of the value in case of multi-valued elements (0..vm-1)
normalize not used
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmElement.

virtual OFCondition DcmOtherByteOtherWord::getOFStringArray ( OFString stringVal,
OFBool  normalize = OFTrue 
) [virtual]

get element value as a character string.

The numeric values are converted to hex mode, i.e. an 8 bit value is represented by 2 characters (00..ff) and a 16 bit value by 4 characters (0000..ffff). In case of VM > 1 the single values are separated by a backslash ('\').

Parameters:
stringVal variable in which the result value is stored
normalize not used
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmElement.

virtual OFCondition DcmOtherByteOtherWord::putUint8Array ( const Uint8 *  byteValue,
const unsigned long  numBytes 
) [virtual]

set element value to given 8 bit data.

This method is only applicable to non-OW data, e.g. OB.

Parameters:
byteValue 8 bit data to be set (copied)
numBytes number of bytes (8 bit) to be set
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmElement.

Reimplemented in DcmPixelData, and DcmPolymorphOBOW.

virtual OFCondition DcmOtherByteOtherWord::putUint16Array ( const Uint16 *  wordValue,
const unsigned long  numWords 
) [virtual]

set element value to given 16 bit data.

This method is only applicable to OW data.

Parameters:
wordValue 16 bit data to be set (copied)
numWords number of words (16 bit) to be set. Local byte-ordering expected.
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmElement.

Reimplemented in DcmPixelData, and DcmPolymorphOBOW.

virtual OFCondition DcmOtherByteOtherWord::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 non-OW data, e.g. OB.

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

Reimplemented from DcmElement.

Reimplemented in DcmPixelData, and DcmPolymorphOBOW.

virtual OFCondition DcmOtherByteOtherWord::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:
numWords number of words (16 bit) to be created
words stores the pointer to the resulting buffer
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmElement.

Reimplemented in DcmPixelData, and DcmPolymorphOBOW.

virtual OFCondition DcmOtherByteOtherWord::putString ( const char *  stringVal  )  [virtual]

set element value from the given character string.

The input string is expected to have the same format as described for 'getOFStringArray()' above, i.e. a backslash separated sequence of hexa-decimal numbers.

Parameters:
stringVal input character string
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmElement.

virtual OFCondition DcmOtherByteOtherWord::verify ( const OFBool  autocorrect = OFFalse  )  [virtual]

check the currently stored element value

Parameters:
autocorrect correct value padding (even length) if OFTrue
Returns:
status, EC_Normal if value length is correct, an error code otherwise

Implements DcmObject.

virtual void DcmOtherByteOtherWord::postLoadValue (  )  [protected, virtual]

method is called after the element value has been loaded.

Can be used to correct the value before it is used for the first time.

Reimplemented from DcmElement.

OFCondition DcmOtherByteOtherWord::alignValue (  )  [protected]

align the element value to an even length (padding)

Returns:
status, EC_Normal if successful, an error code otherwise

void DcmOtherByteOtherWord::printPixel ( STD_NAMESPACE ostream &  out,
const size_t  flags,
const int  level,
const char *  pixelFileName,
size_t *  pixelCounter 
) [protected]

print pixel data and optionally write it to a binary file.

Optional pixel data file is always written in little endian byte-ordering.

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 optional filename used to write the raw pixel data file
pixelCounter optional counter used for automatic pixel data filename creation


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


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1