dcmimgle/include/dcmtk/dcmimgle/dimomod.h

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: DicomMonochromeModality (Header)
00019  *
00020  *  Last Update:      $Author: joergr $
00021  *  Update Date:      $Date: 2010-10-14 13:16:26 $
00022  *  CVS/RCS Revision: $Revision: 1.17 $
00023  *  Status:           $State: Exp $
00024  *
00025  *  CVS/RCS Log at end of file
00026  *
00027  */
00028 
00029 
00030 #ifndef DIMOMOD_H
00031 #define DIMOMOD_H
00032 
00033 #include "dcmtk/config/osconfig.h"
00034 #include "dcmtk/ofstd/ofcast.h"
00035 
00036 #include "dcmtk/dcmimgle/diluptab.h"
00037 #include "dcmtk/dcmimgle/diobjcou.h"
00038 
00039 
00040 /*------------------------*
00041  *  forward declarations  *
00042  *------------------------*/
00043 
00044 class DiDocument;
00045 class DiInputPixel;
00046 
00047 
00048 /*---------------------*
00049  *  class declaration  *
00050  *---------------------*/
00051 
00054 class DiMonoModality
00055   : public DiObjectCounter
00056 {
00057 
00058  public:
00059 
00065     DiMonoModality(const DiDocument *docu,
00066                    DiInputPixel *pixel);
00067 
00075     DiMonoModality(const DiDocument *docu,
00076                    DiInputPixel *pixel,
00077                    const double slope,
00078                    const double intercept);
00079 
00088     DiMonoModality(const DiDocument *docu,
00089                    DiInputPixel *pixel,
00090                    const DcmUnsignedShort &data,
00091                    const DcmUnsignedShort &descriptor,
00092                    const DcmLongString *explanation);
00093 
00098     DiMonoModality(const int bits);
00099 
00102     virtual ~DiMonoModality();
00103 
00108     inline EP_Representation getRepresentation() const
00109     {
00110         return Representation;
00111     }
00112 
00117     inline double getMinValue() const
00118     {
00119         return MinValue;
00120     }
00121 
00126     inline double getMaxValue() const
00127     {
00128         return MaxValue;
00129     }
00130 
00135     inline unsigned int getBits() const
00136     {
00137         return Bits;
00138     }
00139 
00145     inline unsigned int getUsedBits() const
00146     {
00147         return UsedBits;
00148     }
00149 
00154     inline double getAbsMinimum() const
00155     {
00156         return AbsMinimum;
00157     }
00158 
00163     inline double getAbsMaximum() const
00164     {
00165         return AbsMaximum;
00166     }
00167 
00172     inline double getRescaleIntercept() const
00173     {
00174         return RescaleIntercept;
00175     }
00176 
00181     inline double getRescaleSlope() const
00182     {
00183         return RescaleSlope;
00184     }
00185 
00190     inline const DiLookupTable *getTableData() const
00191     {
00192         return TableData;
00193     }
00194 
00199     inline const char *getExplanation() const
00200     {
00201         return (TableData != NULL) ? TableData->getExplanation() : OFstatic_cast(const char *, NULL);
00202     }
00203 
00208     inline int hasLookupTable() const
00209     {
00210         return LookupTable;
00211     }
00212 
00217     inline int hasRescaling() const
00218     {
00219         return Rescaling;
00220     }
00221 
00222 
00223  protected:
00224 
00230     int Init(const DiDocument *docu,
00231              DiInputPixel *pixel);
00232 
00235     void checkTable();
00236 
00241     void checkRescaling(const DiInputPixel *pixel);
00242 
00247     void determineRepresentation(const DiDocument *docu);
00248 
00249 
00250  private:
00251 
00253     EP_Representation Representation;
00254 
00256     double MinValue;
00258     double MaxValue;
00259 
00261     unsigned int Bits;
00263     unsigned int UsedBits;
00264 
00266     double AbsMinimum;
00268     double AbsMaximum;
00269 
00271     double RescaleIntercept;
00273     double RescaleSlope;
00274 
00276     int LookupTable;
00278     int Rescaling;
00279 
00281     DiLookupTable *TableData;
00282 
00283  // --- declarations to avoid compiler warnings
00284 
00285     DiMonoModality(const DiMonoModality &);
00286     DiMonoModality &operator=(const DiMonoModality &);
00287 };
00288 
00289 
00290 #endif
00291 
00292 
00293 /*
00294  *
00295  * CVS/RCS Log:
00296  * $Log: dimomod.h,v $
00297  * Revision 1.17  2010-10-14 13:16:26  joergr
00298  * Updated copyright header. Added reference to COPYRIGHT file.
00299  *
00300  * Revision 1.16  2010-03-01 09:08:47  uli
00301  * Removed some unnecessary include directives in the headers.
00302  *
00303  * Revision 1.15  2009-04-21 08:21:06  joergr
00304  * Added method getUsedBits() which allows for retrieving the number of bits
00305  * actually used to store the output data.
00306  *
00307  * Revision 1.14  2005/12/08 16:47:52  meichel
00308  * Changed include path schema for all DCMTK header files
00309  *
00310  * Revision 1.13  2003/12/08 18:28:56  joergr
00311  * Adapted type casts to new-style typecast operators defined in ofcast.h.
00312  * Removed leading underscore characters from preprocessor symbols (reserved
00313  * symbols). Updated copyright header.
00314  *
00315  * Revision 1.12  2001/06/01 15:49:45  meichel
00316  * Updated copyright header
00317  *
00318  * Revision 1.11  2000/03/08 16:24:19  meichel
00319  * Updated copyright header.
00320  *
00321  * Revision 1.10  1999/10/06 13:40:25  joergr
00322  * Added Doc++ header comments.
00323  *
00324  * Revision 1.9  1999/09/17 12:26:25  joergr
00325  * iAdded/changed/completed DOC++ style comments in the header files.
00326  *
00327  * Revision 1.8  1999/05/31 12:35:15  joergr
00328  * Corrected bug concerning the conversion of color images to grayscale.
00329  *
00330  * Revision 1.7  1999/04/28 17:03:47  joergr
00331  * Added type casts to NULL pointers returned as 'const char *' to avoid
00332  * compiler warnings reported by gcc 2.7.2.1 (Linux).
00333  *
00334  * Revision 1.6  1999/03/24 17:20:12  joergr
00335  * Added/Modified comments and formatting.
00336  *
00337  * Revision 1.5  1999/02/03 17:30:00  joergr
00338  * Added member variable and related methods to store number of bits used for
00339  * pixel data.
00340  *
00341  * Revision 1.4  1998/12/22 14:31:01  joergr
00342  * Changed calculation of AbsMinimum/Maximum.
00343  * Removed member variable and method for isPotentiallySigned.
00344  *
00345  * Revision 1.3  1998/12/16 16:34:37  joergr
00346  * Added explanation string to LUT class (retrieved from dataset).
00347  *
00348  * Revision 1.2  1998/12/14 17:23:52  joergr
00349  * Added support for correct scaling of input/output values for grayscale
00350  * transformations.
00351  *
00352  * Revision 1.1  1998/11/27 15:25:15  joergr
00353  * Added copyright message.
00354  * Added constructors to use external modality transformations.
00355  *
00356  * Revision 1.5  1998/07/01 08:39:23  joergr
00357  * Minor changes to avoid compiler warnings (gcc 2.8.1 with additional
00358  * options), e.g. add copy constructors.
00359  *
00360  * Revision 1.4  1998/05/11 14:53:21  joergr
00361  * Added CVS/RCS header to each file.
00362  *
00363  *
00364  */


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1