dcmdata/include/dcmtk/dcmdata/dctag.h

00001 /*
00002  *
00003  *  Copyright (C) 1994-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:  dcmdata
00015  *
00016  *  Author:  Gerd Ehlers, Andrew Hewett
00017  *
00018  *  Purpose: Definition of the class DcmTag
00019  *
00020  *  Last Update:      $Author: joergr $
00021  *  Update Date:      $Date: 2010-10-14 13:15:42 $
00022  *  CVS/RCS Revision: $Revision: 1.24 $
00023  *  Status:           $State: Exp $
00024  *
00025  *  CVS/RCS Log at end of file
00026  *
00027  */
00028 
00029 #ifndef DCTAG_H
00030 #define DCTAG_H
00031 
00032 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
00033 #include "dcmtk/ofstd/ofcond.h"
00034 #include "dcmtk/dcmdata/dctagkey.h"
00035 #include "dcmtk/dcmdata/dcvr.h"
00036 
00038 #define DcmTag_ERROR_TagName    "Unknown Tag & Data"
00039 
00040 
00050 class DcmTag: public DcmTagKey
00051 {
00052 public:
00054     DcmTag();
00055 
00062     DcmTag(const DcmTagKey& akey);
00063 
00071     DcmTag(Uint16 g, Uint16 e);
00072 
00079     DcmTag(const DcmTagKey& akey, const DcmVR& avr);
00080 
00088     DcmTag(Uint16 g, Uint16 e, const DcmVR& avr);
00089 
00091     DcmTag(const DcmTag& tag);
00092 
00094     ~DcmTag();
00095 
00097     DcmTag& operator=(const DcmTag& tag);
00098 
00100     DcmVR setVR(const DcmVR& avr);
00101 
00103     DcmVR getVR() const { return vr; }
00104 
00106     DcmEVR getEVR() const { return vr.getEVR(); }
00107 
00109     const char* getVRName() const { return vr.getVRName(); }
00110 
00114     Uint16 getGTag() const { return getGroup(); }
00115 
00119     Uint16 getETag() const { return getElement(); }
00120 
00124     DcmTagKey getXTag() const
00125     {
00126       return * OFstatic_cast(const DcmTagKey *, this);
00127     }
00128 
00136     const char* getTagName();
00137 
00142     const char* getPrivateCreator() const;
00143 
00149     void setPrivateCreator(const char *privCreator);
00150 
00156     void lookupVRinDictionary();
00157 
00162     OFBool isSignable() const;
00163 
00166     OFBool isUnknownVR() const;
00167 
00169     OFCondition error() const { return errorFlag; }
00170 
00171     // --- static helper functions ---
00172 
00184     static OFCondition findTagFromName(const char *name,
00185                                        DcmTag &value);
00186 private:
00187 
00191     void updateTagName(const char *c);
00192 
00196     void updatePrivateCreator(const char *c);
00197 
00199     DcmVR vr;
00200 
00202     char *tagName;
00203 
00205     char *privateCreator;
00206 
00208     OFCondition errorFlag;
00209 
00210 };
00211 
00212 
00213 // *** global constants ********************************
00214 
00215 
00216 #define ItemTag (DcmTag(DCM_Item))
00217 #define InternalUseTag (DcmTag(DcmTagKey(0xfffe, 0xfffe)))
00218 
00219 
00220 #endif /* !DCTAG_H */
00221 
00222 /*
00223 ** CVS/RCS Log:
00224 ** $Log: dctag.h,v $
00225 ** Revision 1.24  2010-10-14 13:15:42  joergr
00226 ** Updated copyright header. Added reference to COPYRIGHT file.
00227 **
00228 ** Revision 1.23  2010-08-09 13:02:57  joergr
00229 ** Updated data dictionary to 2009 edition of the DICOM standard. From now on,
00230 ** the official "keyword" is used for the attribute name which results in a
00231 ** number of minor changes (e.g. "PatientsName" is now called "PatientName").
00232 **
00233 ** Revision 1.22  2009-11-04 09:58:07  uli
00234 ** Switched to logging mechanism provided by the "new" oflog module
00235 **
00236 ** Revision 1.21  2005-12-08 16:28:44  meichel
00237 ** Changed include path schema for all DCMTK header files
00238 **
00239 ** Revision 1.20  2003/08/14 09:00:56  meichel
00240 ** Adapted type casts to new-style typecast operators defined in ofcast.h
00241 **
00242 ** Revision 1.19  2002/07/23 14:21:27  meichel
00243 ** Added support for private tag data dictionaries to dcmdata
00244 **
00245 ** Revision 1.18  2002/05/24 09:49:13  joergr
00246 ** Renamed some parameters/variables to avoid ambiguities.
00247 **
00248 ** Revision 1.17  2002/04/30 13:12:12  joergr
00249 ** Added static helper function to convert strings (tag names or group/element
00250 ** numbers) to DICOM tag objects.
00251 **
00252 ** Revision 1.16  2001/11/19 15:23:10  meichel
00253 ** Cleaned up signature code to avoid some gcc warnings.
00254 **
00255 ** Revision 1.15  2001/11/16 15:54:40  meichel
00256 ** Adapted digital signature code to final text of supplement 41.
00257 **
00258 ** Revision 1.14  2001/09/25 17:19:29  meichel
00259 ** Adapted dcmdata to class OFCondition
00260 **
00261 ** Revision 1.13  2001/06/01 15:48:45  meichel
00262 ** Updated copyright header
00263 **
00264 ** Revision 1.12  2000/04/14 16:00:58  meichel
00265 ** Restructured class DcmTag. Instances don't keep a permanent pointer
00266 **   to a data dictionary entry anymore. Required for MT applications.
00267 **
00268 ** Revision 1.11  2000/03/08 16:26:19  meichel
00269 ** Updated copyright header.
00270 **
00271 ** Revision 1.10  1999/03/31 09:24:49  meichel
00272 ** Updated copyright header in module dcmdata
00273 **
00274 ** Revision 1.9  1998/07/15 15:48:54  joergr
00275 ** Removed several compiler warnings reported by gcc 2.8.1 with
00276 ** additional options, e.g. missing copy constructors and assignment
00277 ** operators, initialization of member variables in the body of a
00278 ** constructor instead of the member initialization list, hiding of
00279 ** methods by use of identical names, uninitialized member variables,
00280 ** missing const declaration of char pointers. Replaced tabs by spaces.
00281 **
00282 ** Revision 1.8  1997/05/06 09:26:44  hewett
00283 ** The DcmTag::getVMMax() method now returns a maximum value if the attribute
00284 ** is unknown.  This makes the default VM=1-n (before it was VM=1).
00285 **
00286 ** Revision 1.7  1997/03/26 17:18:01  hewett
00287 ** Added member function to obtain a DcmTag's data dictionary reference.
00288 **
00289 ** Revision 1.6  1996/04/19 08:37:21  andreas
00290 ** correct bug with DEBUG and not DEBUG parts. It was not possible to compile
00291 ** the dcmdata library with DEBUG and programs using dcmdata without DEBUG
00292 ** (and vice versa)
00293 **
00294 ** Revision 1.5  1996/03/13 14:48:32  hewett
00295 ** Added useful VR access methods.
00296 **
00297 ** Revision 1.4  1996/03/12 15:32:49  hewett
00298 ** Added constructor with parameter to explicity set the VR.
00299 **
00300 ** Revision 1.3  1996/01/05 13:23:01  andreas
00301 ** - changed to support new streaming facilities
00302 ** - more cleanups
00303 ** - merged read / write methods for block and file transfer
00304 **
00305 ** Revision 1.2  1995/11/23 16:38:03  hewett
00306 ** Updated for loadable data dictionary + some cleanup (more to do).
00307 **
00308 */


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