Loading...
Searching...
No Matches
DcmCodecList Class Reference

singleton that keeps list of registered codecs for dcmdata. More...

## Public Member Functions

virtual | ~DcmCodecList ()
| destructor

## Static Public Member Functions

static OFCondition | registerCodec (const DcmCodec *aCodec, const DcmRepresentationParameter *aDefaultRepParam, const DcmCodecParameter *aCodecParameter)
| registers a codec object in the global list of codecs consulted by dcmdata whenever conversion to/from compressed transfer syntaxes is requested.
static OFCondition | deregisterCodec (const DcmCodec *aCodec)
| deregisters a codec and it's parameter objects from the global list.
static OFCondition | updateCodecParameter (const DcmCodec *aCodec, const DcmCodecParameter *aCodecParameter)
| updates the codec parameters object for a codec that has been registered before.
static OFCondition | decode (const DcmXfer &fromType, const DcmRepresentationParameter *fromParam, DcmPixelSequence *fromPixSeq, DcmPolymorphOBOW &uncompressedPixelData, DcmStack &pixelStack, OFBool &removeOldRep)
| looks for a codec that is able to decode from the given transfer syntax and calls the decode() method of the codec.
static OFCondition | decodeFrame (const DcmXfer &fromType, const DcmRepresentationParameter *fromParam, DcmPixelSequence *fromPixSeq, DcmItem *dataset, Uint32 frameNo, Uint32 &startFragment, void *buffer, Uint32 bufSize, OFString &decompressedColorModel)
| looks for a codec that is able to decode from the given transfer syntax and calls the decodeFrame() method of the codec.
static OFCondition | encode (const E_TransferSyntax fromRepType, const Uint16 *pixelData, const Uint32 length, const E_TransferSyntax toRepType, const DcmRepresentationParameter *toRepParam, DcmPixelSequence *&pixSeq, DcmStack &pixelStack, OFBool &removeOldRep)
| looks for a codec that is able to encode from the given transfer syntax and calls the encode() method of the codec.
static OFCondition | encode (const E_TransferSyntax fromRepType, const DcmRepresentationParameter *fromParam, DcmPixelSequence *fromPixSeq, const E_TransferSyntax toRepType, const DcmRepresentationParameter *toRepParam, DcmPixelSequence *&toPixSeq, DcmStack &pixelStack, OFBool &removeOldRep)
| looks for a codec that is able to transcode (re-compresses) from the given transfer syntax to the given transfer syntax and calls the encode() method of the codec.
static OFBool | canChangeCoding (const E_TransferSyntax fromRepType, const E_TransferSyntax toRepType)
| looks for a codec that claims to be able to convert between the given transfer syntaxes.
static OFCondition | determineDecompressedColorModel (const DcmXfer &fromType, const DcmRepresentationParameter *fromParam, DcmPixelSequence *fromPixSeq, DcmItem *dataset, OFString &decompressedColorModel)
| determine color model of the decompressed image
static Uint16 | decodedBitsAllocated (const DcmXfer &fromType, Uint16 bitsAllocated, Uint16 bitsStored)
| determines the effective value of BitsAllocated that a dataset will have after decompression of an image with the given values for bitsAllocated and bitsStored.

## Private Member Functions

| DcmCodecList (const DcmCodec *aCodec, const DcmRepresentationParameter *aDefaultRepParam, const DcmCodecParameter *aCodecParameter)
| constructor
| DcmCodecList (const DcmCodecList &)
| private undefined copy constructor
DcmCodecList & | operator= (const DcmCodecList &)
| private undefined copy assignment operator

## Private Attributes

const DcmCodec * | codec
| pointer to codec object
const DcmRepresentationParameter * | defaultRepParam
| pointer to default representation parameter
const DcmCodecParameter * | codecParameter
| pointer to codec parameter set

## Static Private Attributes

static OFList< DcmCodecList * > | registeredCodecs
| singleton list of registered codecs
static OFReadWriteLock | codecLock
| read/write lock guarding access to singleton list

## Detailed Description

singleton that keeps list of registered codecs for dcmdata.

All operations on the list are protected by a read/write lock and, therefore, are safe for multi-thread applications.

## Constructor & Destructor Documentation

## DcmCodecList()

DcmCodecList::DcmCodecList | ( | const DcmCodec * | aCodec,
|  | const DcmRepresentationParameter * | aDefaultRepParam,
|  | const DcmCodecParameter * | aCodecParameter )

private

constructor

Parameters

  aCodec | pointer to codec object.
  aDefaultRepParam | default representation parameter.
  aCodecParameter | codec parameter.

Referenced by DcmCodecList(), and operator=().

## Member Function Documentation

## canChangeCoding()

OFBool DcmCodecList::canChangeCoding | ( | const E_TransferSyntax | fromRepType,
|  | const E_TransferSyntax | toRepType )

static

looks for a codec that claims to be able to convert between the given transfer syntaxes.

A read lock on the list of codecs is acquired until this method returns.

Parameters

  fromRepType | current transfer syntax
  toRepType | desired new transfer syntax

Returns
  true if transformation is supported by a codec, false otherwise.

## decode()

OFCondition DcmCodecList::decode | ( | const DcmXfer & | fromType,
|  | const DcmRepresentationParameter * | fromParam,
|  | DcmPixelSequence * | fromPixSeq,
|  | DcmPolymorphOBOW & | uncompressedPixelData,
|  | DcmStack & | pixelStack,
|  | OFBool & | removeOldRep )

static

looks for a codec that is able to decode from the given transfer syntax and calls the decode() method of the codec.

A read lock on the list of codecs is acquired until this method returns.

Parameters

  fromType | transfer syntax to decode from
  fromParam | representation parameter of current compressed representation, may be NULL.
  fromPixSeq | compressed pixel sequence
  uncompressedPixelData | uncompressed pixel data stored in this element
  pixelStack | stack pointing to the location of the pixel data element in the current dataset.
  removeOldRep | boolean flag that should be set to false before this method call and will be set to true if the codec modifies the DICOM dataset such that the pixel data of the original representation may not be usable anymore.

Returns
  EC_Normal if successful, an error code otherwise.

## decodedBitsAllocated()

Uint16 DcmCodecList::decodedBitsAllocated | ( | const DcmXfer & | fromType,
|  | Uint16 | bitsAllocated,
|  | Uint16 | bitsStored )

static

determines the effective value of BitsAllocated that a dataset will have after decompression of an image with the given values for bitsAllocated and bitsStored.

This may differ from the bitsAllocated parameter for example if that value is not a multiple of 8. Returns zero if an image with the given parameters cannot be decoded.

Parameters

  fromType | transfer syntax to decode from
  bitsAllocated | current value of Bits Allocated
  bitsStored | current value of Bits Stored

Returns
  value of BitsAllocated after decompression, 0 if no decompression possible

## decodeFrame()

OFCondition DcmCodecList::decodeFrame | ( | const DcmXfer & | fromType,
|  | const DcmRepresentationParameter * | fromParam,
|  | DcmPixelSequence * | fromPixSeq,
|  | DcmItem * | dataset,
|  | Uint32 | frameNo,
|  | Uint32 & | startFragment,
|  | void * | buffer,
|  | Uint32 | bufSize,
|  | OFString & | decompressedColorModel )

static

looks for a codec that is able to decode from the given transfer syntax and calls the decodeFrame() method of the codec.

A read lock on the list of codecs is acquired until this method returns.

Parameters

  fromType | transfer syntax to decode from
  fromParam | representation parameter of current compressed representation, may be NULL.
  fromPixSeq | compressed pixel sequence
  dataset | pointer to dataset in which pixel data element is contained
  frameNo | number of frame, starting with 0 for the first frame

  startFragment

  index of the compressed fragment that contains all or the first part of the compressed bitstream for the given frameNo. Upon successful return this parameter is updated to contain the index of the first compressed fragment of the next frame. When unknown, zero should be passed. In this case the decompression algorithm will try to determine the index by itself, which will always work if frames are decompressed in increasing order from first to last, but may fail if frames are decompressed in random order, multiple fragments per frame and multiple frames are present in the dataset, and the offset table is empty.

  buffer | pointer to buffer where frame is to be stored
  bufSize | size of buffer in bytes
  decompressedColorModel | upon successful return, the color model of the decompressed image (which may be different from the one used in the compressed images) is returned in this parameter.

Returns
  EC_Normal if successful, an error code otherwise.

## deregisterCodec()

OFCondition DcmCodecList::deregisterCodec | ( | const DcmCodec * | aCodec | ) |

static

deregisters a codec and it's parameter objects from the global list.

This call is safe in multi-thread operations.

Parameters

  aCodec | pointer to registered codec

Returns
  EC_Normal if successful, an error code otherwise

## determineDecompressedColorModel()

OFCondition DcmCodecList::determineDecompressedColorModel | ( | const DcmXfer & | fromType,
|  | const DcmRepresentationParameter * | fromParam,
|  | DcmPixelSequence * | fromPixSeq,
|  | DcmItem * | dataset,
|  | OFString & | decompressedColorModel )

static

determine color model of the decompressed image

Parameters

  fromType | transfer syntax to decode from
  fromParam | representation parameter of current compressed representation, may be NULL
  fromPixSeq | compressed pixel sequence
  dataset | pointer to dataset in which pixel data element is contained
  decompressedColorModel | upon successful return, the color model of the decompressed image (which may be different from the one used in the compressed images) is returned in this parameter

Returns
  EC_Normal if successful, an error code otherwise

## encode() [1/2]

OFCondition DcmCodecList::encode | ( | const E_TransferSyntax | fromRepType,
|  | const DcmRepresentationParameter * | fromParam,
|  | DcmPixelSequence * | fromPixSeq,
|  | const E_TransferSyntax | toRepType,
|  | const DcmRepresentationParameter * | toRepParam,
|  | DcmPixelSequence *& | toPixSeq,
|  | DcmStack & | pixelStack,
|  | OFBool & | removeOldRep )

static

looks for a codec that is able to transcode (re-compresses) from the given transfer syntax to the given transfer syntax and calls the encode() method of the codec.

A read lock on the list of codecs is acquired until this method returns.

Parameters

  fromRepType | current transfer syntax of the compressed image
  fromParam | current representation parameter of compressed data, may be NULL
  fromPixSeq | compressed pixel sequence
  toRepType | transfer syntax to compress to
  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.
  pixelStack | stack pointing to the location of the pixel data element in the current dataset.
  removeOldRep | boolean flag that should be set to false before this method call and will be set to true if the codec modifies the DICOM dataset such that the pixel data of the original representation may not be usable anymore.

Returns
  EC_Normal if successful, an error code otherwise.

## encode() [2/2]

OFCondition DcmCodecList::encode | ( | const E_TransferSyntax | fromRepType,
|  | const Uint16 * | pixelData,
|  | const Uint32 | length,
|  | const E_TransferSyntax | toRepType,
|  | const DcmRepresentationParameter * | toRepParam,
|  | DcmPixelSequence *& | pixSeq,
|  | DcmStack & | pixelStack,
|  | OFBool & | removeOldRep )

static

looks for a codec that is able to encode from the given transfer syntax and calls the encode() method of the codec.

A read lock on the list of codecs is acquired until this method returns.

Parameters

  fromRepType | transfer syntax to encode from
  pixelData | pointer to the uncompressed image data in OW format and local byte order
  length | of the pixel data field in bytes
  toRepType | transfer syntax to compress to
  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.
  pixelStack | stack pointing to the location of the pixel data element in the current dataset.
  removeOldRep | boolean flag that should be set to false before this method call and will be set to true if the codec modifies the DICOM dataset such that the pixel data of the original representation may not be usable anymore.

Returns
  EC_Normal if successful, an error code otherwise.

## registerCodec()

OFCondition DcmCodecList::registerCodec | ( | const DcmCodec * | aCodec,
|  | const DcmRepresentationParameter * | aDefaultRepParam,
|  | const DcmCodecParameter * | aCodecParameter )

static

registers a codec object in the global list of codecs consulted by dcmdata whenever conversion to/from compressed transfer syntaxes is requested.

This function must not be called before main() is started, e.g. from a constructor of a global object. This call is safe in multi-thread operations.

Parameters

  aCodec | pointer to codec object. Must remain unmodified and valid until the codec has been deregistered.
  aDefaultRepParam | default representation parameter. Must remain unmodified and valid until the codec has been deregistered.
  aCodecParameter | codec parameter. Must remain unmodified and valid until the codec has been deregistered or the parameter has been replaced by a call to updateCodecParameter()

Returns
  EC_Normal if successful, an error code otherwise

## updateCodecParameter()

OFCondition DcmCodecList::updateCodecParameter | ( | const DcmCodec * | aCodec,
|  | const DcmCodecParameter * | aCodecParameter )

static

updates the codec parameters object for a codec that has been registered before.

This call is safe in multi-thread operations.

Parameters

  aCodec | pointer to codec object that has been registered before
  aCodecParameter | codec parameter. Must remain unmodified and valid until the codec has been deregistered or the parameter has been replaced by another call to updateCodecParameter()

Returns
  EC_Normal if successful, an error code otherwise

## Member Data Documentation

## codecLock

OFReadWriteLock DcmCodecList::codecLock

static private

read/write lock guarding access to singleton list

Remarks
  this member is only available if DCMTK is compiled with thread support enabled.

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

- dcmdata/include/dcmtk/dcmdata/dccodec.h

Generated on for DCMTK Version 3.7.0 by Doxygen 1.15.0