diluptab.h

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: DicomLookupTable (Header)
00023  *
00024  *  Last Update:      $Author: meichel $
00025  *  Update Date:      $Date: 2005/12/08 16:47:45 $
00026  *  CVS/RCS Revision: $Revision: 1.24 $
00027  *  Status:           $State: Exp $
00028  *
00029  *  CVS/RCS Log at end of file
00030  *
00031  */
00032 
00033 
00034 #ifndef DILUPTAB_H
00035 #define DILUPTAB_H
00036 
00037 #include "dcmtk/config/osconfig.h"
00038 #include "dcmtk/dcmdata/dctagkey.h"
00039 
00040 #include "dcmtk/dcmimgle/dibaslut.h"
00041 #include "dcmtk/dcmimgle/diobjcou.h"
00042 
00043 
00044 /*------------------------*
00045  *  forward declarations  *
00046  *------------------------*/
00047 
00048 class DcmObject;
00049 class DcmUnsignedShort;
00050 class DcmLongString;
00051 class DiDocument;
00052 
00053 
00054 /*---------------------*
00055  *  class declaration  *
00056  *---------------------*/
00057 
00060 class DiLookupTable
00061   : public DiBaseLUT,
00062     public DiObjectCounter
00063 {
00064 
00065  public:
00066 
00076     DiLookupTable(const DiDocument *docu,
00077                   const DcmTagKey &descriptor,
00078                   const DcmTagKey &data,
00079                   const DcmTagKey &explanation,
00080                   const OFBool ignoreDepth = OFFalse,
00081                   EI_Status *status = NULL);
00082 
00095     DiLookupTable(const DiDocument *docu,
00096                   const DcmTagKey &sequence,
00097                   const DcmTagKey &descriptor,
00098                   const DcmTagKey &data,
00099                   const DcmTagKey &explanation,
00100                   const OFBool ignoreDepth = OFFalse,
00101                   const unsigned long pos = 0,
00102                   unsigned long *card = NULL);
00103 
00113     DiLookupTable(const DcmUnsignedShort &data,
00114                   const DcmUnsignedShort &descriptor,
00115                   const DcmLongString *explanation = NULL,
00116                   const OFBool ignoreDepth = OFFalse,
00117                   const signed long first = -1,
00118                   EI_Status *status = NULL);
00119 
00126     DiLookupTable(Uint16 *buffer,
00127                   const Uint32 count,
00128                   const Uint16 bits);
00129 
00132     virtual ~DiLookupTable();
00133 
00145     int invertTable(const int flag = 0x1);
00146 
00159     int mirrorTable(const int flag = 0x1);
00160 
00167     DiLookupTable *createInverseLUT() const;
00168 
00179     int compareLUT(const DcmUnsignedShort &data,
00180                    const DcmUnsignedShort &descriptor);
00181 
00182 
00189     virtual OFBool operator==(const DiBaseLUT &lut);
00190 
00197     virtual OFBool operator==(const DiLookupTable &lut);
00198 
00199 
00200  protected:
00201 
00212     void Init(const DiDocument *docu,
00213               DcmObject *obj,
00214               const DcmTagKey &descriptor,
00215               const DcmTagKey &data,
00216               const DcmTagKey &explanation,
00217               const OFBool ignoreDepth = OFFalse,
00218               EI_Status *status = NULL);
00219 
00227     void checkTable(unsigned long count,
00228                     Uint16 bits,
00229                     const OFBool ignoreDepth = OFFalse,
00230                     EI_Status *status = NULL);
00231 
00242     void checkBits(const Uint16 bits,
00243                    const Uint16 rightBits,
00244                    const Uint16 wrongBits = 0,
00245                    const OFBool ignoreDepth = OFFalse);
00246 
00247  private:
00248 
00250     int OriginalBitsAllocated;
00252     void *OriginalData;
00253 
00254  // --- declarations to avoid compiler warnings
00255 
00256     DiLookupTable(const DiLookupTable &);
00257     DiLookupTable &operator=(const DiLookupTable &);
00258 };
00259 
00260 
00261 #endif
00262 
00263 
00264 /*
00265  *
00266  * CVS/RCS Log:
00267  * $Log: diluptab.h,v $
00268  * Revision 1.24  2005/12/08 16:47:45  meichel
00269  * Changed include path schema for all DCMTK header files
00270  *
00271  * Revision 1.23  2003/12/17 16:17:29  joergr
00272  * Added new compatibility flag that allows to ignore the third value of LUT
00273  * descriptors and to determine the bits per table entry automatically.
00274  *
00275  * Revision 1.22  2003/12/08 18:24:15  joergr
00276  * Removed leading underscore characters from preprocessor symbols (reserved
00277  * symbols). Updated CVS header.
00278  *
00279  * Revision 1.21  2003/06/12 15:08:34  joergr
00280  * Fixed inconsistent API documentation reported by Doxygen.
00281  *
00282  * Revision 1.20  2002/12/09 13:32:51  joergr
00283  * Renamed parameter/local variable to avoid name clashes with global
00284  * declaration left and/or right (used for as iostream manipulators).
00285  *
00286  * Revision 1.19  2001/06/01 15:49:43  meichel
00287  * Updated copyright header
00288  *
00289  * Revision 1.18  2000/07/07 13:42:30  joergr
00290  * Added support for LIN OD presentation LUT shape.
00291  *
00292  * Revision 1.17  2000/03/08 16:24:17  meichel
00293  * Updated copyright header.
00294  *
00295  * Revision 1.16  2000/03/06 18:19:36  joergr
00296  * Moved get-method to base class, renamed method and made method virtual to
00297  * avoid hiding of methods (reported by Sun CC 4.2).
00298  *
00299  * Revision 1.15  1999/11/24 11:13:46  joergr
00300  * Added method to mirror order of entries in look-up tables.
00301  * Enhanced comments for methods "inverting" the LUT values/entries.
00302  *
00303  * Revision 1.14  1999/11/03 12:52:08  joergr
00304  * Added copy constructor and assignment operator to avoid compiler warnings.
00305  *
00306  * Revision 1.13  1999/10/20 10:34:44  joergr
00307  * Enhanced method invertTable to distinguish between copy of LUT data and
00308  * original (referenced) LUT data.
00309  *
00310  * Revision 1.12  1999/09/30 11:37:09  joergr
00311  * Added methods to compare two lookup tables.
00312  *
00313  * Revision 1.11  1999/09/17 12:22:53  joergr
00314  * Added/changed/completed DOC++ style comments in the header files.
00315  *
00316  * Revision 1.10  1999/09/08 15:19:24  joergr
00317  * Completed implementation of setting inverse presentation LUT as needed
00318  * e.g. for DICOM print (invert 8->12 bits PLUT).
00319  *
00320  * Revision 1.9  1999/07/23 14:01:49  joergr
00321  * Added dummy method (no implementation yet) to create inverse LUTs.
00322  *
00323  * Revision 1.8  1999/05/03 11:09:28  joergr
00324  * Minor code purifications to keep Sun CC 2.0.1 quiet.
00325  *
00326  * Revision 1.7  1999/03/24 17:20:04  joergr
00327  * Added/Modified comments and formatting.
00328  *
00329  * Revision 1.6  1999/02/03 17:27:23  joergr
00330  * Added base class for look-up tables (moved main functionality of class
00331  * DiLookupTable to DiBaseLUT).
00332  *
00333  * Revision 1.5  1998/12/23 11:34:34  joergr
00334  * Changed behaviour of getLabel/Description/Explanation() methods: return
00335  * NULL if string empty, no empty string "".
00336  *
00337  * Revision 1.4  1998/12/22 14:24:36  joergr
00338  * Changed parameter type.
00339  * Added method getAbsMaxRange.
00340  *
00341  * Revision 1.3  1998/12/16 16:31:30  joergr
00342  * Added explanation string to LUT class (retrieved from dataset).
00343  *
00344  * Revision 1.2  1998/12/14 17:19:19  joergr
00345  * Added support for signed values as second entry in look-up tables
00346  * (= first value mapped).
00347  *
00348  * Revision 1.1  1998/11/27 15:10:21  joergr
00349  * Added copyright message.
00350  * Added support of object counter class.
00351  * Added constructors to use external modality transformations.
00352  * Added methods to support presentation LUTs and shapes.
00353  *
00354  * Revision 1.3  1998/07/01 08:39:22  joergr
00355  * Minor changes to avoid compiler warnings (gcc 2.8.1 with additional
00356  * options), e.g. add copy constructors.
00357  *
00358  * Revision 1.2  1998/05/11 14:53:18  joergr
00359  * Added CVS/RCS header to each file.
00360  *
00361  *
00362  */


Generated on 20 Dec 2005 for OFFIS DCMTK Version 3.5.4 by Doxygen 1.4.5