DcmCodec Class Reference

abstract base class for a codec object that can be registered in dcmdata and performs transfer syntax transformation (i.e. More...

Inheritance diagram for DcmCodec:

DcmRLECodecDecoder DcmRLECodecEncoder DJCodecDecoder DJCodecEncoder DJDecoderBaseline DJDecoderExtended DJDecoderLossless DJDecoderP14SV1 DJDecoderProgressive DJDecoderSpectralSelection DJEncoderBaseline DJEncoderExtended DJEncoderLossless DJEncoderP14SV1 DJEncoderProgressive DJEncoderSpectralSelection List of all members.

Public Member Functions

 DcmCodec ()
 default constructor
virtual OFCondition decode (const DcmRepresentationParameter *fromRepParam, DcmPixelSequence *pixSeq, DcmPolymorphOBOW &uncompressedPixelData, const DcmCodecParameter *cp, const DcmStack &objStack) const =0
 decompresses the given pixel sequence and stores the result in the given uncompressedPixelData element.
virtual OFCondition encode (const Uint16 *pixelData, const Uint32 length, const DcmRepresentationParameter *toRepParam, DcmPixelSequence *&pixSeq, const DcmCodecParameter *cp, DcmStack &objStack) const =0
 compresses the given uncompressed DICOM image and stores the result in the given pixSeq element.
virtual OFCondition encode (const E_TransferSyntax fromRepType, const DcmRepresentationParameter *fromRepParam, DcmPixelSequence *fromPixSeq, const DcmRepresentationParameter *toRepParam, DcmPixelSequence *&toPixSeq, const DcmCodecParameter *cp, DcmStack &objStack) const =0
 transcodes (re-compresses) the given compressed DICOM image and stores the result in the given toPixSeq element.
virtual OFBool canChangeCoding (const E_TransferSyntax oldRepType, const E_TransferSyntax newRepType) const =0
 checks if this codec is able to convert from the given current transfer syntax to the given new transfer syntax

Static Public Member Functions

OFCondition insertStringIfMissing (DcmItem *dataset, const DcmTagKey &tag, const char *val)
 helper function that inserts a string attribute with a given value into a dataset if missing in the dataset.
OFCondition convertToSecondaryCapture (DcmItem *dataset)
 helper function that converts a dataset containing a DICOM image into a valid (standard extended) Secondary Capture object by inserting all attributes that are type 1/2 in Secondary Capture and missing in the source dataset.
OFCondition newInstance (DcmItem *dataset)
 create new SOP instance UID and Source Image Sequence referencing the old SOP instance (if present)
OFCondition updateImageType (DcmItem *dataset)
 set first two values of Image Type to DERIVED.

Detailed Description

abstract base class for a codec object that can be registered in dcmdata and performs transfer syntax transformation (i.e.

compressing, decompressing or transcoding between different compressed transfer syntaxes). When dcmdata is requested to write a transfer syntax that differs from the current one (i.e. the one in which the object was read), dcmdata dynamically searches for a DcmCodec object that is able to create the desired transfer syntax. If no suitable codec is found, the write operation fails.

Definition at line 90 of file dccodec.h.


Member Function Documentation

virtual OFBool DcmCodec::canChangeCoding const E_TransferSyntax  oldRepType,
const E_TransferSyntax  newRepType
const [pure virtual]
 

checks if this codec is able to convert from the given current transfer syntax to the given new transfer syntax

Parameters:
oldRepType current transfer syntax
newRepType desired new transfer syntax
Returns:
true if transformation is supported by this codec, false otherwise.

Implemented in DcmRLECodecDecoder, DcmRLECodecEncoder, DJCodecDecoder, and DJCodecEncoder.

OFCondition DcmCodec::convertToSecondaryCapture DcmItem dataset  )  [static]
 

helper function that converts a dataset containing a DICOM image into a valid (standard extended) Secondary Capture object by inserting all attributes that are type 1/2 in Secondary Capture and missing in the source dataset.

Replaces SOP Class UID by Secondary Capture. It does not, however, change an existing SOP Instance UID.

Parameters:
dataset dataset to insert to, must not be NULL.
Returns:
EC_Normal if successful, an error code otherwise

virtual OFCondition DcmCodec::decode const DcmRepresentationParameter *  fromRepParam,
DcmPixelSequence *  pixSeq,
DcmPolymorphOBOW &  uncompressedPixelData,
const DcmCodecParameter cp,
const DcmStack objStack
const [pure virtual]
 

decompresses the given pixel sequence and stores the result in the given uncompressedPixelData element.

Parameters:
fromRepParam current representation parameter of compressed data, may be NULL
pixSeq compressed pixel sequence
uncompressedPixelData uncompressed pixel data stored in this element
cp codec parameters for this codec
objStack stack pointing to the location of the pixel data element in the current dataset.
Returns:
EC_Normal if successful, an error code otherwise.

Implemented in DcmRLECodecDecoder, DcmRLECodecEncoder, DJCodecDecoder, and DJCodecEncoder.

virtual OFCondition DcmCodec::encode const E_TransferSyntax  fromRepType,
const DcmRepresentationParameter *  fromRepParam,
DcmPixelSequence *  fromPixSeq,
const DcmRepresentationParameter *  toRepParam,
DcmPixelSequence *&  toPixSeq,
const DcmCodecParameter cp,
DcmStack objStack
const [pure virtual]
 

transcodes (re-compresses) the given compressed DICOM image and stores the result in the given toPixSeq element.

Parameters:
fromRepType current transfer syntax of the compressed image
fromRepParam current representation parameter of compressed data, may be NULL
fromPixSeq compressed pixel sequence
toRepParam representation parameter describing the desired new compressed representation (e.g. JPEG quality)
toPixSeq compressed pixel sequence (pointer to new DcmPixelSequence object allocated on heap) returned in this parameter upon success.
cp codec parameters for this codec
objStack stack pointing to the location of the pixel data element in the current dataset.
Returns:
EC_Normal if successful, an error code otherwise.

Implemented in DcmRLECodecDecoder, DcmRLECodecEncoder, DJCodecDecoder, and DJCodecEncoder.

virtual OFCondition DcmCodec::encode const Uint16 *  pixelData,
const Uint32  length,
const DcmRepresentationParameter *  toRepParam,
DcmPixelSequence *&  pixSeq,
const DcmCodecParameter cp,
DcmStack objStack
const [pure virtual]
 

compresses the given uncompressed DICOM image and stores the result in the given pixSeq element.

Parameters:
pixelData pointer to the uncompressed image data in OW format and local byte order
length of the pixel data field in bytes
toRepParam representation parameter describing the desired compressed representation (e.g. JPEG quality)
pixSeq compressed pixel sequence (pointer to new DcmPixelSequence object allocated on heap) returned in this parameter upon success.
cp codec parameters for this codec
objStack stack pointing to the location of the pixel data element in the current dataset.
Returns:
EC_Normal if successful, an error code otherwise.

Implemented in DcmRLECodecDecoder, DcmRLECodecEncoder, DJCodecDecoder, and DJCodecEncoder.

OFCondition DcmCodec::insertStringIfMissing DcmItem dataset,
const DcmTagKey &  tag,
const char *  val
[static]
 

helper function that inserts a string attribute with a given value into a dataset if missing in the dataset.

Parameters:
dataset dataset to insert to, must not be NULL.
tag tag key of attribute to check/insert
val string value, may be NULL.
Returns:
EC_Normal if successful, an error code otherwise

OFCondition DcmCodec::newInstance DcmItem dataset  )  [static]
 

create new SOP instance UID and Source Image Sequence referencing the old SOP instance (if present)

Parameters:
dataset dataset to be modified
Returns:
EC_Normal if successful, an error code otherwise

OFCondition DcmCodec::updateImageType DcmItem dataset  )  [static]
 

set first two values of Image Type to DERIVED.

Parameters:
dataset dataset to be modified
Returns:
EC_Normal if successful, an error code otherwise


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


Generated on 4 Nov 2004 for OFFIS DCMTK Version 3.5.3 by Doxygen 1.3.8