00001 /* 00002 * 00003 * Copyright (C) 1996-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: dcmimgle 00015 * 00016 * Author: Joerg Riesmeier 00017 * 00018 * Purpose: DicomMonochromePixel (Header) 00019 * 00020 * Last Update: $Author: joergr $ 00021 * Update Date: $Date: 2010-10-14 13:16:26 $ 00022 * CVS/RCS Revision: $Revision: 1.20 $ 00023 * Status: $State: Exp $ 00024 * 00025 * CVS/RCS Log at end of file 00026 * 00027 */ 00028 00029 00030 #ifndef DIMOPX_H 00031 #define DIMOPX_H 00032 00033 #include "dcmtk/config/osconfig.h" 00034 #include "dcmtk/ofstd/ofcast.h" 00035 00036 #include "dcmtk/dcmimgle/dipixel.h" 00037 #include "dcmtk/dcmimgle/dimomod.h" 00038 00039 00040 /*------------------------* 00041 * forward declarations * 00042 *------------------------*/ 00043 00044 class DiInputPixel; 00045 class DiMonoOutputPixel; 00046 00047 00048 /*---------------------* 00049 * class declaration * 00050 *---------------------*/ 00051 00054 class DiMonoPixel 00055 : public DiPixel 00056 { 00057 00058 public: 00059 00064 DiMonoPixel(const unsigned long count); 00065 00071 DiMonoPixel(const DiInputPixel *pixel, 00072 DiMonoModality *modality); 00073 00079 DiMonoPixel(DiMonoOutputPixel *pixel, 00080 DiMonoModality *modality); 00081 00084 virtual ~DiMonoPixel(); 00085 00090 inline int getPlanes() const 00091 { 00092 return 1; 00093 } 00094 00102 virtual int getMinMaxValues(double &min, 00103 double &max) const = 0; 00104 00113 virtual int getMinMaxWindow(const int idx, 00114 double ¢er, 00115 double &width) = 0; 00116 00131 virtual int getRoiWindow(const unsigned long left_pos, 00132 const unsigned long top_pos, 00133 const unsigned long width, 00134 const unsigned long height, 00135 const unsigned long columns, 00136 const unsigned long rows, 00137 const unsigned long frame, 00138 double &voiCenter, 00139 double &voiWidth) = 0; 00140 00149 virtual int getHistogramWindow(const double thresh, 00150 double ¢er, 00151 double &width) = 0; 00152 00157 inline unsigned int getBits() const 00158 { 00159 return (Modality != NULL) ? Modality->getBits() : 0; 00160 } 00161 00167 inline double getAbsMinimum() const 00168 { 00169 return (Modality != NULL) ? Modality->getAbsMinimum() : 0; 00170 } 00171 00177 inline double getAbsMaximum() const 00178 { 00179 return (Modality != NULL) ? Modality->getAbsMaximum() : 0; 00180 } 00181 00186 inline double getAbsMaxRange() const 00187 { 00188 return getAbsMaximum() - getAbsMinimum() + 1; 00189 } 00190 00195 inline const char *getModalityLutExplanation() const 00196 { 00197 return (Modality != NULL) ? Modality->getExplanation() : OFstatic_cast(const char *, NULL); 00198 } 00199 00206 inline int isPotentiallySigned() const 00207 { 00208 return (getAbsMinimum() < 0); 00209 } 00210 00211 00212 protected: 00213 00219 DiMonoPixel(const DiPixel *pixel, 00220 DiMonoModality *modality); 00221 00227 DiMonoPixel(const DiMonoPixel *pixel, 00228 const unsigned long count); 00229 00231 DiMonoModality *Modality; 00232 00233 00234 private: 00235 00236 // --- declarations to avoid compiler warnings 00237 00238 DiMonoPixel(const DiMonoPixel &); 00239 DiMonoPixel &operator=(const DiMonoPixel &); 00240 }; 00241 00242 00243 #endif 00244 00245 00246 /* 00247 * 00248 * CVS/RCS Log: 00249 * $Log: dimopx.h,v $ 00250 * Revision 1.20 2010-10-14 13:16:26 joergr 00251 * Updated copyright header. Added reference to COPYRIGHT file. 00252 * 00253 * Revision 1.19 2010-03-01 09:08:47 uli 00254 * Removed some unnecessary include directives in the headers. 00255 * 00256 * Revision 1.18 2005-12-08 16:47:55 meichel 00257 * Changed include path schema for all DCMTK header files 00258 * 00259 * Revision 1.17 2004/02/06 11:07:50 joergr 00260 * Distinguish more clearly between const and non-const access to pixel data. 00261 * 00262 * Revision 1.16 2003/12/08 18:45:29 joergr 00263 * Adapted type casts to new-style typecast operators defined in ofcast.h. 00264 * Removed leading underscore characters from preprocessor symbols (reserved 00265 * symbols). Updated copyright header. 00266 * 00267 * Revision 1.15 2002/12/09 13:32:54 joergr 00268 * Renamed parameter/local variable to avoid name clashes with global 00269 * declaration left and/or right (used for as iostream manipulators). 00270 * 00271 * Revision 1.14 2001/11/19 12:56:15 joergr 00272 * Added parameter 'frame' to setRoiWindow(). 00273 * 00274 * Revision 1.13 2001/09/28 13:07:43 joergr 00275 * Added method setRoiWindow() which automatically calculates a min-max VOI 00276 * window for a specified rectangular region of the image. 00277 * 00278 * Revision 1.12 2001/06/01 15:49:47 meichel 00279 * Updated copyright header 00280 * 00281 * Revision 1.11 2000/03/08 16:24:20 meichel 00282 * Updated copyright header. 00283 * 00284 * Revision 1.10 1999/10/06 13:43:29 joergr 00285 * Corrected creation of PrintBitmap pixel data: VOI windows should be applied 00286 * before clipping to avoid that the region outside the image (border) is also 00287 * windowed (this requires a new method in dcmimgle to create a DicomImage 00288 * with the grayscale transformations already applied). 00289 * 00290 * Revision 1.9 1999/09/17 12:41:26 joergr 00291 * Added/changed/completed DOC++ style comments in the header files. 00292 * 00293 * Revision 1.8 1999/05/31 12:35:16 joergr 00294 * Corrected bug concerning the conversion of color images to grayscale. 00295 * 00296 * Revision 1.7 1999/04/28 17:03:48 joergr 00297 * Added type casts to NULL pointers returned as 'const char *' to avoid 00298 * compiler warnings reported by gcc 2.7.2.1 (Linux). 00299 * 00300 * Revision 1.6 1999/03/24 17:20:15 joergr 00301 * Added/Modified comments and formatting. 00302 * 00303 * Revision 1.5 1999/02/03 17:33:18 joergr 00304 * Added member variable and related methods to store number of bits used for 00305 * pixel data. 00306 * 00307 * Revision 1.4 1999/01/11 09:35:56 joergr 00308 * Corrected some typos and formatting. 00309 * 00310 * Revision 1.3 1998/12/22 14:33:45 joergr 00311 * Added implementation of methods to return member variables AbsMinimum/ 00312 * Maximum. 00313 * 00314 * Revision 1.2 1998/12/16 16:35:39 joergr 00315 * Added explanation string to LUT class (retrieved from dataset). 00316 * 00317 * Revision 1.1 1998/11/27 15:33:16 joergr 00318 * Added copyright message. 00319 * Introduced new pixel base class. 00320 * 00321 * Revision 1.4 1998/07/01 08:39:24 joergr 00322 * Minor changes to avoid compiler warnings (gcc 2.8.1 with additional 00323 * options), e.g. add copy constructors. 00324 * 00325 * Revision 1.3 1998/05/11 14:53:23 joergr 00326 * Added CVS/RCS header to each file. 00327 * 00328 * 00329 */