djcparam.h

00001 /*
00002  *
00003  *  Copyright (C) 1997-2005, OFFIS
00004  *
00005  *  This software and supporting documentation were developed by
00006  *
00007  *    Kuratorium OFFIS e.V.
00008  *    Healthcare Information and Communication Systems
00009  *    Escherweg 2
00010  *    D-26121 Oldenburg, Germany
00011  *
00012  *  THIS SOFTWARE IS MADE AVAILABLE,  AS IS,  AND OFFIS MAKES NO  WARRANTY
00013  *  REGARDING  THE  SOFTWARE,  ITS  PERFORMANCE,  ITS  MERCHANTABILITY  OR
00014  *  FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES  OR
00015  *  ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND
00016  *  PERFORMANCE OF THE SOFTWARE IS WITH THE USER.
00017  *
00018  *  Module:  dcmjpeg
00019  *
00020  *  Author:  Norbert Olges, Marco Eichelberg
00021  *
00022  *  Purpose: codec parameter class for dcmjpeg codecs
00023  *
00024  *  Last Update:      $Author: meichel $
00025  *  Update Date:      $Date: 2005/12/08 16:59:13 $
00026  *  Source File:      $Source: /share/dicom/cvs-depot/dcmtk/dcmjpeg/include/dcmtk/dcmjpeg/djcparam.h,v $
00027  *  CVS/RCS Revision: $Revision: 1.7 $
00028  *  Status:           $State: Exp $
00029  *
00030  *  CVS/RCS Log at end of file
00031  *
00032  */
00033 
00034 #ifndef DJCPARAM_H
00035 #define DJCPARAM_H
00036 
00037 #include "dcmtk/config/osconfig.h"
00038 #include "dcmtk/dcmdata/dccodec.h" /* for DcmCodecParameter */
00039 #include "dcmtk/dcmjpeg/djutils.h" /* for enums */
00040 
00043 class DJCodecParameter: public DcmCodecParameter
00044 {
00045 public:
00046 
00079   DJCodecParameter(
00080     E_CompressionColorSpaceConversion pCompressionCSConversion,
00081     E_DecompressionColorSpaceConversion pDecompressionCSConversion,
00082     E_UIDCreation pCreateSOPInstanceUID,
00083     E_PlanarConfiguration pPlanarConfiguration,
00084     OFBool pVerbose = OFFalse,
00085     OFBool pOptimizeHuffman = OFFalse,
00086     int pSmoothingFactor = 0,
00087     int pForcedBitDepth = 0,
00088     Uint32 pFragmentSize = 0,
00089     OFBool pCreateOffsetTable = OFTrue,
00090     E_SubSampling pSampleFactors = ESS_444,
00091     OFBool pWriteYBR422 = OFFalse,
00092     OFBool pConvertToSC = OFFalse,
00093     unsigned long pWindowType = 0,
00094     unsigned long pWindowParameter = 0,
00095     double pVoiCenter = 0.0,
00096     double pVoiWidth = 0.0,
00097     unsigned long pRoiLeft = 0,
00098     unsigned long pRoiTop = 0,
00099     unsigned long pRoiWidth = 0,
00100     unsigned long pRoiHeight = 0,
00101     OFBool pUsePixelValues = OFTrue,
00102     OFBool pUseModalityRescale = OFFalse,
00103     OFBool pAcceptWrongPaletteTags = OFFalse,
00104     OFBool pAcrNemaCompatibility = OFFalse,
00105     OFBool pTrueLosslessMode = OFTrue);
00106 
00108   DJCodecParameter(const DJCodecParameter& arg);
00109 
00111   virtual ~DJCodecParameter();
00112 
00117   virtual DcmCodecParameter *clone() const;
00118 
00122   virtual const char *className() const;
00123 
00127   OFBool getOptimizeHuffmanCoding() const
00128   {
00129     return optimizeHuffman;
00130   }
00131 
00135   int getSmoothingFactor() const
00136   {
00137     return smoothingFactor;
00138   }
00139 
00143   int getForcedBitDepth() const
00144   {
00145     return forcedBitDepth;
00146   }
00147 
00151   Uint32 getFragmentSize() const
00152   {
00153     return fragmentSize;
00154   }
00155 
00159   OFBool getCreateOffsetTable() const
00160   {
00161     return createOffsetTable;
00162   }
00163 
00167   E_SubSampling getSampleFactors() const
00168   {
00169     return sampleFactors;
00170   }
00171 
00176   OFBool getWriteYBR422() const
00177   {
00178     return writeYBR422;
00179   }
00180 
00184   OFBool getConvertToSC() const
00185   {
00186     return convertToSC;
00187   }
00188 
00192   E_UIDCreation getUIDCreation() const
00193   {
00194     return uidCreation;
00195   }
00196 
00200   unsigned long getWindowType() const
00201   {
00202     return windowType;
00203   }
00204 
00208   unsigned long getWindowParameter() const
00209   {
00210     return windowParameter;
00211   }
00212 
00217   void getVOIWindow(double& center, double& width) const
00218   {
00219     center = voiCenter;
00220     width = voiWidth;
00221   }
00222 
00229   void getROI(
00230     unsigned long& left_pos,
00231     unsigned long& top_pos,
00232     unsigned long& width,
00233     unsigned long& height) const
00234   {
00235     left_pos = roiLeft;
00236     top_pos = roiTop;
00237     width = roiWidth;
00238     height = roiHeight;
00239   }
00240 
00244   E_PlanarConfiguration getPlanarConfiguration() const
00245   {
00246     return planarConfiguration;
00247   }
00248 
00252   E_CompressionColorSpaceConversion getCompressionColorSpaceConversion() const
00253   {
00254     return compressionCSConversion;
00255   }
00256 
00260   E_DecompressionColorSpaceConversion getDecompressionColorSpaceConversion() const
00261   {
00262     return decompressionCSConversion;
00263   }
00264 
00268   OFBool getUsePixelValues() const
00269   {
00270     return usePixelValues;
00271   }
00272 
00276   OFBool getUseModalityRescale() const
00277   {
00278     return useModalityRescale;
00279   }
00280 
00284   OFBool getAcceptWrongPaletteTags() const
00285   {
00286     return acceptWrongPaletteTags;
00287   }
00288 
00294   OFBool getAcrNemaCompatibility() const
00295   {
00296     return acrNemaCompatibility;
00297   }
00298 
00302   OFBool getTrueLosslessMode() const
00303   {
00304     return trueLosslessMode;
00305   }
00306 
00310   OFBool isVerbose() const
00311   {
00312     return verboseMode;
00313   }
00314 
00315 private:
00316 
00318   DJCodecParameter& operator=(const DJCodecParameter&);
00319 
00321   E_CompressionColorSpaceConversion compressionCSConversion;
00322 
00324   E_DecompressionColorSpaceConversion decompressionCSConversion;
00325 
00327   E_PlanarConfiguration planarConfiguration;
00328 
00330   OFBool optimizeHuffman;
00331 
00333   int smoothingFactor;
00334 
00336   int forcedBitDepth;
00337 
00339   Uint32 fragmentSize;
00340 
00342   OFBool createOffsetTable;
00343 
00345   E_SubSampling sampleFactors;
00346 
00350   OFBool writeYBR422;
00351 
00353   OFBool convertToSC;
00354 
00356   E_UIDCreation uidCreation;
00357 
00359   unsigned long windowType;
00360 
00362   unsigned long windowParameter;
00363 
00365   double voiCenter;
00366 
00368   double voiWidth;
00369 
00371   unsigned long roiLeft;
00372 
00374   unsigned long roiTop;
00375 
00377   unsigned long roiWidth;
00378 
00380   unsigned long roiHeight;
00381 
00383   OFBool usePixelValues;
00384 
00386   OFBool useModalityRescale;
00387 
00389   OFBool acceptWrongPaletteTags;
00390 
00392   OFBool acrNemaCompatibility;
00393 
00395   OFBool trueLosslessMode;
00396 
00398   OFBool verboseMode;
00399 };
00400 
00401 
00402 #endif
00403 
00404 /*
00405  * CVS/RCS Log
00406  * $Log: djcparam.h,v $
00407  * Revision 1.7  2005/12/08 16:59:13  meichel
00408  * Changed include path schema for all DCMTK header files
00409  *
00410  * Revision 1.6  2005/11/29 15:57:05  onken
00411  * Added commandline options --accept-acr-nema and --accept-palettes
00412  * (same as in dcm2pnm) to dcmcjpeg and extended dcmjpeg to support
00413  * these options. Thanks to Gilles Mevel for suggestion.
00414  *
00415  * Revision 1.4  2005/11/29 08:50:34  onken
00416  * Added support for "true" lossless compression in dcmjpeg, that doesn't
00417  *   use dcmimage classes, but compresses raw pixel data (8 and 16 bit) to
00418  *   avoid losses in quality caused by color space conversions or modality
00419  *   transformations etc.
00420  * Corresponding commandline option in dcmcjpeg (new default)
00421  *
00422  * Revision 1.3  2002/12/09 13:51:26  joergr
00423  * Renamed parameter/local variable to avoid name clashes with global
00424  * declaration left and/or right (used for as iostream manipulators).
00425  *
00426  * Revision 1.2  2001/11/19 15:13:26  meichel
00427  * Introduced verbose mode in module dcmjpeg. If enabled, warning
00428  *   messages from the IJG library are printed on ofConsole, otherwise
00429  *   the library remains quiet.
00430  *
00431  * Revision 1.1  2001/11/13 15:56:17  meichel
00432  * Initial release of module dcmjpeg
00433  *
00434  *
00435  */


Generated on 20 Dec 2005 for OFFIS DCMTK Version 3.5.4 by Doxygen 1.4.5