]> Creatis software - gdcm.git/blob - src/gdcmDictEntry.h
* src/*.cxx *.h Reference to License.htm fixed to License.html.
[gdcm.git] / src / gdcmDictEntry.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDictEntry.h,v $
5   Language:  C++
6   Date:      $Date: 2004/09/27 08:39:06 $
7   Version:   $Revision: 1.16 $
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 "gdcmCommon.h"
23
24 //-----------------------------------------------------------------------------
25 /*
26  * \defgroup gdcmDictEntry
27  * \brief
28  * the gdcmDictEntry in an element contained by the gdcmDict.
29  * It contains :
30  *  - the key referenced by the DICOM norm or the constructor (for private keys)
31  *  - the corresponding name in english (it's equivalent to a label)
32  *  - the owner group
33  *  - etc.
34  */
35 class GDCM_EXPORT gdcmDictEntry 
36 {
37 public:
38    gdcmDictEntry(uint16_t group, 
39                  uint16_t element,
40                  std::string vr     = "Unknown",
41                  std::string fourth = "Unknown",
42                  std::string name   = "Unknown");
43
44    static gdcmTagKey TranslateToKey(uint16_t group, uint16_t element);
45
46    void SetVR(std::string);
47
48    /// \brief tells if the V(alue) R(epresentation) is known (?!)
49    /// @return 
50    bool IsVRUnknown() {return vr == "??"; }
51
52    /// \brief  Returns the Dicom Group Number of the current gdcmDictEntry
53    /// @return the Dicom Group Number
54    uint16_t GetGroup() { return group; }
55   
56    /// \brief  Returns the Dicom Element Number of the current gdcmDictEntry
57    /// @return the Dicom Element Number
58    uint16_t GetElement() { return element; }
59  
60    /// \brief  Returns the Dicom Value Representation of the current
61    ///         gdcmDictEntry
62    /// @return the Dicom Value Representation
63    std::string GetVR() { return vr; }
64  
65    /// \brief   sets the key of the current gdcmDictEntry
66    /// @param k New key to be set.
67    void SetKey(std::string k)  { key = k; }
68  
69    /// \brief   returns the Fourth field of the current gdcmDictEntry
70    /// \warning NOT part of the Dicom Standard.
71    ///          May be REMOVED an any time. NEVER use it.
72    /// @return  The Fourth field
73    std::string GetFourth(void) { return fourth; } 
74
75    /// \brief  Returns the Dicom Name of the current gdcmDictEntry
76    ///         e.g. "Patient Name" for Dicom Tag (0x0010, 0x0010) 
77    /// @return the Dicom Name
78    std::string GetName(void) { return name; } 
79  
80    /// \brief  Gets the key of the current gdcmDictEntry
81    /// @return the key.
82    std::string GetKey(void) { return key; }
83
84 private:
85    /// \todo FIXME 
86    ///        where are the group and element used except from building up
87    ///        a gdcmTagKey. If the answer is nowhere then there is no need
88    ///        to store the group and element independently.
89    ///
90    ///        --> EVERYWHERE ! The alternate question would be :
91    ///                         What's gdcmTagKey used for ?
92    
93    /// DicomGroup number
94    uint16_t group;   // e.g. 0x0010
95
96    /// DicomElement number
97    uint16_t element; // e.g. 0x0103
98
99    /// \brief Value Representation i.e. some clue about the nature
100    ///        of the data represented e.g. "FD" short for
101    ///        "Floating Point Double" (see \ref gdcmVR)
102    std::string vr;
103
104    /**
105     * \brief AVOID using the following fourth field at all costs.
106     * 
107     *  They are at leat two good reasons for NOT using fourth:
108     *  - the main reason is that it is NOT part of the 'official'
109     *    Dicom Dictionnary.
110     *  - a second reason is that it is not defined for all the groups.
111     *  .
112     *  Still it provides some semantics as group name abbreviation that
113     *  can prove of some help when organizing things in an interface.
114     *  For the time being we keep it in gdcm but it migth be removed in
115     *  future releases it proves to be source of confusion.
116     *  Here is a small dictionary we encountered in "nature":
117     *  - CMD      Command        
118     *  - META     Meta Information 
119     *  - DIR      Directory
120     *  - ID       ???
121     *  - PAT      Patient
122     *  - ACQ      Acquisition
123     *  - REL      Related
124     *  - IMG      Image
125     *  - SDY      Study
126     *  - VIS      Visit 
127     *  - WAV      Waveform
128     *  - PRC      ???
129     *  - DEV      Device
130     *  - NMI      Nuclear Medicine
131     *  - MED      ???
132     *  - BFS      Basic Film Session
133     *  - BFB      Basic Film Box
134     *  - BIB      Basic Image Box
135     *  - BAB
136     *  - IOB
137     *  - PJ
138     *  - PRINTER
139     *  - RT       Radio Therapy
140     *  - DVH   
141     *  - SSET
142     *  - RES      Results
143     *  - CRV      Curve
144     *  - OLY      Overlays
145     *  - PXL      Pixels
146     *  - DL       Delimiters
147     *  .
148     *
149     *  Other usefull abreviations used for Radiographic view associated with
150     *  Patient Position (0018,5100):
151     *  -  AP = Anterior/Posterior 
152     *  -  PA = Posterior/Anterior 
153     *  -  LL = Left Lateral 
154     *  -  RL = Right Lateral 
155     *  - RLD = Right Lateral Decubitus 
156     *  - LLD = Left  Lateral Decubitus 
157     *  - RLO = Right Lateral Oblique 
158     *  - LLO = Left  Lateral Oblique  
159     *  .
160     */
161    std::string fourth; 
162
163    /// e.g. "Patient's Name"                    
164    std::string name;      
165
166    /// Redundant with (group, element) but we add it on efficiency purposes. 
167    gdcmTagKey  key;
168 };
169
170 //-----------------------------------------------------------------------------
171 #endif