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: DicomMonochromePixel (Header) 00023 * 00024 * Last Update: $Author: meichel $ 00025 * Update Date: $Date: 2005/12/08 16:47:55 $ 00026 * CVS/RCS Revision: $Revision: 1.18 $ 00027 * Status: $State: Exp $ 00028 * 00029 * CVS/RCS Log at end of file 00030 * 00031 */ 00032 00033 00034 #ifndef DIMOPX_H 00035 #define DIMOPX_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/dipixel.h" 00042 #include "dcmtk/dcmimgle/dimomod.h" 00043 #include "dcmtk/dcmimgle/diutils.h" 00044 00045 00046 /*------------------------* 00047 * forward declarations * 00048 *------------------------*/ 00049 00050 class DiInputPixel; 00051 class DiMonoOutputPixel; 00052 00053 00054 /*---------------------* 00055 * class declaration * 00056 *---------------------*/ 00057 00060 class DiMonoPixel 00061 : public DiPixel 00062 { 00063 00064 public: 00065 00070 DiMonoPixel(const unsigned long count); 00071 00077 DiMonoPixel(const DiInputPixel *pixel, 00078 DiMonoModality *modality); 00079 00085 DiMonoPixel(DiMonoOutputPixel *pixel, 00086 DiMonoModality *modality); 00087 00090 virtual ~DiMonoPixel(); 00091 00096 inline int getPlanes() const 00097 { 00098 return 1; 00099 } 00100 00108 virtual int getMinMaxValues(double &min, 00109 double &max) const = 0; 00110 00119 virtual int getMinMaxWindow(const int idx, 00120 double ¢er, 00121 double &width) = 0; 00122 00137 virtual int getRoiWindow(const unsigned long left_pos, 00138 const unsigned long top_pos, 00139 const unsigned long width, 00140 const unsigned long height, 00141 const unsigned long columns, 00142 const unsigned long rows, 00143 const unsigned long frame, 00144 double &voiCenter, 00145 double &voiWidth) = 0; 00146 00155 virtual int getHistogramWindow(const double thresh, 00156 double ¢er, 00157 double &width) = 0; 00158 00163 inline unsigned int getBits() const 00164 { 00165 return (Modality != NULL) ? Modality->getBits() : 0; 00166 } 00167 00173 inline double getAbsMinimum() const 00174 { 00175 return (Modality != NULL) ? Modality->getAbsMinimum() : 0; 00176 } 00177 00183 inline double getAbsMaximum() const 00184 { 00185 return (Modality != NULL) ? Modality->getAbsMaximum() : 0; 00186 } 00187 00192 inline double getAbsMaxRange() const 00193 { 00194 return getAbsMaximum() - getAbsMinimum() + 1; 00195 } 00196 00201 inline const char *getModalityLutExplanation() const 00202 { 00203 return (Modality != NULL) ? Modality->getExplanation() : OFstatic_cast(const char *, NULL); 00204 } 00205 00212 inline int isPotentiallySigned() const 00213 { 00214 return (getAbsMinimum() < 0); 00215 } 00216 00217 00218 protected: 00219 00225 DiMonoPixel(const DiPixel *pixel, 00226 DiMonoModality *modality); 00227 00233 DiMonoPixel(const DiMonoPixel *pixel, 00234 const unsigned long count); 00235 00237 DiMonoModality *Modality; 00238 00239 00240 private: 00241 00242 // --- declarations to avoid compiler warnings 00243 00244 DiMonoPixel(const DiMonoPixel &); 00245 DiMonoPixel &operator=(const DiMonoPixel &); 00246 }; 00247 00248 00249 #endif 00250 00251 00252 /* 00253 * 00254 * CVS/RCS Log: 00255 * $Log: dimopx.h,v $ 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 */