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 DcmEVR ident () const
 get element type identifier
virtual unsigned long getVM ()
 get value multiplicity
virtual OFCondition setVR (DcmEVR vr)
 set/change the current value representation
virtual void print (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=EET_UndefinedLength)
 write object to a stream
virtual OFCondition writeXML (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=EET_UndefinedLength)
 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 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 (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.

Detailed Description

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

Definition at line 45 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

OFCondition DcmOtherByteOtherWord::alignValue  )  [protected]
 

align the element value to an even length (padding)

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

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 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 77 of file dcvrobow.h.

References DcmOtherByteOtherWord().

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

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

virtual unsigned long DcmOtherByteOtherWord::getVM  )  [virtual]
 

get value multiplicity

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

Implements DcmObject.

virtual DcmEVR DcmOtherByteOtherWord::ident  )  const [virtual]
 

get element type identifier

Returns:
type identifier of this class

Implements DcmObject.

Reimplemented in DcmOverlayData, DcmPixelData, and DcmPixelItem.

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

virtual void DcmOtherByteOtherWord::print 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.

void DcmOtherByteOtherWord::printPixel 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

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

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.

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.

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 OFCondition DcmOtherByteOtherWord::write DcmOutputStream outStream,
const E_TransferSyntax  oxfer,
const E_EncodingType  enctype = EET_UndefinedLength
[virtual]
 

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

Reimplemented in DcmPixelData.

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

Reimplemented in DcmPixelData, DcmPixelItem, and DcmPolymorphOBOW.

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


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