00001 /* 00002 * 00003 * Copyright (C) 1996-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: dcmimgle 00019 * 00020 * Author: Joerg Riesmeier 00021 * 00022 * Purpose: DicomMonochromeModality (Header) 00023 * 00024 * Last Update: $Author: meichel $ 00025 * Update Date: $Date: 2005/12/08 16:47:52 $ 00026 * CVS/RCS Revision: $Revision: 1.14 $ 00027 * Status: $State: Exp $ 00028 * 00029 * CVS/RCS Log at end of file 00030 * 00031 */ 00032 00033 00034 #ifndef DIMOMOD_H 00035 #define DIMOMOD_H 00036 00037 #include "dcmtk/config/osconfig.h" 00038 #include "dcmtk/dcmdata/dctypes.h" 00039 #include "dcmtk/ofstd/ofcast.h" 00040 00041 #include "dcmtk/dcmimgle/diluptab.h" 00042 #include "dcmtk/dcmimgle/diobjcou.h" 00043 #include "dcmtk/dcmimgle/diutils.h" 00044 00045 00046 /*------------------------* 00047 * forward declarations * 00048 *------------------------*/ 00049 00050 class DiDocument; 00051 class DiInputPixel; 00052 00053 00054 /*---------------------* 00055 * class declaration * 00056 *---------------------*/ 00057 00060 class DiMonoModality 00061 : public DiObjectCounter 00062 { 00063 00064 public: 00065 00071 DiMonoModality(const DiDocument *docu, 00072 DiInputPixel *pixel); 00073 00081 DiMonoModality(const DiDocument *docu, 00082 DiInputPixel *pixel, 00083 const double slope, 00084 const double intercept); 00085 00094 DiMonoModality(const DiDocument *docu, 00095 DiInputPixel *pixel, 00096 const DcmUnsignedShort &data, 00097 const DcmUnsignedShort &descriptor, 00098 const DcmLongString *explanation); 00099 00104 DiMonoModality(const int bits); 00105 00108 virtual ~DiMonoModality(); 00109 00114 inline EP_Representation getRepresentation() const 00115 { 00116 return Representation; 00117 } 00118 00123 inline double getMinValue() const 00124 { 00125 return MinValue; 00126 } 00127 00132 inline double getMaxValue() const 00133 { 00134 return MaxValue; 00135 } 00136 00141 inline unsigned int getBits() const 00142 { 00143 return Bits; 00144 } 00145 00150 inline double getAbsMinimum() const 00151 { 00152 return AbsMinimum; 00153 } 00154 00159 inline double getAbsMaximum() const 00160 { 00161 return AbsMaximum; 00162 } 00163 00168 inline double getRescaleIntercept() const 00169 { 00170 return RescaleIntercept; 00171 } 00172 00177 inline double getRescaleSlope() const 00178 { 00179 return RescaleSlope; 00180 } 00181 00186 inline const DiLookupTable *getTableData() const 00187 { 00188 return TableData; 00189 } 00190 00195 inline const char *getExplanation() const 00196 { 00197 return (TableData != NULL) ? TableData->getExplanation() : OFstatic_cast(const char *, NULL); 00198 } 00199 00204 inline int hasLookupTable() const 00205 { 00206 return LookupTable; 00207 } 00208 00213 inline int hasRescaling() const 00214 { 00215 return Rescaling; 00216 } 00217 00218 00219 protected: 00220 00226 int Init(const DiDocument *docu, 00227 DiInputPixel *pixel); 00228 00231 void checkTable(); 00232 00237 void checkRescaling(const DiInputPixel *pixel); 00238 00239 00240 private: 00241 00243 EP_Representation Representation; 00244 00246 double MinValue; 00248 double MaxValue; 00249 00251 unsigned int Bits; 00253 double AbsMinimum; 00255 double AbsMaximum; 00256 00258 double RescaleIntercept; 00260 double RescaleSlope; 00261 00263 int LookupTable; 00265 int Rescaling; 00266 00268 DiLookupTable *TableData; 00269 00270 // --- declarations to avoid compiler warnings 00271 00272 DiMonoModality(const DiMonoModality &); 00273 DiMonoModality &operator=(const DiMonoModality &); 00274 }; 00275 00276 00277 #endif 00278 00279 00280 /* 00281 * 00282 * CVS/RCS Log: 00283 * $Log: dimomod.h,v $ 00284 * Revision 1.14 2005/12/08 16:47:52 meichel 00285 * Changed include path schema for all DCMTK header files 00286 * 00287 * Revision 1.13 2003/12/08 18:28:56 joergr 00288 * Adapted type casts to new-style typecast operators defined in ofcast.h. 00289 * Removed leading underscore characters from preprocessor symbols (reserved 00290 * symbols). Updated copyright header. 00291 * 00292 * Revision 1.12 2001/06/01 15:49:45 meichel 00293 * Updated copyright header 00294 * 00295 * Revision 1.11 2000/03/08 16:24:19 meichel 00296 * Updated copyright header. 00297 * 00298 * Revision 1.10 1999/10/06 13:40:25 joergr 00299 * Added Doc++ header comments. 00300 * 00301 * Revision 1.9 1999/09/17 12:26:25 joergr 00302 * iAdded/changed/completed DOC++ style comments in the header files. 00303 * 00304 * Revision 1.8 1999/05/31 12:35:15 joergr 00305 * Corrected bug concerning the conversion of color images to grayscale. 00306 * 00307 * Revision 1.7 1999/04/28 17:03:47 joergr 00308 * Added type casts to NULL pointers returned as 'const char *' to avoid 00309 * compiler warnings reported by gcc 2.7.2.1 (Linux). 00310 * 00311 * Revision 1.6 1999/03/24 17:20:12 joergr 00312 * Added/Modified comments and formatting. 00313 * 00314 * Revision 1.5 1999/02/03 17:30:00 joergr 00315 * Added member variable and related methods to store number of bits used for 00316 * pixel data. 00317 * 00318 * Revision 1.4 1998/12/22 14:31:01 joergr 00319 * Changed calculation of AbsMinimum/Maximum. 00320 * Removed member variable and method for isPotentiallySigned. 00321 * 00322 * Revision 1.3 1998/12/16 16:34:37 joergr 00323 * Added explanation string to LUT class (retrieved from dataset). 00324 * 00325 * Revision 1.2 1998/12/14 17:23:52 joergr 00326 * Added support for correct scaling of input/output values for grayscale 00327 * transformations. 00328 * 00329 * Revision 1.1 1998/11/27 15:25:15 joergr 00330 * Added copyright message. 00331 * Added constructors to use external modality transformations. 00332 * 00333 * Revision 1.5 1998/07/01 08:39:23 joergr 00334 * Minor changes to avoid compiler warnings (gcc 2.8.1 with additional 00335 * options), e.g. add copy constructors. 00336 * 00337 * Revision 1.4 1998/05/11 14:53:21 joergr 00338 * Added CVS/RCS header to each file. 00339 * 00340 * 00341 */