]> Creatis software - gdcm.git/blob - src/gdcmDictEntry.h
Removal out of the Dicom Dictionary of non dicom 'fourth' field
[gdcm.git] / src / gdcmDictEntry.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDictEntry.h,v $
5   Language:  C++
6   Date:      $Date: 2005/01/07 12:29:17 $
7   Version:   $Revision: 1.25 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*/
18
19 #ifndef GDCMDICTENTRY_H
20 #define GDCMDICTENTRY_H
21
22 #include "gdcmBase.h"
23
24 namespace gdcm 
25 {
26
27 //-----------------------------------------------------------------------------
28 /*
29  * \defgroup DictEntry
30  * \brief
31  * the DictEntry in an element contained by the Dict.
32  * It contains :
33  *  - the key referenced by the DICOM norm or the constructor (for private keys)
34  *  - the corresponding name in english (it's equivalent to a label)
35  *  - the owner group
36  *  - etc.
37  */
38 class GDCM_EXPORT DictEntry : public Base
39 {
40 public:
41    DictEntry(uint16_t group, 
42              uint16_t element,
43              TagName const &vr     = GDCM_UNKNOWN,
44              TagName const &vm     = GDCM_UNKNOWN,
45              TagName const &name   = GDCM_UNKNOWN);
46
47    static TagKey TranslateToKey(uint16_t group, uint16_t element);
48
49    void SetVR(TagName const &vr);
50
51    /// \brief tells if the V(alue) R(epresentation) is known (?!)
52    /// @return 
53    bool IsVRUnknown() { return VR == GDCM_UNKNOWN; }
54
55    /// \brief  Returns the Dicom Group Number of the current DictEntry
56    /// @return the Dicom Group Number
57    uint16_t GetGroup() { return Group; }
58   
59    /// \brief  Returns the Dicom Element Number of the current DictEntry
60    /// @return the Dicom Element Number
61    uint16_t GetElement() { return Element; }
62  
63    /// \brief  Returns the Dicom Value Representation of the current
64    ///         DictEntry
65    /// @return the Dicom Value Representation
66    const TagName &GetVR() const { return VR; }
67  
68    /// \brief   sets the key of the current DictEntry
69    /// @param k New key to be set.
70    void SetKey(TagName const &k)  { Key = k; }
71  
72    /// \brief   returns the VM field of the current DictEntry
73    /// @return  The 'Value Multiplicity' field
74    const TagName &GetVM() const { return VM; } 
75
76    /// \brief  Returns the Dicom Name of the current DictEntry
77    ///         e.g. "Patient Name" for Dicom Tag (0x0010, 0x0010) 
78    /// @return the Dicom Name
79    const TagName &GetName() const { return Name; } 
80  
81    /// \brief  Gets the key of the current DictEntry
82    /// @return the key.
83    const TagName &GetKey() const { return Key; }
84
85 private:
86    /// \todo FIXME 
87    ///        where are the group and element used except from building up
88    ///        a TagKey. If the answer is nowhere then there is no need
89    ///        to store the group and element independently.
90    ///
91    ///        --> EVERYWHERE ! The alternate question would be :
92    ///                         What's TagKey used for ?
93    
94    /// DicomGroup number
95    uint16_t Group;   // e.g. 0x0010
96
97    /// DicomElement number
98    uint16_t Element; // e.g. 0x0103
99
100    /// \brief Value Representation i.e. some clue about the nature
101    ///        of the data represented e.g. "FD" short for
102    ///        "Floating Point Double" (see \ref VR)
103    TagName VR;
104
105    /*
106     *  .
107     *  Formerly 'Group name abbreviations'
108     *  Here is a small dictionary we encountered in "nature":
109     *  - CMD      Command        
110     *  - META     Meta Information 
111     *  - DIR      Directory
112     *  - ID       ???
113     *  - PAT      Patient
114     *  - ACQ      Acquisition
115     *  - REL      Related
116     *  - IMG      Image
117     *  - SDY      Study
118     *  - VIS      Visit 
119     *  - WAV      Waveform
120     *  - PRC      ???
121     *  - DEV      Device
122     *  - NMI      Nuclear Medicine
123     *  - MED      ???
124     *  - BFS      Basic Film Session
125     *  - BFB      Basic Film Box
126     *  - BIB      Basic Image Box
127     *  - BAB
128     *  - IOB
129     *  - PJ
130     *  - PRINTER
131     *  - RT       Radio Therapy
132     *  - DVH   
133     *  - SSET
134     *  - RES      Results
135     *  - CRV      Curve
136     *  - OLY      Overlays
137     *  - PXL      Pixels
138     *  - DL       Delimiters
139     *  .
140     *
141     *  Other usefull abreviations used for Radiographic view associated with
142     *  Patient Position (0018,5100):
143     *  -  AP = Anterior/Posterior 
144     *  -  PA = Posterior/Anterior 
145     *  -  LL = Left Lateral 
146     *  -  RL = Right Lateral 
147     *  - RLD = Right Lateral Decubitus 
148     *  - LLD = Left  Lateral Decubitus 
149     *  - RLO = Right Lateral Oblique 
150     *  - LLO = Left  Lateral Oblique  
151     *  .
152     */
153   /// \brief Value Multiplicity (e.g. "1", "1-n", "6")
154    TagName VM; 
155
156    /// e.g. "Patient's Name"                    
157    TagName Name;      
158
159    /// Redundant with (group, element) but we add it for efficiency purpose.
160    TagKey  Key;
161 };
162 } // end namespace gdcm
163 //-----------------------------------------------------------------------------
164 #endif