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: dcmjpls 00015 * 00016 * Author: Martin Willkomm, Uli Schlachter 00017 * 00018 * Purpose: codec parameter class JPEG-LS codecs 00019 * 00020 * Last Update: $Author: joergr $ 00021 * Update Date: $Date: 2010-10-14 13:17:19 $ 00022 * CVS/RCS Revision: $Revision: 1.7 $ 00023 * Status: $State: Exp $ 00024 * 00025 * CVS/RCS Log at end of file 00026 * 00027 */ 00028 00029 #ifndef DCMJPLS_DJCPARAM_H 00030 #define DCMJPLS_DJCPARAM_H 00031 00032 #include "dcmtk/config/osconfig.h" 00033 #include "dcmtk/dcmdata/dccodec.h" /* for DcmCodecParameter */ 00034 #include "dcmtk/dcmjpls/djlsutil.h" /* for enums */ 00035 00038 class DJLSCodecParameter: public DcmCodecParameter 00039 { 00040 public: 00041 00044 enum interleaveMode 00045 { 00048 interleaveDefault, 00050 interleaveSample, 00052 interleaveLine, 00054 interleaveNone 00055 }; 00056 00073 DJLSCodecParameter( 00074 OFBool jpls_optionsEnabled, 00075 Uint16 jpls_t1 = 3, // these are the defaults for 8bpp in lossless mode 00076 Uint16 jpls_t2 = 7, 00077 Uint16 jpls_t3 = 21, 00078 Uint16 jpls_reset = 64, 00079 Uint16 jpls_limit = 0, 00080 OFBool preferCookedEncoding = OFTrue, 00081 Uint32 fragmentSize = 0, 00082 OFBool createOffsetTable = OFTrue, 00083 JLS_UIDCreation uidCreation = EJLSUC_default, 00084 OFBool convertToSC = OFFalse, 00085 JLS_PlanarConfiguration planarConfiguration = EJLSPC_restore, 00086 OFBool ignoreOffsetTable = OFFalse, 00087 interleaveMode jplsInterleaveMode = interleaveLine); 00088 00094 DJLSCodecParameter( 00095 JLS_UIDCreation uidCreation = EJLSUC_default, 00096 JLS_PlanarConfiguration planarConfiguration = EJLSPC_restore, 00097 OFBool ignoreOffsetTable = OFFalse); 00098 00100 DJLSCodecParameter(const DJLSCodecParameter& arg); 00101 00103 virtual ~DJLSCodecParameter(); 00104 00109 virtual DcmCodecParameter *clone() const; 00110 00114 virtual const char *className() const; 00115 00119 OFBool getConvertToSC() const 00120 { 00121 return convertToSC_; 00122 } 00123 00127 OFBool getCreateOffsetTable() const 00128 { 00129 return createOffsetTable_; 00130 } 00131 00135 JLS_UIDCreation getUIDCreation() const 00136 { 00137 return uidCreation_; 00138 } 00139 00143 JLS_PlanarConfiguration getPlanarConfiguration() const 00144 { 00145 return planarConfiguration_; 00146 } 00147 00152 OFBool cookedEncodingPreferred() const 00153 { 00154 return preferCookedEncoding_; 00155 } 00156 00160 Uint32 getFragmentSize() const 00161 { 00162 return fragmentSize_; 00163 } 00164 00168 Uint16 getT1() const 00169 { 00170 return jpls_t1_; 00171 } 00172 00176 Uint16 getT2() const 00177 { 00178 return jpls_t2_; 00179 } 00180 00184 Uint16 getT3() const 00185 { 00186 return jpls_t3_; 00187 } 00188 00192 Uint16 getReset() const 00193 { 00194 return jpls_reset_; 00195 } 00196 00200 Uint16 getLimit() const 00201 { 00202 return jpls_t1_; 00203 } 00204 00208 OFBool getUseCustomOptions() const 00209 { 00210 return jpls_optionsEnabled_; 00211 } 00212 00216 OFBool ignoreOffsetTable() const 00217 { 00218 return ignoreOffsetTable_; 00219 } 00220 00224 interleaveMode getJplsInterleaveMode() const 00225 { 00226 return jplsInterleaveMode_; 00227 } 00228 00229 private: 00230 00232 DJLSCodecParameter& operator=(const DJLSCodecParameter&); 00233 00234 // **************************************************** 00235 // **** Parameters describing the encoding process **** 00236 00238 OFBool jpls_optionsEnabled_; 00239 00241 Uint16 jpls_t1_; 00242 00244 Uint16 jpls_t2_; 00245 00247 Uint16 jpls_t3_; 00248 00250 Uint16 jpls_reset_; 00251 00253 Uint16 jpls_limit_; 00254 00256 Uint32 fragmentSize_; 00257 00259 OFBool createOffsetTable_; 00260 00262 OFBool preferCookedEncoding_; 00263 00265 JLS_UIDCreation uidCreation_; 00266 00268 OFBool convertToSC_; 00269 00271 interleaveMode jplsInterleaveMode_; 00272 00273 // **************************************************** 00274 // **** Parameters describing the decoding process **** 00275 00277 JLS_PlanarConfiguration planarConfiguration_; 00278 00280 OFBool ignoreOffsetTable_; 00281 00282 }; 00283 00284 00285 #endif 00286 00287 /* 00288 * CVS/RCS Log: 00289 * $Log: djcparam.h,v $ 00290 * Revision 1.7 2010-10-14 13:17:19 joergr 00291 * Updated copyright header. Added reference to COPYRIGHT file. 00292 * 00293 * Revision 1.6 2010-03-01 10:35:28 uli 00294 * Renamed include guards to avoid name clash with e.g. dcmjpeg. 00295 * 00296 * Revision 1.5 2010-02-25 10:17:14 uli 00297 * Fix doxygen comments in a couple of places. 00298 * 00299 * Revision 1.4 2009-10-07 13:16:47 uli 00300 * Switched to logging mechanism provided by the "new" oflog module. 00301 * 00302 * Revision 1.3 2009-07-31 10:18:37 meichel 00303 * Line interleaved JPEG-LS mode now default. This mode works correctly 00304 * when decompressing images with the LOCO-I reference implementation. 00305 * 00306 * Revision 1.2 2009-07-31 09:14:53 meichel 00307 * Added codec parameter and command line options that allow to control 00308 * the interleave mode used in the JPEG-LS bitstream when compressing 00309 * color images. 00310 * 00311 * Revision 1.1 2009-07-29 14:46:46 meichel 00312 * Initial release of module dcmjpls, a JPEG-LS codec for DCMTK based on CharLS 00313 * 00314 * Revision 1.1 2007-06-15 14:35:45 meichel 00315 * Renamed CMake project and include directory from dcmjpgls to dcmjpls 00316 * 00317 * Revision 1.4 2007/06/15 10:39:15 meichel 00318 * Completed implementation of decoder, which now correctly processes all 00319 * of the NEMA JPEG-LS sample images, including fragmented frames. 00320 * 00321 * Revision 1.3 2007/06/14 12:36:14 meichel 00322 * Further code clean-up. Updated doxygen comments. 00323 * 00324 * Revision 1.2 2007/06/13 16:41:07 meichel 00325 * Code clean-up and removal of dead code 00326 * 00327 * 00328 */