00001 /* 00002 * 00003 * Copyright (C) 1997-2010, OFFIS e.V. 00004 * All rights reserved. See COPYRIGHT file for details. 00005 * 00006 * This software and supporting documentation were developed by 00007 * 00008 * OFFIS e.V. 00009 * R&D Division Health 00010 * Escherweg 2 00011 * D-26121 Oldenburg, Germany 00012 * 00013 * 00014 * Module: dcmjpeg 00015 * 00016 * Author: Norbert Olges, Marco Eichelberg 00017 * 00018 * Purpose: codec parameter class for dcmjpeg codecs 00019 * 00020 * Last Update: $Author: joergr $ 00021 * Update Date: $Date: 2010-10-14 13:17:17 $ 00022 * CVS/RCS Revision: $Revision: 1.12 $ 00023 * Status: $State: Exp $ 00024 * 00025 * CVS/RCS Log at end of file 00026 * 00027 */ 00028 00029 #ifndef DJCPARAM_H 00030 #define DJCPARAM_H 00031 00032 #include "dcmtk/config/osconfig.h" 00033 #include "dcmtk/dcmdata/dccodec.h" /* for DcmCodecParameter */ 00034 #include "dcmtk/dcmjpeg/djutils.h" /* for enums */ 00035 00038 class DJCodecParameter: public DcmCodecParameter 00039 { 00040 public: 00041 00075 DJCodecParameter( 00076 E_CompressionColorSpaceConversion pCompressionCSConversion, 00077 E_DecompressionColorSpaceConversion pDecompressionCSConversion, 00078 E_UIDCreation pCreateSOPInstanceUID, 00079 E_PlanarConfiguration pPlanarConfiguration, 00080 OFBool predictor6WorkaroundEnable = OFFalse, 00081 OFBool pOptimizeHuffman = OFFalse, 00082 int pSmoothingFactor = 0, 00083 int pForcedBitDepth = 0, 00084 Uint32 pFragmentSize = 0, 00085 OFBool pCreateOffsetTable = OFTrue, 00086 E_SubSampling pSampleFactors = ESS_444, 00087 OFBool pWriteYBR422 = OFFalse, 00088 OFBool pConvertToSC = OFFalse, 00089 unsigned long pWindowType = 0, 00090 unsigned long pWindowParameter = 0, 00091 double pVoiCenter = 0.0, 00092 double pVoiWidth = 0.0, 00093 unsigned long pRoiLeft = 0, 00094 unsigned long pRoiTop = 0, 00095 unsigned long pRoiWidth = 0, 00096 unsigned long pRoiHeight = 0, 00097 OFBool pUsePixelValues = OFTrue, 00098 OFBool pUseModalityRescale = OFFalse, 00099 OFBool pAcceptWrongPaletteTags = OFFalse, 00100 OFBool pAcrNemaCompatibility = OFFalse, 00101 OFBool pTrueLosslessMode = OFTrue); 00102 00104 DJCodecParameter(const DJCodecParameter& arg); 00105 00107 virtual ~DJCodecParameter(); 00108 00113 virtual DcmCodecParameter *clone() const; 00114 00118 virtual const char *className() const; 00119 00123 OFBool getOptimizeHuffmanCoding() const 00124 { 00125 return optimizeHuffman; 00126 } 00127 00131 int getSmoothingFactor() const 00132 { 00133 return smoothingFactor; 00134 } 00135 00139 int getForcedBitDepth() const 00140 { 00141 return forcedBitDepth; 00142 } 00143 00147 Uint32 getFragmentSize() const 00148 { 00149 return fragmentSize; 00150 } 00151 00155 OFBool getCreateOffsetTable() const 00156 { 00157 return createOffsetTable; 00158 } 00159 00163 E_SubSampling getSampleFactors() const 00164 { 00165 return sampleFactors; 00166 } 00167 00172 OFBool getWriteYBR422() const 00173 { 00174 return writeYBR422; 00175 } 00176 00180 OFBool getConvertToSC() const 00181 { 00182 return convertToSC; 00183 } 00184 00188 E_UIDCreation getUIDCreation() const 00189 { 00190 return uidCreation; 00191 } 00192 00196 unsigned long getWindowType() const 00197 { 00198 return windowType; 00199 } 00200 00204 unsigned long getWindowParameter() const 00205 { 00206 return windowParameter; 00207 } 00208 00213 void getVOIWindow(double& center, double& width) const 00214 { 00215 center = voiCenter; 00216 width = voiWidth; 00217 } 00218 00225 void getROI( 00226 unsigned long& left_pos, 00227 unsigned long& top_pos, 00228 unsigned long& width, 00229 unsigned long& height) const 00230 { 00231 left_pos = roiLeft; 00232 top_pos = roiTop; 00233 width = roiWidth; 00234 height = roiHeight; 00235 } 00236 00240 E_PlanarConfiguration getPlanarConfiguration() const 00241 { 00242 return planarConfiguration; 00243 } 00244 00248 E_CompressionColorSpaceConversion getCompressionColorSpaceConversion() const 00249 { 00250 return compressionCSConversion; 00251 } 00252 00256 E_DecompressionColorSpaceConversion getDecompressionColorSpaceConversion() const 00257 { 00258 return decompressionCSConversion; 00259 } 00260 00264 OFBool getUsePixelValues() const 00265 { 00266 return usePixelValues; 00267 } 00268 00272 OFBool getUseModalityRescale() const 00273 { 00274 return useModalityRescale; 00275 } 00276 00280 OFBool getAcceptWrongPaletteTags() const 00281 { 00282 return acceptWrongPaletteTags; 00283 } 00284 00290 OFBool getAcrNemaCompatibility() const 00291 { 00292 return acrNemaCompatibility; 00293 } 00294 00298 OFBool getTrueLosslessMode() const 00299 { 00300 return trueLosslessMode; 00301 } 00302 00306 OFBool predictor6WorkaroundEnabled() const 00307 { 00308 return predictor6WorkaroundEnabled_; 00309 } 00310 00311 private: 00312 00314 DJCodecParameter& operator=(const DJCodecParameter&); 00315 00317 E_CompressionColorSpaceConversion compressionCSConversion; 00318 00320 E_DecompressionColorSpaceConversion decompressionCSConversion; 00321 00323 E_PlanarConfiguration planarConfiguration; 00324 00326 OFBool optimizeHuffman; 00327 00329 int smoothingFactor; 00330 00332 int forcedBitDepth; 00333 00335 Uint32 fragmentSize; 00336 00338 OFBool createOffsetTable; 00339 00341 E_SubSampling sampleFactors; 00342 00346 OFBool writeYBR422; 00347 00349 OFBool convertToSC; 00350 00352 E_UIDCreation uidCreation; 00353 00366 unsigned long windowType; 00367 00369 unsigned long windowParameter; 00370 00372 double voiCenter; 00373 00375 double voiWidth; 00376 00378 unsigned long roiLeft; 00379 00381 unsigned long roiTop; 00382 00384 unsigned long roiWidth; 00385 00387 unsigned long roiHeight; 00388 00390 OFBool usePixelValues; 00391 00393 OFBool useModalityRescale; 00394 00396 OFBool acceptWrongPaletteTags; 00397 00399 OFBool acrNemaCompatibility; 00400 00402 OFBool trueLosslessMode; 00403 00405 OFBool predictor6WorkaroundEnabled_; 00406 00407 }; 00408 00409 00410 #endif 00411 00412 /* 00413 * CVS/RCS Log 00414 * $Log: djcparam.h,v $ 00415 * Revision 1.12 2010-10-14 13:17:17 joergr 00416 * Updated copyright header. Added reference to COPYRIGHT file. 00417 * 00418 * Revision 1.11 2010-06-01 16:17:49 onken 00419 * Added some comments and line breaks (improved code readability). 00420 * 00421 * Revision 1.10 2010-03-24 15:01:34 joergr 00422 * Fixed minor formatting issues in API documentation. 00423 * 00424 * Revision 1.9 2009-10-07 12:44:33 uli 00425 * Switched to logging mechanism provided by the "new" oflog module. 00426 * 00427 * Revision 1.8 2006-03-29 15:58:52 meichel 00428 * Added support for decompressing images with 16 bits/pixel compressed with 00429 * a faulty lossless JPEG encoder that produces integer overflows in predictor 6. 00430 * 00431 * Revision 1.7 2005/12/08 16:59:13 meichel 00432 * Changed include path schema for all DCMTK header files 00433 * 00434 * Revision 1.6 2005/11/29 15:57:05 onken 00435 * Added commandline options --accept-acr-nema and --accept-palettes 00436 * (same as in dcm2pnm) to dcmcjpeg and extended dcmjpeg to support 00437 * these options. Thanks to Gilles Mevel for suggestion. 00438 * 00439 * Revision 1.4 2005/11/29 08:50:34 onken 00440 * Added support for "true" lossless compression in dcmjpeg, that doesn't 00441 * use dcmimage classes, but compresses raw pixel data (8 and 16 bit) to 00442 * avoid losses in quality caused by color space conversions or modality 00443 * transformations etc. 00444 * Corresponding commandline option in dcmcjpeg (new default) 00445 * 00446 * Revision 1.3 2002/12/09 13:51:26 joergr 00447 * Renamed parameter/local variable to avoid name clashes with global 00448 * declaration left and/or right (used for as iostream manipulators). 00449 * 00450 * Revision 1.2 2001/11/19 15:13:26 meichel 00451 * Introduced verbose mode in module dcmjpeg. If enabled, warning 00452 * messages from the IJG library are printed on ofConsole, otherwise 00453 * the library remains quiet. 00454 * 00455 * Revision 1.1 2001/11/13 15:56:17 meichel 00456 * Initial release of module dcmjpeg 00457 * 00458 * 00459 */