Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

dcvr.h

00001 /*
00002  *
00003  *  Copyright (C) 1994-2003, 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:  dcmdata
00019  *
00020  *  Author:  Gerd Ehlers, Andreas Barth, Andrew Hewett
00021  *
00022  *  Purpose: Definition of the DcmVR class for Value Representation
00023  *
00024  *  Last Update:      $Author: joergr $
00025  *  Update Date:      $Date: 2003/06/12 13:31:46 $
00026  *  Source File:      $Source: /share/dicom/cvs-depot/dcmtk/dcmdata/include/dcvr.h,v $
00027  *  CVS/RCS Revision: $Revision: 1.21 $
00028  *  Status:           $State: Exp $
00029  *
00030  *  CVS/RCS Log at end of file
00031  *
00032  */
00033 
00034 #ifndef DCMVR_H
00035 #define DCMVR_H 1
00036 
00037 #include "osconfig.h"    /* make sure OS specific configuration is included first */
00038 #include "dctypes.h"
00039 #include "ofglobal.h"
00040 
00041 #define INCLUDE_CSTDLIB
00042 #include "ofstdinc.h"
00043 
00044 /*
00045 ** Global flag to enable/disable the generation of VR=UN
00046 */
00047 extern OFGlobal<OFBool> dcmEnableUnknownVRGeneration; /* default OFTrue */
00048 
00049 /*
00050 ** Global flag to enable/disable the generation of VR=UT
00051 */
00052 extern OFGlobal<OFBool> dcmEnableUnlimitedTextVRGeneration; /* default OFTrue */
00053 
00054 /*
00055 ** VR Enumerations.
00056 ** NB: The order of entries has to conform to the order in DcmVRDict (see dcmvr.cc)!
00057 **     If not an error message is reported and the program aborts (only in DEBUG mode).
00058 */
00059 enum DcmEVR
00060 {
00061     EVR_AE,
00062     EVR_AS,
00063     EVR_AT,
00064     EVR_CS,
00065     EVR_DA,
00066     EVR_DS,
00067     EVR_DT,
00068     EVR_FL,
00069     EVR_FD,
00070     EVR_IS,
00071     EVR_LO,
00072     EVR_LT,
00073     EVR_OB,
00074     EVR_OF,
00075     EVR_OW,
00076     EVR_PN,
00077     EVR_SH,
00078     EVR_SL,
00079     EVR_SQ,
00080     EVR_SS,
00081     EVR_ST,
00082     EVR_TM,
00083     EVR_UI,
00084     EVR_UL,
00085     EVR_US,
00086     EVR_UT,
00087 
00088     EVR_ox,  /* OB or OW depending on context */
00089     EVR_xs,  /* SS or US depending on context */
00090     EVR_na,  /* na="not applicable", for data which has no VR */
00091     EVR_up,  /* up="unsigned pointer", used internally for DICOMDIR support */
00092 
00093     EVR_item,        /* used internally */
00094     EVR_metainfo,    /* used internally */
00095     EVR_dataset,     /* used internally */
00096     EVR_fileFormat,  /* used internally */
00097     EVR_dicomDir,    /* used internally */
00098     EVR_dirRecord,   /* used internally */
00099 
00100     EVR_pixelSQ,     /* used internally */
00101     EVR_pixelItem,   /* used internally */
00102 
00103     EVR_UNKNOWN,     /* used internally */
00104     EVR_UN,          /* Unknown value representation - defined in supplement 14 */
00105     EVR_PixelData,   /* used internally */
00106     EVR_OverlayData, /* used internally */
00107 
00108     EVR_UNKNOWN2B    /* like EVR_UNKNOWN but without extended length property in explicit VR */
00109 };
00110 
00111 
00114 class DcmVR
00115 {
00116 public:
00117 
00119     DcmVR()
00120     : vr(EVR_UNKNOWN)
00121     {
00122     }
00123 
00127     DcmVR(DcmEVR evr)
00128     : vr(EVR_UNKNOWN)
00129     { 
00130       // the set method is safeguarded against incorrect passing of integer values
00131       setVR(evr);
00132     }
00133 
00137     DcmVR(const char* vrName) 
00138     : vr(EVR_UNKNOWN)
00139     { 
00140       setVR(vrName);
00141     }
00142 
00144     DcmVR(const DcmVR& avr) 
00145     : vr(avr.vr)
00146     {
00147     }
00148 
00152     void setVR(DcmEVR evr);
00153 
00157     void setVR(const char* vrName);
00158 
00162     void setVR(const DcmVR& avr) { vr = avr.vr; }
00163 
00167     DcmVR& operator=(const DcmVR& arg)
00168     {
00169       vr = arg.vr;
00170       return *this;
00171     }
00172 
00176     DcmEVR getEVR() const { return vr; }
00177 
00184     DcmEVR getValidEVR() const;
00185 
00189     const char* getVRName() const ;
00190 
00197     const char* getValidVRName() const;
00198 
00205     size_t getValueWidth() const;
00206 
00210     OFBool isStandard() const;
00211 
00215     OFBool isForInternalUseOnly() const;
00216 
00220     OFBool isaString() const;
00221 
00225     OFBool usesExtendedLengthEncoding() const;
00226 
00233     OFBool isEquivalent(const DcmVR& avr) const;
00234 
00235     /* minimum and maximum length of a value with this VR
00236     ** (in bytes assuming single byte characters)
00237     */
00238 
00242     Uint32 getMinValueLength() const;
00243 
00247     Uint32 getMaxValueLength() const;
00248 
00249 private:
00251     DcmEVR vr;
00252 };
00253 
00254 
00255 #endif /* !DCMVR_H */
00256 
00257 
00258 /*
00259  * CVS/RCS Log:
00260  * $Log: dcvr.h,v $
00261  * Revision 1.21  2003/06/12 13:31:46  joergr
00262  * Fixed inconsistent API documentation reported by Doxygen.
00263  *
00264  * Revision 1.20  2003/03/21 13:06:46  meichel
00265  * Minor code purifications for warnings reported by MSVC in Level 4
00266  *
00267  * Revision 1.19  2002/12/06 12:20:19  joergr
00268  * Added support for new value representation Other Float String (OF).
00269  *
00270  * Revision 1.18  2002/11/27 12:07:24  meichel
00271  * Adapted module dcmdata to use of new header file ofstdinc.h
00272  *
00273  * Revision 1.17  2001/06/01 15:48:47  meichel
00274  * Updated copyright header
00275  *
00276  * Revision 1.16  2000/04/14 15:42:56  meichel
00277  * Global VR generation flags are now derived from OFGlobal and, thus,
00278  *   safe for use in multi-thread applications.
00279  *
00280  * Revision 1.15  2000/03/08 16:26:21  meichel
00281  * Updated copyright header.
00282  *
00283  * Revision 1.14  2000/02/29 11:48:38  meichel
00284  * Removed support for VS value representation. This was proposed in CP 101
00285  *   but never became part of the standard.
00286  *
00287  * Revision 1.13  2000/02/23 15:11:42  meichel
00288  * Corrected macro for Borland C++ Builder 4 workaround.
00289  *
00290  * Revision 1.12  2000/02/01 10:12:03  meichel
00291  * Avoiding to include <stdlib.h> as extern "C" on Borland C++ Builder 4,
00292  *   workaround for bug in compiler header files.
00293  *
00294  * Revision 1.11  1999/06/10 10:44:51  meichel
00295  * Replaced some #if statements by more robust #ifdef
00296  *
00297  * Revision 1.10  1999/03/31 09:24:54  meichel
00298  * Updated copyright header in module dcmdata
00299  *
00300  *
00301  */


Generated on 8 Dec 2004 for OFFIS DCMTK Version 3.5.3 by Doxygen 1.3.9.1