DCMTK
Version 3.6.1 20120515
OFFIS DICOM Toolkit
|
this class implements a sequence of pixel items, i.e. More...
Public Member Functions | |
DcmPixelSequence (const DcmTag &tag, const Uint32 len=0) | |
constructor | |
DcmPixelSequence (const DcmPixelSequence &old) | |
copy constructor | |
virtual | ~DcmPixelSequence () |
destructor | |
DcmPixelSequence & | operator= (const DcmPixelSequence &obj) |
copy assignment operator | |
virtual DcmObject * | clone () 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 DcmItem * | getItem (const unsigned long) |
method inherited from base class that is useless in this class | |
virtual DcmItem * | remove (const unsigned long) |
method inherited from base class that is useless in this class | |
virtual DcmItem * | remove (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. |
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.
DcmPixelSequence::DcmPixelSequence | ( | const DcmTag & | tag, |
const Uint32 | len = 0 |
||
) |
constructor
tag | attribute tag |
len | length of the attribute value |
DcmPixelSequence::DcmPixelSequence | ( | const DcmPixelSequence & | old | ) |
copy constructor
old | element to be copied |
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.
xfer | transfer syntax for length calculation |
enctype | sequence encoding type for length calculation |
Reimplemented from DcmSequenceOfItems.
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.
newXfer | transfer syntax in which the DICOM object is to be encoded |
oldXfer | transfer syntax in which the DICOM object was read or created. |
Reimplemented from DcmSequenceOfItems.
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.
newXfer |
virtual DcmObject* DcmPixelSequence::clone | ( | ) | const [inline, virtual] |
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.
rhs | - [in] The instance to copy from. Has to be of the same class type as "this" object |
Reimplemented from DcmSequenceOfItems.
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.
item | upon success, a pointer to the selected pixel item is returned in this parameter |
num | index number of pixel item, must be < card() |
virtual DcmEVR DcmPixelSequence::ident | ( | void | ) | const [inline, virtual] |
get type identifier
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.
item | pointer to DcmPixelItem instance allocated on the heap, must not be NULL. |
where | position at which the new item is to be inserted. |
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.
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 |
Reimplemented from DcmSequenceOfItems.
DcmPixelSequence& DcmPixelSequence::operator= | ( | const DcmPixelSequence & | obj | ) |
copy assignment operator
obj | element to be copied |
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
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 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.
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. |
Reimplemented from DcmSequenceOfItems.
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.
item | upon success, a pointer to the removed pixel item is returned in this parameter |
num | index number of item, must be < card() |
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.
item | pointer to element to be removed from list |
virtual OFCondition DcmPixelSequence::storeCompressedFrame | ( | DcmOffsetList & | offsetList, |
Uint8 * | compressedData, | ||
Uint32 | compressedLen, | ||
Uint32 | fragmentSize | ||
) | [virtual] |
appends a single compressed frame to this DICOM pixel sequence
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. |
virtual OFCondition DcmPixelSequence::write | ( | DcmOutputStream & | outStream, |
const E_TransferSyntax | oxfer, | ||
const E_EncodingType | enctype, | ||
DcmWriteCache * | wcache | ||
) | [virtual] |
write object to a stream
outStream | DICOM output stream |
oxfer | output transfer syntax |
enctype | encoding types (undefined or explicit length) |
wcache | pointer to write cache object, may be NULL |
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
outStream | DICOM output stream |
oxfer | output transfer syntax |
enctype | encoding types (undefined or explicit length) |
wcache | pointer to write cache object, may be NULL |
Reimplemented from DcmSequenceOfItems.
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.