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

dctag.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, Andrew Hewett
00021  *
00022  *  Purpose: Definition of the class DcmTag
00023  *
00024  *  Last Update:      $Author: meichel $
00025  *  Update Date:      $Date: 2003/08/14 09:00:56 $
00026  *  Source File:      $Source: /share/dicom/cvs-depot/dcmtk/dcmdata/include/dctag.h,v $
00027  *  CVS/RCS Revision: $Revision: 1.20 $
00028  *  Status:           $State: Exp $
00029  *
00030  *  CVS/RCS Log at end of file
00031  *
00032  */
00033 
00034 #ifndef DCTAG_H
00035 #define DCTAG_H
00036 
00037 #include "osconfig.h"    /* make sure OS specific configuration is included first */
00038 #include "ofcond.h"
00039 #include "dctagkey.h"
00040 #include "dcvr.h"
00041 
00043 #define DcmTag_ERROR_TagName    "Unknown Tag & Data"
00044 
00045 
00055 class DcmTag: public DcmTagKey
00056 {
00057 public:
00059     DcmTag();
00060 
00067     DcmTag(const DcmTagKey& akey);
00068 
00076     DcmTag(Uint16 g, Uint16 e);
00077 
00084     DcmTag(const DcmTagKey& akey, const DcmVR& avr);
00085 
00093     DcmTag(Uint16 g, Uint16 e, const DcmVR& avr);
00094 
00096     DcmTag(const DcmTag& tag);
00097 
00099     ~DcmTag();
00100 
00102     DcmTag& operator=(const DcmTag& tag);
00103 
00105     DcmVR setVR(const DcmVR& avr);
00106 
00108     DcmVR getVR() const { return vr; }
00109 
00111     DcmEVR getEVR() const { return vr.getEVR(); }
00112 
00114     const char* getVRName() const { return vr.getVRName(); }
00115 
00119     Uint16 getGTag() const { return getGroup(); }
00120 
00124     Uint16 getETag() const { return getElement(); }
00125 
00129     DcmTagKey getXTag() const
00130     { 
00131       return * OFstatic_cast(const DcmTagKey *, this);
00132     }
00133     
00141     const char* getTagName();
00142 
00147     const char* getPrivateCreator() const;
00148 
00154     void setPrivateCreator(const char *privCreator);
00155 
00161     void lookupVRinDictionary();
00162 
00167     OFBool isSignable() const;
00168 
00171     OFBool isUnknownVR() const;
00172 
00174     OFCondition error() const { return errorFlag; }
00175 
00176     // --- static helper functions ---
00177 
00189     static OFCondition findTagFromName(const char *name,
00190                                        DcmTag &value);
00191 private:
00192 
00196     void updateTagName(const char *c);
00197 
00201     void updatePrivateCreator(const char *c);
00202 
00204     DcmVR vr;
00205 
00207     char *tagName;
00208 
00210     char *privateCreator;
00211 
00213     OFCondition errorFlag;
00214 
00215 };
00216 
00217 
00218 // *** global constants ********************************
00219 
00220 
00221 #define ItemTag (DcmTag(DCM_Item))
00222 #define InternalUseTag (DcmTag(DcmTagKey(0xfffe, 0xfffe)))
00223 
00224 
00225 #endif /* !DCTAG_H */
00226 
00227 /*
00228 ** CVS/RCS Log:
00229 ** $Log: dctag.h,v $
00230 ** Revision 1.20  2003/08/14 09:00:56  meichel
00231 ** Adapted type casts to new-style typecast operators defined in ofcast.h
00232 **
00233 ** Revision 1.19  2002/07/23 14:21:27  meichel
00234 ** Added support for private tag data dictionaries to dcmdata
00235 **
00236 ** Revision 1.18  2002/05/24 09:49:13  joergr
00237 ** Renamed some parameters/variables to avoid ambiguities.
00238 **
00239 ** Revision 1.17  2002/04/30 13:12:12  joergr
00240 ** Added static helper function to convert strings (tag names or group/element
00241 ** numbers) to DICOM tag objects.
00242 **
00243 ** Revision 1.16  2001/11/19 15:23:10  meichel
00244 ** Cleaned up signature code to avoid some gcc warnings.
00245 **
00246 ** Revision 1.15  2001/11/16 15:54:40  meichel
00247 ** Adapted digital signature code to final text of supplement 41.
00248 **
00249 ** Revision 1.14  2001/09/25 17:19:29  meichel
00250 ** Adapted dcmdata to class OFCondition
00251 **
00252 ** Revision 1.13  2001/06/01 15:48:45  meichel
00253 ** Updated copyright header
00254 **
00255 ** Revision 1.12  2000/04/14 16:00:58  meichel
00256 ** Restructured class DcmTag. Instances don't keep a permanent pointer
00257 **   to a data dictionary entry anymore. Required for MT applications.
00258 **
00259 ** Revision 1.11  2000/03/08 16:26:19  meichel
00260 ** Updated copyright header.
00261 **
00262 ** Revision 1.10  1999/03/31 09:24:49  meichel
00263 ** Updated copyright header in module dcmdata
00264 **
00265 ** Revision 1.9  1998/07/15 15:48:54  joergr
00266 ** Removed several compiler warnings reported by gcc 2.8.1 with
00267 ** additional options, e.g. missing copy constructors and assignment
00268 ** operators, initialization of member variables in the body of a
00269 ** constructor instead of the member initialization list, hiding of
00270 ** methods by use of identical names, uninitialized member variables,
00271 ** missing const declaration of char pointers. Replaced tabs by spaces.
00272 **
00273 ** Revision 1.8  1997/05/06 09:26:44  hewett
00274 ** The DcmTag::getVMMax() method now returns a maximum value if the attribute
00275 ** is unknown.  This makes the default VM=1-n (before it was VM=1).
00276 **
00277 ** Revision 1.7  1997/03/26 17:18:01  hewett
00278 ** Added member function to obtain a DcmTag's data dictionary reference.
00279 **
00280 ** Revision 1.6  1996/04/19 08:37:21  andreas
00281 ** correct bug with DEBUG and not DEBUG parts. It was not possible to compile
00282 ** the dcmdata library with DEBUG and programs using dcmdata without DEBUG
00283 ** (and vice versa)
00284 **
00285 ** Revision 1.5  1996/03/13 14:48:32  hewett
00286 ** Added useful VR access methods.
00287 **
00288 ** Revision 1.4  1996/03/12 15:32:49  hewett
00289 ** Added constructor with parameter to explicity set the VR.
00290 **
00291 ** Revision 1.3  1996/01/05 13:23:01  andreas
00292 ** - changed to support new streaming facilities
00293 ** - more cleanups
00294 ** - merged read / write methods for block and file transfer
00295 **
00296 ** Revision 1.2  1995/11/23 16:38:03  hewett
00297 ** Updated for loadable data dictionary + some cleanup (more to do).
00298 **
00299 */


Generated on 26 Apr 2005 for OFFIS DCMTK Version 3.5.3 by Doxygen 1.4.2