OFFIS DCMTK  Version 3.6.0
didispfn.h
1 /*
2  *
3  * Copyright (C) 1996-2010, OFFIS e.V.
4  * All rights reserved. See COPYRIGHT file for details.
5  *
6  * This software and supporting documentation were developed by
7  *
8  * OFFIS e.V.
9  * R&D Division Health
10  * Escherweg 2
11  * D-26121 Oldenburg, Germany
12  *
13  *
14  * Module: dcmimgle
15  *
16  * Author: Joerg Riesmeier
17  *
18  * Purpose: DicomDisplayFunction (Header)
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-10-14 13:16:26 $
22  * CVS/RCS Revision: $Revision: 1.25 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 
30 #ifndef DIDISPFN_H
31 #define DIDISPFN_H
32 
33 #include "dcmtk/config/osconfig.h"
34 
35 #include "dcmtk/ofstd/oftypes.h"
36 
37 /*------------------------*
38  * forward declarations *
39  *------------------------*/
40 
41 class DiDisplayLUT;
42 
43 
44 /*---------------------*
45  * macro definitions *
46  *---------------------*/
47 
48 #define MAX_DISPLAY_FUNCTIONS 2
49 #define MAX_NUMBER_OF_TABLES 15
50 #define WIDTH_OF_PVALUES 16
51 
52 
53 /*---------------------*
54  * class declaration *
55  *---------------------*/
56 
61 {
62 
63  public:
64 
68  {
77  };
78 
90  DiDisplayFunction(const char *filename,
91  const E_DeviceType deviceType = EDT_Monitor,
92  const signed int ord = -1);
93 
105  DiDisplayFunction(const double *val_tab,
106  const unsigned long count,
107  const Uint16 max = 255,
108  const E_DeviceType deviceType = EDT_Monitor,
109  const signed int ord = 0);
110 
123  DiDisplayFunction(const Uint16 *ddl_tab,
124  const double *val_tab,
125  const unsigned long count,
126  const Uint16 max = 255,
127  const E_DeviceType deviceType = EDT_Monitor,
128  const signed int ord = 0);
129 
140  DiDisplayFunction(const double val_min,
141  const double val_max,
142  const unsigned long count = 256,
143  const E_DeviceType deviceType = EDT_Monitor,
144  const signed int ord = 0);
145 
148  virtual ~DiDisplayFunction();
149 
154  inline int isValid() const
155  {
156  return Valid;
157  }
158 
164  {
165  return DeviceType;
166  }
167 
173  inline Uint16 getMaxDDLValue() const
174  {
175  return MaxDDLValue;
176  }
177 
184  inline double getMinValue() const
185  {
186  return MinValue;
187  }
188 
195  inline double getMaxValue() const
196  {
197  return MaxValue;
198  }
199 
209  double getValueforDDL(const Uint16 ddl) const;
210 
221  Uint16 getDDLforValue(const double value) const;
222 
230  const DiDisplayLUT *getLookupTable(const int bits,
231  unsigned long count = 0);
232 
239  int deleteLookupTable(const int bits);
240 
248  virtual int writeCurveData(const char *filename,
249  const OFBool mode = OFTrue) = 0;
250 
256  inline double getAmbientLightValue() const
257  {
258  return AmbientLight;
259  }
260 
270  virtual int setAmbientLightValue(const double value);
271 
277  inline double getIlluminationValue() const
278  {
279  return Illumination;
280  }
281 
291  virtual int setIlluminationValue(const double value);
292 
298  inline double getMinDensityValue() const
299  {
300  return MinDensity;
301  }
302 
311  virtual int setMinDensityValue(const double value);
312 
318  inline double getMaxDensityValue() const
319  {
320  return MaxDensity;
321  }
322 
331  virtual int setMaxDensityValue(const double value);
332 
338  double getMinLuminanceValue() const;
339 
345  double getMaxLuminanceValue() const;
346 
352  inline signed int getPolynomialOrder() const
353  {
354  return Order;
355  }
356 
365  double convertODtoLum(const double value,
366  const OFBool useAmb = OFTrue) const;
367 
377  static double convertODtoLum(const double value,
378  const double ambient,
379  const double illum);
380 
381 
382  protected:
383 
390  virtual DiDisplayLUT *getDisplayLUT(unsigned long count) = 0;
391 
398  int readConfigFile(const char *filename);
399 
407  int createSortedTable(const Uint16 *ddl_tab,
408  const double *val_tab);
409 
420  double *convertODtoLumTable(const double *od_tab,
421  const unsigned long count,
422  const OFBool useAmb);
423 
426  int interpolateValues();
427 
432  int calculateMinMax();
433 
439  int checkMinMaxDensity() const;
440 
442  int Valid;
443 
446 
448  unsigned long ValueCount;
450  Uint16 MaxDDLValue;
452  signed int Order;
453 
455  double AmbientLight;
457  double Illumination;
458 
460  double MinDensity;
462  double MaxDensity;
463 
465  Uint16 *DDLValue;
467  double *LODValue;
468 
470  double MinValue;
472  double MaxValue;
473 
475  static const int MinBits;
477  static const int MaxBits;
478 
480  DiDisplayLUT *LookupTable[MAX_NUMBER_OF_TABLES];
481 
482 
483  private:
484 
485  // --- declarations to avoid compiler warnings
486 
488  DiDisplayFunction &operator=(const DiDisplayFunction &);
489 };
490 
491 
492 #endif
493 
494 
495 /*
496  *
497  * CVS/RCS Log:
498  * $Log: didispfn.h,v $
499  * Revision 1.25 2010-10-14 13:16:26 joergr
500  * Updated copyright header. Added reference to COPYRIGHT file.
501  *
502  * Revision 1.24 2010-03-01 09:08:46 uli
503  * Removed some unnecessary include directives in the headers.
504  *
505  * Revision 1.23 2005-12-08 16:47:37 meichel
506  * Changed include path schema for all DCMTK header files
507  *
508  * Revision 1.22 2003/12/08 18:18:35 joergr
509  * Removed leading underscore characters from preprocessor symbols (reserved
510  * symbols). Updated CVS header.
511  *
512  * Revision 1.21 2003/03/12 14:56:14 joergr
513  * Removed default value from parameter "useAmb" in method convertODtoLumTable.
514  *
515  * Revision 1.20 2003/02/12 11:35:16 joergr
516  * Added Dmin/max support to CIELAB calibration routines.
517  *
518  * Revision 1.19 2003/02/11 16:32:02 joergr
519  * Added two new functions to determine the luminance/OD value of a particular
520  * DDL according to the device's characteristic curve and vice versa.
521  *
522  * Revision 1.18 2003/02/11 10:01:14 joergr
523  * Added support for Dmin/max to calibration routines (required for printers).
524  *
525  * Revision 1.17 2002/07/19 08:24:21 joergr
526  * Enhanced/corrected comments.
527  *
528  * Revision 1.16 2002/07/18 12:29:08 joergr
529  * Added support for hardcopy and softcopy input devices (camera and scanner).
530  * Added polygonal curve fitting algorithm as an alternate interpolation
531  * method.
532  *
533  * Revision 1.15 2002/07/03 13:50:24 joergr
534  * Fixed inconsistencies regarding the handling of ambient light.
535  *
536  * Revision 1.14 2002/07/02 16:23:42 joergr
537  * Added support for hardcopy devices to the calibrated output routines.
538  *
539  * Revision 1.13 2001/06/01 15:49:40 meichel
540  * Updated copyright header
541  *
542  * Revision 1.12 2000/03/08 16:24:15 meichel
543  * Updated copyright header.
544  *
545  * Revision 1.11 2000/03/06 18:19:35 joergr
546  * Moved get-method to base class, renamed method and made method virtual to
547  * avoid hiding of methods (reported by Sun CC 4.2).
548  *
549  * Revision 1.10 1999/10/18 15:05:51 joergr
550  * Enhanced command line tool dcmdspfn (added new options).
551  *
552  * Revision 1.9 1999/10/18 10:15:50 joergr
553  * Moved min/max value determination to display function base class. Now the
554  * actual min/max values are also used for GSDFunction (instead of first and
555  * last luminance value).
556  *
557  * Revision 1.8 1999/09/17 12:08:24 joergr
558  * Added/changed/completed DOC++ style comments in the header files.
559  *
560  * Revision 1.7 1999/09/10 08:45:18 joergr
561  * Added support for CIELAB display function.
562  *
563  * Revision 1.6 1999/03/24 17:19:20 joergr
564  * Added/Modified comments and formatting.
565  * Added support for Barten transformation from 2 to 7 bits input (now: 2-16).
566  *
567  * Revision 1.5 1999/03/03 11:47:42 joergr
568  * Added support to specify ambient light value (re: Barten transformation).
569  *
570  * Revision 1.4 1999/02/23 16:55:32 joergr
571  * Added tool to export display curves to a text file.
572  *
573  * Revision 1.3 1999/02/11 15:44:22 joergr
574  * Removed unused parameter / member variable.
575  *
576  * Revision 1.2 1999/02/05 16:43:12 joergr
577  * Added optional parameter to method convertPValueToDDL to specify width
578  * of output data (number of bits).
579  *
580  * Revision 1.1 1999/02/03 17:46:37 joergr
581  * Added support for calibration according to Barten transformation (incl.
582  * a DISPLAY file describing the monitor characteristic).
583  *
584  *
585  */


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2