OFFIS DCMTK  Version 3.6.0
djcparam.h
1 /*
2  *
3  * Copyright (C) 1997-2010, OFFIS e.V.
4  * All rights reserved. See COPYRIGHT file for details.
5  *
6  * This software and supporting documentation were developed by
7  *
8  * OFFIS e.V.
9  * R&D Division Health
10  * Escherweg 2
11  * D-26121 Oldenburg, Germany
12  *
13  *
14  * Module: dcmjpeg
15  *
16  * Author: Norbert Olges, Marco Eichelberg
17  *
18  * Purpose: codec parameter class for dcmjpeg codecs
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-10-14 13:17:17 $
22  * CVS/RCS Revision: $Revision: 1.12 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 #ifndef DJCPARAM_H
30 #define DJCPARAM_H
31 
32 #include "dcmtk/config/osconfig.h"
33 #include "dcmtk/dcmdata/dccodec.h" /* for DcmCodecParameter */
34 #include "dcmtk/dcmjpeg/djutils.h" /* for enums */
35 
39 {
40 public:
41 
76  E_CompressionColorSpaceConversion pCompressionCSConversion,
77  E_DecompressionColorSpaceConversion pDecompressionCSConversion,
78  E_UIDCreation pCreateSOPInstanceUID,
79  E_PlanarConfiguration pPlanarConfiguration,
80  OFBool predictor6WorkaroundEnable = OFFalse,
81  OFBool pOptimizeHuffman = OFFalse,
82  int pSmoothingFactor = 0,
83  int pForcedBitDepth = 0,
84  Uint32 pFragmentSize = 0,
85  OFBool pCreateOffsetTable = OFTrue,
86  E_SubSampling pSampleFactors = ESS_444,
87  OFBool pWriteYBR422 = OFFalse,
88  OFBool pConvertToSC = OFFalse,
89  unsigned long pWindowType = 0,
90  unsigned long pWindowParameter = 0,
91  double pVoiCenter = 0.0,
92  double pVoiWidth = 0.0,
93  unsigned long pRoiLeft = 0,
94  unsigned long pRoiTop = 0,
95  unsigned long pRoiWidth = 0,
96  unsigned long pRoiHeight = 0,
97  OFBool pUsePixelValues = OFTrue,
98  OFBool pUseModalityRescale = OFFalse,
99  OFBool pAcceptWrongPaletteTags = OFFalse,
100  OFBool pAcrNemaCompatibility = OFFalse,
101  OFBool pTrueLosslessMode = OFTrue);
102 
105 
107  virtual ~DJCodecParameter();
108 
113  virtual DcmCodecParameter *clone() const;
114 
118  virtual const char *className() const;
119 
124  {
125  return optimizeHuffman;
126  }
127 
131  int getSmoothingFactor() const
132  {
133  return smoothingFactor;
134  }
135 
139  int getForcedBitDepth() const
140  {
141  return forcedBitDepth;
142  }
143 
147  Uint32 getFragmentSize() const
148  {
149  return fragmentSize;
150  }
151 
155  OFBool getCreateOffsetTable() const
156  {
157  return createOffsetTable;
158  }
159 
163  E_SubSampling getSampleFactors() const
164  {
165  return sampleFactors;
166  }
167 
172  OFBool getWriteYBR422() const
173  {
174  return writeYBR422;
175  }
176 
180  OFBool getConvertToSC() const
181  {
182  return convertToSC;
183  }
184 
188  E_UIDCreation getUIDCreation() const
189  {
190  return uidCreation;
191  }
192 
196  unsigned long getWindowType() const
197  {
198  return windowType;
199  }
200 
204  unsigned long getWindowParameter() const
205  {
206  return windowParameter;
207  }
208 
213  void getVOIWindow(double& center, double& width) const
214  {
215  center = voiCenter;
216  width = voiWidth;
217  }
218 
225  void getROI(
226  unsigned long& left_pos,
227  unsigned long& top_pos,
228  unsigned long& width,
229  unsigned long& height) const
230  {
231  left_pos = roiLeft;
232  top_pos = roiTop;
233  width = roiWidth;
234  height = roiHeight;
235  }
236 
240  E_PlanarConfiguration getPlanarConfiguration() const
241  {
242  return planarConfiguration;
243  }
244 
248  E_CompressionColorSpaceConversion getCompressionColorSpaceConversion() const
249  {
251  }
252 
256  E_DecompressionColorSpaceConversion getDecompressionColorSpaceConversion() const
257  {
259  }
260 
264  OFBool getUsePixelValues() const
265  {
266  return usePixelValues;
267  }
268 
272  OFBool getUseModalityRescale() const
273  {
274  return useModalityRescale;
275  }
276 
281  {
282  return acceptWrongPaletteTags;
283  }
284 
290  OFBool getAcrNemaCompatibility() const
291  {
292  return acrNemaCompatibility;
293  }
294 
298  OFBool getTrueLosslessMode() const
299  {
300  return trueLosslessMode;
301  }
302 
307  {
309  }
310 
311 private:
312 
315 
317  E_CompressionColorSpaceConversion compressionCSConversion;
318 
320  E_DecompressionColorSpaceConversion decompressionCSConversion;
321 
323  E_PlanarConfiguration planarConfiguration;
324 
327 
330 
333 
335  Uint32 fragmentSize;
336 
339 
341  E_SubSampling sampleFactors;
342 
346  OFBool writeYBR422;
347 
349  OFBool convertToSC;
350 
352  E_UIDCreation uidCreation;
353 
366  unsigned long windowType;
367 
369  unsigned long windowParameter;
370 
372  double voiCenter;
373 
375  double voiWidth;
376 
378  unsigned long roiLeft;
379 
381  unsigned long roiTop;
382 
384  unsigned long roiWidth;
385 
387  unsigned long roiHeight;
388 
391 
394 
397 
400 
403 
406 
407 };
408 
409 
410 #endif
411 
412 /*
413  * CVS/RCS Log
414  * $Log: djcparam.h,v $
415  * Revision 1.12 2010-10-14 13:17:17 joergr
416  * Updated copyright header. Added reference to COPYRIGHT file.
417  *
418  * Revision 1.11 2010-06-01 16:17:49 onken
419  * Added some comments and line breaks (improved code readability).
420  *
421  * Revision 1.10 2010-03-24 15:01:34 joergr
422  * Fixed minor formatting issues in API documentation.
423  *
424  * Revision 1.9 2009-10-07 12:44:33 uli
425  * Switched to logging mechanism provided by the "new" oflog module.
426  *
427  * Revision 1.8 2006-03-29 15:58:52 meichel
428  * Added support for decompressing images with 16 bits/pixel compressed with
429  * a faulty lossless JPEG encoder that produces integer overflows in predictor 6.
430  *
431  * Revision 1.7 2005/12/08 16:59:13 meichel
432  * Changed include path schema for all DCMTK header files
433  *
434  * Revision 1.6 2005/11/29 15:57:05 onken
435  * Added commandline options --accept-acr-nema and --accept-palettes
436  * (same as in dcm2pnm) to dcmcjpeg and extended dcmjpeg to support
437  * these options. Thanks to Gilles Mevel for suggestion.
438  *
439  * Revision 1.4 2005/11/29 08:50:34 onken
440  * Added support for "true" lossless compression in dcmjpeg, that doesn't
441  * use dcmimage classes, but compresses raw pixel data (8 and 16 bit) to
442  * avoid losses in quality caused by color space conversions or modality
443  * transformations etc.
444  * Corresponding commandline option in dcmcjpeg (new default)
445  *
446  * Revision 1.3 2002/12/09 13:51:26 joergr
447  * Renamed parameter/local variable to avoid name clashes with global
448  * declaration left and/or right (used for as iostream manipulators).
449  *
450  * Revision 1.2 2001/11/19 15:13:26 meichel
451  * Introduced verbose mode in module dcmjpeg. If enabled, warning
452  * messages from the IJG library are printed on ofConsole, otherwise
453  * the library remains quiet.
454  *
455  * Revision 1.1 2001/11/13 15:56:17 meichel
456  * Initial release of module dcmjpeg
457  *
458  *
459  */
unsigned long windowType
mode for VOI transformation of monochrome images.
Definition: djcparam.h:366
OFBool predictor6WorkaroundEnabled() const
returns flag indicating whether the workaround for buggy JPEG lossless images with incorrect predicto...
Definition: djcparam.h:306
virtual const char * className() const
returns the class name as string.
OFBool getUseModalityRescale() const
returns flag indicating if compression should compute Rescale Slope/Intercept
Definition: djcparam.h:272
OFBool getUsePixelValues() const
returns flag indicating if compression to be optimized for real pixel values
Definition: djcparam.h:264
E_DecompressionColorSpaceConversion getDecompressionColorSpaceConversion() const
returns color conversion mode for compression
Definition: djcparam.h:256
E_CompressionColorSpaceConversion getCompressionColorSpaceConversion() const
returns color conversion mode for compression
Definition: djcparam.h:248
OFBool getOptimizeHuffmanCoding() const
returns huffman table optimization flag for 8 bits/pixel compression
Definition: djcparam.h:123
OFBool getAcrNemaCompatibility() const
Returns flag indicating if compatibility to old ACR-NEMA images without photometric interpretation is...
Definition: djcparam.h:290
unsigned long windowParameter
parameter for VOI transform of monochrome images, used in modes 1, 2, 4, 6
Definition: djcparam.h:369
int forcedBitDepth
forced bit depth for image compression, 0 (auto) or 8/12/16
Definition: djcparam.h:332
E_PlanarConfiguration planarConfiguration
flag describing how planar configuration of decompressed color images should be handled ...
Definition: djcparam.h:323
OFBool createOffsetTable
create offset table during image compression
Definition: djcparam.h:338
E_UIDCreation uidCreation
mode for SOP Instance UID creation
Definition: djcparam.h:352
OFBool writeYBR422
flag indicating whether a compressed YBR color stream should be marked as YBR_FULL or YBR_FULL_422 on...
Definition: djcparam.h:346
virtual DcmCodecParameter * clone() const
this methods creates a copy of type DcmCodecParameter * it must be overweritten in every subclass...
int getSmoothingFactor() const
returns smoothing factor for image compression, 0..100
Definition: djcparam.h:131
unsigned long getWindowParameter() const
returns parameter for VOI transform of monochrome images, used in VOI modes 1, 2, 4...
Definition: djcparam.h:204
Uint32 getFragmentSize() const
returns maximum fragment size (in kbytes) for compression, 0 for unlimited.
Definition: djcparam.h:147
OFBool acceptWrongPaletteTags
Accept wrong palette attribute tags.
Definition: djcparam.h:396
OFBool useModalityRescale
Create Rescale Slope/Intercept to scale back to original pixel range, mode 0 only.
Definition: djcparam.h:393
int getForcedBitDepth() const
returns forced bit depth for image compression, 0 (auto) or 8/12/16
Definition: djcparam.h:139
void getROI(unsigned long &left_pos, unsigned long &top_pos, unsigned long &width, unsigned long &height) const
returns ROI coordinates for VOI mode 7
Definition: djcparam.h:225
OFBool trueLosslessMode
True losless mode, replaces old "pseudo" lossless encoders, when true (default)
Definition: djcparam.h:402
int smoothingFactor
smoothing factor for image compression, 0..100
Definition: djcparam.h:329
abstract base class for a codec parameter object that describes the settings (modes of operations) fo...
Definition: dccodec.h:49
E_SubSampling getSampleFactors() const
returns subsampling mode for color image compression
Definition: djcparam.h:163
OFBool getWriteYBR422() const
returns flag indicating whether a compressed YBR color stream should be marked as YBR_FULL or YBR_FUL...
Definition: djcparam.h:172
E_DecompressionColorSpaceConversion decompressionCSConversion
color conversion mode for decompression
Definition: djcparam.h:320
Uint32 fragmentSize
maximum fragment size (in kbytes) for compression, 0 for unlimited.
Definition: djcparam.h:335
OFBool usePixelValues
Check smallest and largest pixel value and optimize compression, mode 0 only.
Definition: djcparam.h:390
DJCodecParameter & operator=(const DJCodecParameter &)
private undefined copy assignment operator
unsigned long roiWidth
Region of Interest width for for VOI transform of monochrome images, mode 7.
Definition: djcparam.h:384
unsigned long roiLeft
Region of Interest left corner for for VOI transform of monochrome images, mode 7.
Definition: djcparam.h:378
DJCodecParameter(E_CompressionColorSpaceConversion pCompressionCSConversion, E_DecompressionColorSpaceConversion pDecompressionCSConversion, E_UIDCreation pCreateSOPInstanceUID, E_PlanarConfiguration pPlanarConfiguration, OFBool predictor6WorkaroundEnable=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, unsigned long pWindowType=0, unsigned long pWindowParameter=0, double pVoiCenter=0.0, double pVoiWidth=0.0, unsigned long pRoiLeft=0, unsigned long pRoiTop=0, unsigned long pRoiWidth=0, unsigned long pRoiHeight=0, OFBool pUsePixelValues=OFTrue, OFBool pUseModalityRescale=OFFalse, OFBool pAcceptWrongPaletteTags=OFFalse, OFBool pAcrNemaCompatibility=OFFalse, OFBool pTrueLosslessMode=OFTrue)
constructor.
OFBool acrNemaCompatibility
Compatibility with old ACR-NEMA images without photometric interpretation.
Definition: djcparam.h:399
virtual ~DJCodecParameter()
destructor
unsigned long roiTop
Region of Interest upper corner for for VOI transform of monochrome images, mode 7.
Definition: djcparam.h:381
OFBool predictor6WorkaroundEnabled_
flag indicating that the workaround for buggy JPEG lossless images with incorrect predictor 6 is enab...
Definition: djcparam.h:405
E_UIDCreation getUIDCreation() const
returns mode for SOP Instance UID creation
Definition: djcparam.h:188
unsigned long getWindowType() const
returns mode for VOI transformation of monochrome images.
Definition: djcparam.h:196
double voiCenter
VOI window center for mode 5.
Definition: djcparam.h:372
OFBool getTrueLosslessMode() const
returns flag indicating if real lossless mode is enabled
Definition: djcparam.h:298
OFBool getConvertToSC() const
returns secondary capture conversion flag
Definition: djcparam.h:180
E_SubSampling sampleFactors
subsampling mode for color image compression
Definition: djcparam.h:341
OFBool getCreateOffsetTable() const
returns offset table creation flag
Definition: djcparam.h:155
E_PlanarConfiguration getPlanarConfiguration() const
returns planar configuration flag
Definition: djcparam.h:240
OFBool optimizeHuffman
perform huffman table optimization for 8 bits/pixel compression?
Definition: djcparam.h:326
void getVOIWindow(double &center, double &width) const
returns VOI window center and width for VOI mode 5
Definition: djcparam.h:213
unsigned long roiHeight
Region of Interest height for for VOI transform of monochrome images, mode 7.
Definition: djcparam.h:387
double voiWidth
VOI window width for mode 5.
Definition: djcparam.h:375
OFBool convertToSC
flag indicating whether image should be converted to Secondary Capture upon compression ...
Definition: djcparam.h:349
codec parameter for IJG codecs
Definition: djcparam.h:38
E_CompressionColorSpaceConversion compressionCSConversion
color conversion mode for compression
Definition: djcparam.h:317
OFBool getAcceptWrongPaletteTags() const
Returns flag indicating if incorrect palette attribute tags should be accepted.
Definition: djcparam.h:280


Generated on Wed Jan 4 2017 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.6