DcmPixelData Class Reference

The class DcmPixelData stores different pixel representations identified by a type (the transfer syntax) and some representation parameters The three unencapsulated transfer syntaxes belong to the same pixel representation. More...

Inheritance diagram for DcmPixelData:

DcmPolymorphOBOW DcmOtherByteOtherWord DcmElement DcmObject List of all members.

Public Member Functions

 DcmPixelData (const DcmTag &tag, const Uint32 len=0)
 DcmPixelData (const DcmPixelData &pixelData)
DcmPixelDataoperator= (const DcmPixelData &obj)
virtual DcmObjectclone () const
 clone method
virtual OFCondition setVR (DcmEVR vr)
virtual DcmEVR ident () const
virtual void print (ostream &out, const size_t flags=0, const int level=0, const char *pixelFileName=NULL, size_t *pixelCounter=NULL)
virtual OFBool canWriteXfer (const E_TransferSyntax newXfer, const E_TransferSyntax oldXfer)
 tests if it is possible to write a specific representation Only existing representations are considered, since this method does not create a representation.
virtual Uint32 calcElementLength (const E_TransferSyntax xfer, const E_EncodingType enctype)
 returns length of representation conforming to the transfer syntax with tag, vr, .
virtual Uint32 getLength (const E_TransferSyntax xfer=EXS_LittleEndianImplicit, const E_EncodingType enctype=EET_UndefinedLength)
 returns length of representation value field conforming to given transfer syntax.
virtual void transferInit ()
 Initialize a streaming operation (read, write).
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 a pixel data 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)
 writes a representation conforming to the transfer syntax It does not create a representation.
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 loadAllDataIntoMemory (void)
virtual void transferEnd ()
 Finalize a streaming operation (read, write).
OFBool canChooseRepresentation (const E_TransferSyntax repType, const DcmRepresentationParameter *repParam)
 test if it is possible to choose the representation in the parameters
OFCondition chooseRepresentation (const E_TransferSyntax repType, const DcmRepresentationParameter *repParam, DcmStack &stack)
 choose a specific representation.
void putOriginalRepresentation (const E_TransferSyntax repType, const DcmRepresentationParameter *repParam, DcmPixelSequence *pixSeq)
 Inserts an original encapsulated representation.
virtual OFCondition putUint8Array (const Uint8 *byteValue, const unsigned long length)
 The following two put-methods insert an original unencapsulated representation.
virtual OFCondition putUint16Array (const Uint16 *wordValue, const unsigned long length)
virtual OFCondition createUint8Array (const Uint32 numBytes, Uint8 *&bytes)
 create an empty Uint8 array of given number of words and set it
virtual OFCondition createUint16Array (const Uint32 numWords, Uint16 *&words)
 create an empty Uint16 array of given number of words and set it
OFCondition getEncapsulatedRepresentation (const E_TransferSyntax repType, const DcmRepresentationParameter *repParam, DcmPixelSequence *&pixSeq)
 get a specific exisiting Representation, creates no representation if repParam is NULL, then the representation conforming to the default presentationParameters (defined with the codec) is returned.
void getOriginalRepresentationKey (E_TransferSyntax &repType, const DcmRepresentationParameter *&repParam)
 returns the representation identification (key) consisting of representation type and parameter of the original representation
void getCurrentRepresentationKey (E_TransferSyntax &repType, const DcmRepresentationParameter *&repParam)
 returns the representation identification (key) consisting of representation type and parameter of the current representation
OFCondition setCurrentRepresentationParameter (const DcmRepresentationParameter *repParam)
 sets the representation identification parameter of the current representation
OFBool hasRepresentation (const E_TransferSyntax repType, const DcmRepresentationParameter *repParam=NULL)
 returns if a specific conforming representation exists.
OFCondition removeRepresentation (const E_TransferSyntax repType, const DcmRepresentationParameter *repParam)
 delete a representation.
void removeAllButOriginalRepresentations ()
 removes all but the original representation
void removeAllButCurrentRepresentations ()
 removes all but the current representation Makes the current representation original
OFCondition removeOriginalRepresentation (const E_TransferSyntax repType, const DcmRepresentationParameter *repParam)
 delete original representation and set new original representation.
void setNonEncapsulationFlag (OFBool flag)
 set or clear the flag that indicates that this pixel data element will be written in uncompressed (defined length) format even if the dataset itself is written in a compressed syntax where pixel data is normally written in encapsulated (undefined length) format.

Private Member Functions

void clearRepresentationList (DcmRepresentationListIterator leaveInList)
 This function removes all pixel representations from the list of pixel representations except the one which was passed.
OFCondition findConformingEncapsulatedRepresentation (const DcmXfer &repType, const DcmRepresentationParameter *repParam, DcmRepresentationListIterator &result)
 find a conforming representation in the list of encapsulated representations
OFCondition findRepresentationEntry (const DcmRepresentationEntry &findEntry, DcmRepresentationListIterator &result)
 find a representation entry and return an iterator to the found entry or the next element in the list.
DcmRepresentationListIterator insertRepresentationEntry (DcmRepresentationEntry *repEntry)
 insert or replace a representation entry in the list
OFCondition decode (const DcmXfer &fromType, const DcmRepresentationParameter *fromParam, DcmPixelSequence *fromPixSeq, DcmStack &pixelStack)
 decode representation to unencapsulated format
OFCondition encode (const DcmXfer &fromType, const DcmRepresentationParameter *fromParam, DcmPixelSequence *fromPixSeq, const DcmXfer &toType, const DcmRepresentationParameter *toParam, DcmStack &pixelStack)
 encode to encapsulated format
void recalcVR ()

Private Attributes

DcmRepresentationList repList
 List of representations of pixel data.
DcmRepresentationListIterator repListEnd
 Iterator to the last dummy element in representation lis.
DcmRepresentationListIterator original
 Iterator to the original representation.
DcmRepresentationListIterator current
 current list element for some operations
OFBool existUnencapsulated
 shows if an unecapsulated representation is stored
OFBool alwaysUnencapsulated
 this flag indicates that this pixel data element will be written in uncompressed (defined length) format even if the dataset itself is written in a compressed syntax where pixel data is normally written in encapsulated (undefined length) format.
DcmEVR unencapsulatedVR
 value representation of unencapsulated data
DcmPixelSequencepixelSeqForWrite
 in write function: pointer to current pixel sequence

Friends

class DcmRepresentationEntry

Detailed Description

The class DcmPixelData stores different pixel representations identified by a type (the transfer syntax) and some representation parameters The three unencapsulated transfer syntaxes belong to the same pixel representation.

A type (or transfer syntax) conforms to a representation if the type and the representation type are equal or both are unencapsulated. If this is valid for the representation read or set by chooseRepresentation then this representation is the conforming representation. else a representation with the default parameter set defined in the codec is the conforming representation.

Definition at line 148 of file dcpixel.h.


Member Function Documentation

virtual Uint32 DcmPixelData::calcElementLength const E_TransferSyntax  xfer,
const E_EncodingType  enctype
[virtual]
 

returns length of representation conforming to the transfer syntax with tag, vr, .

.. It does not create a representation. If no conforming representation exists an error code is set and 0 returned.

Reimplemented from DcmElement.

OFCondition DcmPixelData::chooseRepresentation const E_TransferSyntax  repType,
const DcmRepresentationParameter repParam,
DcmStack stack
 

choose a specific representation.

if representation does not exist it is created (if possible). if repParam is zero, a representation is chosen or created that is equal to the default representation parameters

void DcmPixelData::clearRepresentationList DcmRepresentationListIterator  leaveInList  )  [private]
 

This function removes all pixel representations from the list of pixel representations except the one which was passed.

Note that if parameter leaveInList equals repListEnd, all representations will be removed from the list.

Parameters:
leaveInList Iterator to a representation which shall not be removed from the list of representations.

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

clone method

Returns:
deep copy of this object

Reimplemented from DcmPolymorphOBOW.

Definition at line 252 of file dcpixel.h.

References DcmRepresentationEntry::DcmPixelData.

OFCondition DcmPixelData::findRepresentationEntry const DcmRepresentationEntry findEntry,
DcmRepresentationListIterator &  result
[private]
 

find a representation entry and return an iterator to the found entry or the next element in the list.

The condition returned can be EC_Normal if such an entry is found or EC_RepresentationNotFound. The pixSeq attribute in findEntry can be NULL, it is not needed for the find operation!

virtual Uint32 DcmPixelData::getLength const E_TransferSyntax  xfer = EXS_LittleEndianImplicit,
const E_EncodingType  enctype = EET_UndefinedLength
[virtual]
 

returns length of representation value field conforming to given transfer syntax.

It does not create a representation. If no conforming representation exists, an error code is set and 0 returned.

Reimplemented from DcmElement.

void DcmPixelData::putOriginalRepresentation const E_TransferSyntax  repType,
const DcmRepresentationParameter repParam,
DcmPixelSequence pixSeq
 

Inserts an original encapsulated representation.

current and original representations are changed, all old representations are deleted

virtual OFCondition DcmPixelData::putUint8Array const Uint8 *  byteValue,
const unsigned long  length
[virtual]
 

The following two put-methods insert an original unencapsulated representation.

current and original representations are changed, all old representations are deleted. The array data is copied.

Reimplemented from DcmPolymorphOBOW.

virtual OFCondition DcmPixelData::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 a pixel data attribute which is captured in the input stream and captures this information in this.

This function takes into account, if the pixel data is captured in native (uncompressed) or encapsulated (compressed) format.

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

Reimplemented from DcmPolymorphOBOW.

OFCondition DcmPixelData::removeOriginalRepresentation const E_TransferSyntax  repType,
const DcmRepresentationParameter repParam
 

delete original representation and set new original representation.

If the new representation does not exist, the original one is not deleted and an error code returns

OFCondition DcmPixelData::removeRepresentation const E_TransferSyntax  repType,
const DcmRepresentationParameter repParam
 

delete a representation.

It is not possible to delete the original representation with this method

void DcmPixelData::setNonEncapsulationFlag OFBool  flag  ) 
 

set or clear the flag that indicates that this pixel data element will be written in uncompressed (defined length) format even if the dataset itself is written in a compressed syntax where pixel data is normally written in encapsulated (undefined length) format.

By default this flag is false, unless the dataset was read in an encapsulated transfer syntax and this pixel data element was already present in uncompressed format. This flag should never be enabled for pixel data elements on the main dataset level, only for pixel data elements within the icon image sequence or some other "private" place.

Parameters:
flag new value of flag

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

writes a representation conforming to the transfer syntax It does not create a representation.

If no conforming representation exists, an error code is returned. The written representation is the new current representation

Reimplemented from DcmPolymorphOBOW.

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


Member Data Documentation

OFBool DcmPixelData::alwaysUnencapsulated [private]
 

this flag indicates that this pixel data element will be written in uncompressed (defined length) format even if the dataset itself is written in a compressed syntax where pixel data is normally written in encapsulated (undefined length) format.

By default this flag is false, unless the dataset was read in an encapsulated transfer syntax and this pixel data element was already present in uncompressed format.

Definition at line 177 of file dcpixel.h.

DcmRepresentationListIterator DcmPixelData::original [private]
 

Iterator to the original representation.

if an uncompressed representation is used the iterator points to repList.end()

Definition at line 161 of file dcpixel.h.


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