DCMTK: DJCodecParameter Class Reference

DCMTK Version 3.6.9 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DJCodecParameter Class Reference

codec parameter for IJG codecs More...

Inheritance diagram for DJCodecParameter:

## Public Member Functions
| DJCodecParameter (E_CompressionColorSpaceConversion pCompressionCSConversion, E_DecompressionColorSpaceConversion pDecompressionCSConversion, E_UIDCreation pCreateSOPInstanceUID, E_PlanarConfiguration pPlanarConfiguration, OFBool predictor6WorkaroundEnable=OFFalse, OFBool cornellWorkaroundEnable=OFFalse, OFBool pForceSingleFragmentPerFrame=OFFalse, OFBool pOptimizeHuffman=OFFalse, int pSmoothingFactor=0, int pForcedBitDepth=0, Uint32 pFragmentSize=0, OFBool pCreateOffsetTable=OFTrue, E_SubSampling pSampleFactors=ESS_444, OFBool pWriteYBR422=OFFalse, OFBool pConvertToSC=OFFalse, size_t pWindowType=0, size_t pWindowParameter=0, double pVoiCenter=0.0, double pVoiWidth=0.0, size_t pRoiLeft=0, size_t pRoiTop=0, size_t pRoiWidth=0, size_t pRoiHeight=0, OFBool pUsePixelValues=OFTrue, OFBool pUseModalityRescale=OFFalse, OFBool pAcceptWrongPaletteTags=OFFalse, OFBool pAcrNemaCompatibility=OFFalse, OFBool pTrueLosslessMode=OFTrue)
| constructor.
| DJCodecParameter (const DJCodecParameter &arg)
| copy constructor
virtual | ~DJCodecParameter ()
| destructor
virtual DcmCodecParameter * | clone () const
| this methods creates a copy of type DcmCodecParameter * it must be overweritten in every subclass.
virtual const char * | className () const
| returns the class name as string.
OFBool | getOptimizeHuffmanCoding () const
| returns huffman table optimization flag for 8 bits/pixel compression
int | getSmoothingFactor () const
| returns smoothing factor for image compression, 0..100
int | getForcedBitDepth () const
| returns forced bit depth for image compression, 0 (auto) or 8/12/16
Uint32 | getFragmentSize () const
| returns maximum fragment size (in kbytes) for compression, 0 for unlimited.
OFBool | getCreateOffsetTable () const
| returns offset table creation flag
E_SubSampling | getSampleFactors () const
| returns subsampling mode for color image compression
OFBool | getWriteYBR422 () const
| returns flag indicating whether a compressed YBR color stream should be marked as YBR_FULL or YBR_FULL_422 on DICOM level
OFBool | getConvertToSC () const
| returns secondary capture conversion flag
E_UIDCreation | getUIDCreation () const
| returns mode for SOP Instance UID creation
size_t | getWindowType () const
| returns mode for VOI transformation of monochrome images.
size_t | getWindowParameter () const
| returns parameter for VOI transform of monochrome images, used in VOI modes 1, 2, 4, 6
void | getVOIWindow (double &center, double &width) const
| returns VOI window center and width for VOI mode 5
void | getROI (size_t &left_pos, size_t &top_pos, size_t &width, size_t &height) const
| returns ROI coordinates for VOI mode 7
E_PlanarConfiguration | getPlanarConfiguration () const
| returns planar configuration flag
E_CompressionColorSpaceConversion | getCompressionColorSpaceConversion () const
| returns color conversion mode for compression
E_DecompressionColorSpaceConversion | getDecompressionColorSpaceConversion () const
| returns color conversion mode for compression
OFBool | getUsePixelValues () const
| returns flag indicating if compression to be optimized for real pixel values
OFBool | getUseModalityRescale () const
| returns flag indicating if compression should compute Rescale Slope/Intercept
OFBool | getAcceptWrongPaletteTags () const
| Returns flag indicating if incorrect palette attribute tags should be accepted.
OFBool | getAcrNemaCompatibility () const
| Returns flag indicating if compatibility to old ACR-NEMA images without photometric interpretation is enabled.
OFBool | getTrueLosslessMode () const
| returns flag indicating if real lossless mode is enabled
OFBool | predictor6WorkaroundEnabled () const
| returns flag indicating whether the workaround for buggy JPEG lossless images with incorrect predictor 6 is enabled
OFBool | cornellWorkaroundEnabled () const
| returns flag indicating whether the workaround for buggy Cornell JPEG lossless images with Huffman table overflow is enabled
OFBool | getForceSingleFragmentPerFrame () const
| returns flag indicating whether one fragment per frame should be enforced while decoding
Public Member Functions inherited from DcmCodecParameter
| DcmCodecParameter ()
| default constructor
| DcmCodecParameter (const DcmCodecParameter &)
| copy constructor
virtual | ~DcmCodecParameter ()
| destructor

## Private Member Functions
DJCodecParameter & | operator= (const DJCodecParameter &)
| private undefined copy assignment operator

## Private Attributes
E_CompressionColorSpaceConversion | compressionCSConversion
| color conversion mode for compression
E_DecompressionColorSpaceConversion | decompressionCSConversion
| color conversion mode for decompression
E_PlanarConfiguration | planarConfiguration
| flag describing how planar configuration of decompressed color images should be handled
OFBool | optimizeHuffman
| perform huffman table optimization for 8 bits/pixel compression?
int | smoothingFactor
| smoothing factor for image compression, 0..100
int | forcedBitDepth
| forced bit depth for image compression, 0 (auto) or 8/12/16
Uint32 | fragmentSize
| maximum fragment size (in kbytes) for compression, 0 for unlimited.
OFBool | createOffsetTable
| create offset table during image compression
E_SubSampling | sampleFactors
| subsampling mode for color image compression
OFBool | writeYBR422
| flag indicating whether a compressed YBR color stream should be marked as YBR_FULL or YBR_FULL_422 on DICOM level
OFBool | convertToSC
| flag indicating whether image should be converted to Secondary Capture upon compression
E_UIDCreation | uidCreation
| mode for SOP Instance UID creation
size_t | windowType
| mode for VOI transformation of monochrome images.
size_t | windowParameter
| parameter for VOI transform of monochrome images, used in modes 1, 2, 4, 6
double | voiCenter
| VOI window center for mode 5.
double | voiWidth
| VOI window width for mode 5.
size_t | roiLeft
| Region of Interest left corner for for VOI transform of monochrome images, mode 7.
size_t | roiTop
| Region of Interest upper corner for for VOI transform of monochrome images, mode 7.
size_t | roiWidth
| Region of Interest width for for VOI transform of monochrome images, mode 7.
size_t | roiHeight
| Region of Interest height for for VOI transform of monochrome images, mode 7.
OFBool | usePixelValues
| Check smallest and largest pixel value and optimize compression, mode 0 only.
OFBool | useModalityRescale
| Create Rescale Slope/Intercept to scale back to original pixel range, mode 0 only.
OFBool | acceptWrongPaletteTags
| Accept wrong palette attribute tags.
OFBool | acrNemaCompatibility
| Compatibility with old ACR-NEMA images without photometric interpretation.
OFBool | trueLosslessMode
| True losless mode, replaces old "pseudo" lossless encoders, when true (default)
OFBool | predictor6WorkaroundEnabled_
| flag indicating that the workaround for buggy JPEG lossless images with incorrect predictor 6 is enabled
OFBool | cornellWorkaroundEnabled_
| flag indicating that the workaround for buggy Cornell JPEG lossless images with huffman table overflow is enabled
OFBool | forceSingleFragmentPerFrame
| flag indicating that while decompressing a multiframe image one fragment per frame should be assumed even if the JPEG data for some frame is incomplete

## Detailed Description

codec parameter for IJG codecs

## Constructor & Destructor Documentation

## ◆ DJCodecParameter()

DJCodecParameter::DJCodecParameter | ( | E_CompressionColorSpaceConversion | pCompressionCSConversion,
|  | E_DecompressionColorSpaceConversion | pDecompressionCSConversion,
|  | E_UIDCreation | pCreateSOPInstanceUID,
|  | E_PlanarConfiguration | pPlanarConfiguration,
|  | OFBool | predictor6WorkaroundEnable = OFFalse,
|  | OFBool | cornellWorkaroundEnable = OFFalse,
|  | OFBool | pForceSingleFragmentPerFrame = OFFalse,
|  | OFBool | pOptimizeHuffman = OFFalse,
|  | int | pSmoothingFactor = 0,
|  | int | pForcedBitDepth = 0,
|  | Uint32 | pFragmentSize = 0,
|  | OFBool | pCreateOffsetTable = OFTrue,
|  | E_SubSampling | pSampleFactors = ESS_444,
|  | OFBool | pWriteYBR422 = OFFalse,
|  | OFBool | pConvertToSC = OFFalse,
|  | size_t | pWindowType = 0,
|  | size_t | pWindowParameter = 0,
|  | double | pVoiCenter = 0.0,
|  | double | pVoiWidth = 0.0,
|  | size_t | pRoiLeft = 0,
|  | size_t | pRoiTop = 0,
|  | size_t | pRoiWidth = 0,
|  | size_t | pRoiHeight = 0,
|  | OFBool | pUsePixelValues = OFTrue,
|  | OFBool | pUseModalityRescale = OFFalse,
|  | OFBool | pAcceptWrongPaletteTags = OFFalse,
|  | OFBool | pAcrNemaCompatibility = OFFalse,
|  | OFBool | pTrueLosslessMode = OFTrue )

constructor.

Parameters

  pCompressionCSConversion | color conversion mode for compression
  pDecompressionCSConversion | color conversion mode for decompression
  pCreateSOPInstanceUID | mode for SOP Instance UID creation
  pPlanarConfiguration | flag describing how planar configuration of decompressed color images should be handled
  predictor6WorkaroundEnable | enable workaround for buggy lossless compressed images with overflow in predictor 6 for images with 16 bits/pixel
  cornellWorkaroundEnable | enable workaround for buggy Cornell lossless compressed images with Huffman table overflow
  pForceSingleFragmentPerFrame | while decompressing a multiframe image, assume one fragment per frame even if the JPEG data for some frame is incomplete
  pOptimizeHuffman | perform huffman table optimization for 8 bits/pixel compression?
  pSmoothingFactor | smoothing factor for image compression, 0..100
  pForcedBitDepth | forced bit depth for image compression, 0 (auto) or 8/12/16
  pFragmentSize | maximum fragment size (in kbytes) for compression, 0 for unlimited.
  pCreateOffsetTable | create offset table during image compression?
  pSampleFactors | subsampling mode for color image compression
  pWriteYBR422 | flag indicating whether a compressed YBR color stream should be marked as YBR_FULL or YBR_FULL_422 on DICOM level
  pConvertToSC | flag indicating whether image should be converted to Secondary Capture upon compression
  pWindowType | mode for VOI transformation of monochrome images
  pWindowParameter | parameter for VOI transform of monochrome images, used in modes 1, 2, 4, 6
  pVoiCenter | VOI window center for mode 5
  pVoiWidth | VOI window width for mode 5
  pRoiLeft | Region of Interest left corner for for VOI transform of monochrome images, mode 7
  pRoiTop | Region of Interest upper corner for for VOI transform of monochrome images, mode 7
  pRoiWidth | Region of Interest width for for VOI transform of monochrome images, mode 7
  pRoiHeight | Region of Interest height for for VOI transform of monochrome images, mode 7
  pUsePixelValues | check smallest and largest pixel value and optimize compression, mode 0 only
  pUseModalityRescale | create Rescale Slope/Intercept to scale back to original pixel range, mode 0 only
  pAcceptWrongPaletteTags | accept wrong palette attribute tags (only "pseudo lossless" encoder)
  pAcrNemaCompatibility | accept old ACR-NEMA images without photometric interpretation (only "pseudo" lossless encoder)
  pTrueLosslessMode | Enables true lossless compression (replaces old "pseudo lossless" encoder)

References ESS_444.

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

## Member Function Documentation

## ◆ className()

virtual const char * DJCodecParameter::className | ( |  | ) | const
| virtual

returns the class name as string.

can be used as poor man's RTTI replacement.

Implements DcmCodecParameter.

## ◆ clone()

virtual DcmCodecParameter * DJCodecParameter::clone | ( |  | ) | const
| virtual

this methods creates a copy of type DcmCodecParameter * it must be overweritten in every subclass.

Returns
  copy of this object

Implements DcmCodecParameter.

References DcmCodecParameter::DcmCodecParameter().

## ◆ cornellWorkaroundEnabled()

OFBool DJCodecParameter::cornellWorkaroundEnabled | ( |  | ) | const
| inline

returns flag indicating whether the workaround for buggy Cornell JPEG lossless images with Huffman table overflow is enabled

Returns
  flag indicating whether the workaround for buggy Cornell JPEG lossless images with Huffman table overflow is enabled

References cornellWorkaroundEnabled_.

## ◆ getAcceptWrongPaletteTags()

OFBool DJCodecParameter::getAcceptWrongPaletteTags | ( |  | ) | const
| inline

Returns flag indicating if incorrect palette attribute tags should be accepted.

Returns
  flag indicating if incorrect palette attribute tags should be accepted

References acceptWrongPaletteTags.

## ◆ getAcrNemaCompatibility()

OFBool DJCodecParameter::getAcrNemaCompatibility | ( |  | ) | const
| inline

Returns flag indicating if compatibility to old ACR-NEMA images without photometric interpretation is enabled.

Returns
  flag indicating if ACR-NEMA compatibility is enabled

References acrNemaCompatibility.

## ◆ getCompressionColorSpaceConversion()

E_CompressionColorSpaceConversion DJCodecParameter::getCompressionColorSpaceConversion | ( |  | ) | const
| inline

returns color conversion mode for compression

Returns
  color conversion mode for compression

References compressionCSConversion.

## ◆ getConvertToSC()

OFBool DJCodecParameter::getConvertToSC | ( |  | ) | const
| inline

returns secondary capture conversion flag

Returns
  secondary capture conversion flag

References convertToSC.

## ◆ getCreateOffsetTable()

OFBool DJCodecParameter::getCreateOffsetTable | ( |  | ) | const
| inline

returns offset table creation flag

Returns
  offset table creation flag

References createOffsetTable.

## ◆ getDecompressionColorSpaceConversion()

E_DecompressionColorSpaceConversion DJCodecParameter::getDecompressionColorSpaceConversion | ( |  | ) | const
| inline

returns color conversion mode for compression

Returns
  color conversion mode for compression

References decompressionCSConversion.

## ◆ getForcedBitDepth()

int DJCodecParameter::getForcedBitDepth | ( |  | ) | const
| inline

returns forced bit depth for image compression, 0 (auto) or 8/12/16

Returns
  forced bit depth for image compression

References forcedBitDepth.

## ◆ getForceSingleFragmentPerFrame()

OFBool DJCodecParameter::getForceSingleFragmentPerFrame | ( |  | ) | const
| inline

returns flag indicating whether one fragment per frame should be enforced while decoding

Returns
  flag indicating whether one fragment per frame should be enforced while decoding

References forceSingleFragmentPerFrame.

## ◆ getFragmentSize()

Uint32 DJCodecParameter::getFragmentSize | ( |  | ) | const
| inline

returns maximum fragment size (in kbytes) for compression, 0 for unlimited.

Returns
  maximum fragment size for compression

References fragmentSize.

## ◆ getOptimizeHuffmanCoding()

OFBool DJCodecParameter::getOptimizeHuffmanCoding | ( |  | ) | const
| inline

returns huffman table optimization flag for 8 bits/pixel compression

Returns
  huffman table optimization flag for 8 bits/pixel compression

References optimizeHuffman.

## ◆ getPlanarConfiguration()

E_PlanarConfiguration DJCodecParameter::getPlanarConfiguration | ( |  | ) | const
| inline

returns planar configuration flag

Returns
  planar configuration flag

References planarConfiguration.

## ◆ getROI()

void DJCodecParameter::getROI | ( | size_t & | left_pos,
|  | size_t & | top_pos,
|  | size_t & | width,
|  | size_t & | height ) const
| inline

returns ROI coordinates for VOI mode 7

Parameters

  left_pos | ROI left edge returned in this parameter
  top_pos | ROI top edge returned in this parameter
  width | ROI width returned in this parameter
  height | ROI height returned in this parameter

References roiHeight, roiLeft, roiTop, and roiWidth.

## ◆ getSampleFactors()

E_SubSampling DJCodecParameter::getSampleFactors | ( |  | ) | const
| inline

returns subsampling mode for color image compression

Returns
  subsampling mode for color image compression

References sampleFactors.

## ◆ getSmoothingFactor()

int DJCodecParameter::getSmoothingFactor | ( |  | ) | const
| inline

returns smoothing factor for image compression, 0..100

Returns
  smoothing factor for image compression, 0..100

References smoothingFactor.

## ◆ getTrueLosslessMode()

OFBool DJCodecParameter::getTrueLosslessMode | ( |  | ) | const
| inline

returns flag indicating if real lossless mode is enabled

Returns
  flag indicating if real lossless mode is enabled

References trueLosslessMode.

## ◆ getUIDCreation()

E_UIDCreation DJCodecParameter::getUIDCreation | ( |  | ) | const
| inline

returns mode for SOP Instance UID creation

Returns
  mode for SOP Instance UID creation

References uidCreation.

## ◆ getUseModalityRescale()

OFBool DJCodecParameter::getUseModalityRescale | ( |  | ) | const
| inline

returns flag indicating if compression should compute Rescale Slope/Intercept

Returns
  flag indicating if compression should compute Rescale Slope/Intercept

References useModalityRescale.

## ◆ getUsePixelValues()

OFBool DJCodecParameter::getUsePixelValues | ( |  | ) | const
| inline

returns flag indicating if compression to be optimized for real pixel values

Returns
  flag indicating if compression to be optimized for real pixel values

References usePixelValues.

## ◆ getVOIWindow()

void DJCodecParameter::getVOIWindow | ( | double & | center,
|  | double & | width ) const
| inline

returns VOI window center and width for VOI mode 5

Parameters

  center | VOI center returned in this parameter
  width | VOI width returned in this parameter

References voiCenter, and voiWidth.

## ◆ getWindowParameter()

size_t DJCodecParameter::getWindowParameter | ( |  | ) | const
| inline

returns parameter for VOI transform of monochrome images, used in VOI modes 1, 2, 4, 6

Returns
  parameter for VOI transform of monochrome images, used in VOI modes 1, 2, 4, 6

References windowParameter.

## ◆ getWindowType()

size_t DJCodecParameter::getWindowType | ( |  | ) | const
| inline

returns mode for VOI transformation of monochrome images.

Returns
  mode for VOI transformation of monochrome images

References windowType.

## ◆ getWriteYBR422()

OFBool DJCodecParameter::getWriteYBR422 | ( |  | ) | const
| inline

returns flag indicating whether a compressed YBR color stream should be marked as YBR_FULL or YBR_FULL_422 on DICOM level

Returns
  YBR422 flag

References writeYBR422.

## ◆ predictor6WorkaroundEnabled()

OFBool DJCodecParameter::predictor6WorkaroundEnabled | ( |  | ) | const
| inline

returns flag indicating whether the workaround for buggy JPEG lossless images with incorrect predictor 6 is enabled

Returns
  flag indicating whether the workaround for buggy JPEG lossless images with incorrect predictor 6 is enabled

References predictor6WorkaroundEnabled_.

## Member Data Documentation

## ◆ windowType

size_t DJCodecParameter::windowType
| private

mode for VOI transformation of monochrome images.

possible values: 0: no VOI transformation (default). See also variables usePixelValues (default) or useModalityRescale denoting two further variables tweaking compression behaviour. 1: use the n-th VOI window from the image file (see variable windowType) 2: use the n-th VOI look up table from the image file (see variable windowType) 3: compute VOI window using min-max algorithm 4: compute VOI window using Histogram algorithm, ignoring n percent 5: compute VOI window using center r and width s 6: compute VOI window using min-max algorithm ignoring extremes 7: compute region of interest VOI window

Referenced by getWindowType().

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

- dcmjpeg/include/dcmtk/dcmjpeg/djcparam.h

Generated on Sat Mar 1 2025 for DCMTK Version 3.6.9 by Doxygen 1.13.2