DcmPixelSequence Class Reference

this class implements a sequence of pixel items, i.e. More...

Inheritance diagram for DcmPixelSequence:

DcmSequenceOfItems DcmElement DcmObject List of all members.

Public Member Functions

 DcmPixelSequence (const DcmTag &tag, const Uint32 len=0)
 constructor
 DcmPixelSequence (const DcmPixelSequence &old)
 copy constructor
virtual ~DcmPixelSequence ()
 destructor
DcmPixelSequenceoperator= (const DcmPixelSequence &obj)
 copy assignment operator
virtual DcmObjectclone () const
 clone method
virtual OFCondition copyFrom (const DcmObject &rhs)
 Virtual object copying.
virtual DcmEVR ident (void) const
 get type identifier
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 all elements of the item to a stream
virtual Uint32 calcElementLength (const E_TransferSyntax xfer, const E_EncodingType enctype)
 calculate the length of this DICOM element when encoded with the given transfer syntax and the given encoding type for sequences.
virtual OFCondition insert (DcmPixelItem *item, unsigned long where=DCM_EndOfListIndex)
 insert the given pixel item at the given position within the list maintained by this object.
virtual OFCondition getItem (DcmPixelItem *&item, const unsigned long num)
 access a pixel item from the pixel sequence.
virtual OFCondition remove (DcmPixelItem *&item, const unsigned long num)
 remove pixel item from list.
virtual OFCondition remove (DcmPixelItem *item)
 remove pixel item from list.
OFCondition changeXfer (const E_TransferSyntax newXfer)
 changes the transfer syntax of this object to the given one.
virtual OFBool canWriteXfer (const E_TransferSyntax newXfer, const E_TransferSyntax oldXfer)
 check if this DICOM object can be encoded in the given transfer syntax.
virtual OFCondition read (DcmInputStream &inStream, const E_TransferSyntax ixfer, const E_GrpLenEncoding glenc=EGL_noChange, const Uint32 maxReadLength=DCM_MaxReadLength)
 This function reads the information of all attributes which are captured in the input stream and captures this information in elementList.
virtual OFCondition write (DcmOutputStream &outStream, const E_TransferSyntax oxfer, const E_EncodingType enctype, DcmWriteCache *wcache)
 write object 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 storeCompressedFrame (DcmOffsetList &offsetList, Uint8 *compressedData, Uint32 compressedLen, Uint32 fragmentSize)
 appends a single compressed frame to this DICOM pixel sequence

Protected Member Functions

virtual OFCondition makeSubObject (DcmObject *&newObject, const DcmTag &newTag, const Uint32 newLength)
 helper function for read().

Private Member Functions

virtual OFCondition insert (DcmItem *, unsigned long=DCM_EndOfListIndex, OFBool=OFFalse)
 method inherited from base class that is useless in this class
virtual DcmItemgetItem (const unsigned long)
 method inherited from base class that is useless in this class
virtual DcmItemremove (const unsigned long)
 method inherited from base class that is useless in this class
virtual DcmItemremove (DcmItem *)
 method inherited from base class that is useless in this class

Private Attributes

E_TransferSyntax Xfer
 the transfer syntax in which the compressed pixel data maintained by this object is encoded.

Detailed Description

this class implements a sequence of pixel items, i.e.

the data structure DICOM is using to store compressed pixel data. The object behaves very much like a sequence, but uses the pixel data tag (7FE0,0010) and OB value representation with undefined length, and the "items" contained within the sequence are in fact pixel items (class DcmPixelItem) that contain no list of DICOM elements but raw compressed pixel data.

Definition at line 45 of file dcpixseq.h.


Constructor & Destructor Documentation

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

constructor

Parameters:
tag attribute tag
len length of the attribute value

Referenced by clone().

DcmPixelSequence::DcmPixelSequence ( const DcmPixelSequence old  ) 

copy constructor

Parameters:
old element to be copied


Member Function Documentation

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

copy assignment operator

Parameters:
obj element to be copied

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

clone method

Returns:
deep copy of this object

Reimplemented from DcmSequenceOfItems.

Definition at line 71 of file dcpixseq.h.

References DcmPixelSequence().

virtual OFCondition DcmPixelSequence::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 DcmSequenceOfItems.

virtual DcmEVR DcmPixelSequence::ident ( void   )  const [inline, virtual]

get type identifier

Returns:
type identifier of this class (EVR_item)

Reimplemented from DcmSequenceOfItems.

Definition at line 93 of file dcpixseq.h.

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

print all elements of the item to a stream

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

Reimplemented from DcmSequenceOfItems.

virtual Uint32 DcmPixelSequence::calcElementLength ( const E_TransferSyntax  xfer,
const E_EncodingType  enctype 
) [virtual]

calculate the length of this DICOM element when encoded with the given transfer syntax and the given encoding type for sequences.

For elements, the length includes the length of the tag, length field, VR field and the value itself, for items and sequences it returns the length of the complete item or sequence including delimitation tags if applicable. Never returns undefined length.

Parameters:
xfer transfer syntax for length calculation
enctype sequence encoding type for length calculation
Returns:
length of DICOM element

Reimplemented from DcmSequenceOfItems.

virtual OFCondition DcmPixelSequence::insert ( DcmPixelItem item,
unsigned long  where = DCM_EndOfListIndex 
) [virtual]

insert the given pixel item at the given position within the list maintained by this object.

Ownership of the pixel item, which must be allocated on the heap, is transferred to the pixel sequence.

Parameters:
item pointer to DcmPixelItem instance allocated on the heap, must not be NULL.
where position at which the new item is to be inserted.
Returns:
EC_Normal if successful, an error code otherwise

virtual OFCondition DcmPixelSequence::getItem ( DcmPixelItem *&  item,
const unsigned long  num 
) [virtual]

access a pixel item from the pixel sequence.

This method returns a pointer to one of the pixel items in the list, and not a copy.

Parameters:
item upon success, a pointer to the selected pixel item is returned in this parameter
num index number of pixel item, must be < card()
Returns:
pointer to item if found, NULL if num >= card()

virtual OFCondition DcmPixelSequence::remove ( DcmPixelItem *&  item,
const unsigned long  num 
) [virtual]

remove pixel item from list.

If found, the pixel item is not deleted but returned to the caller who is responsible for further management of the DcmPixelItem object.

Parameters:
item upon success, a pointer to the removed pixel item is returned in this parameter
num index number of item, must be < card()
Returns:
EC_Normal if successful, an error code otherwise

virtual OFCondition DcmPixelSequence::remove ( DcmPixelItem item  )  [virtual]

remove pixel item from list.

Tthe pixel item is not deleted; the caller is responsible for further management of the DcmPixelItem object.

Parameters:
item pointer to element to be removed from list
Returns:
EC_Normal if successful, an error code otherwise

OFCondition DcmPixelSequence::changeXfer ( const E_TransferSyntax  newXfer  ) 

changes the transfer syntax of this object to the given one.

This only works if no transfer syntax was defined so far, or if the new and the old one are identical.

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

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

check if this DICOM object can be encoded in the given transfer syntax.

Parameters:
newXfer transfer syntax in which the DICOM object is to be encoded
oldXfer transfer syntax in which the DICOM object was read or created.
Returns:
true if object can be encoded in desired transfer syntax, false otherwise.

Reimplemented from DcmSequenceOfItems.

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

This function reads the information of all attributes which are captured in the input stream and captures this information in elementList.

Each attribute is represented as an element in this list. 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.
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 DcmSequenceOfItems.

virtual OFCondition DcmPixelSequence::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 DcmSequenceOfItems.

virtual OFCondition DcmPixelSequence::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 DcmSequenceOfItems.

virtual OFCondition DcmPixelSequence::storeCompressedFrame ( DcmOffsetList offsetList,
Uint8 *  compressedData,
Uint32  compressedLen,
Uint32  fragmentSize 
) [virtual]

appends a single compressed frame to this DICOM pixel sequence

Parameters:
offsetList list containing offset table entries. Upon success, an entry is appended to the list. The offset values are always even, so it is expected that odd length pixel items are padded later during writing.
compressedData pointer to compressed image data, must not be NULL
compressedLen number of bytes of compressed image data
fragmentSize maximum fragment size (in kbytes) for compression, 0 for unlimited.
Returns:
EC_Normal if successful, an error code otherwise

virtual OFCondition DcmPixelSequence::makeSubObject ( DcmObject *&  newObject,
const DcmTag newTag,
const Uint32  newLength 
) [protected, virtual]

helper function for read().

Create sub-object (pixel item) of the appropriate type depending on the tag.

Parameters:
newObject upon success, a pointer to the newly created object is returned in this parameter
newTag tag of the sub-object to be created
newLength length of the sub-object to be created
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmSequenceOfItems.


Member Data Documentation

E_TransferSyntax DcmPixelSequence::Xfer [private]

the transfer syntax in which the compressed pixel data maintained by this object is encoded.

This may very well differ from the transfer syntax of the main dataset if this object was created by a compression codec in memory.

Definition at line 246 of file dcpixseq.h.


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