]> Creatis software - gdcm.git/blob - src/gdcmDictEntry.h
1658bb493753a40015cd8f7f5f6a36b1cd0f1ebc
[gdcm.git] / src / gdcmDictEntry.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDictEntry.h,v $
5   Language:  C++
6   Date:      $Date: 2005/01/11 15:15:38 $
7   Version:   $Revision: 1.28 $
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  * \ingroup 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  *    i.e. the Group number
35  *         the Element number
36  *  - the VR (Value Representation)
37  *  - the VM (Value Multplicity)
38  *  - the corresponding name in english
39  */
40 class GDCM_EXPORT DictEntry : public Base
41 {
42 public:
43    DictEntry(uint16_t group, 
44              uint16_t element,
45              TagName const &vr     = GDCM_UNKNOWN,
46              TagName const &vm     = GDCM_UNKNOWN,
47              TagName const &name   = GDCM_UNKNOWN);
48
49    static TagKey TranslateToKey(uint16_t group, uint16_t element);
50
51    void SetVR(TagName const &vr);
52    void SetVM(TagName const &vm);
53
54    /// \brief tells if the V(alue) R(epresentation) is known (?!)
55    /// @return 
56    bool IsVRUnknown() { return VR == GDCM_UNKNOWN; }
57
58    /// \brief tells if the V(alue) M(ultiplicity) is known (?!)
59    /// @return 
60    bool IsVMUnknown() { return VM == GDCM_UNKNOWN; }
61
62    /// \brief  Returns the Dicom Group Number of the current DictEntry
63    /// @return the Dicom Group Number
64    uint16_t GetGroup() { return Group; }
65   
66    /// \brief  Returns the Dicom Element Number of the current DictEntry
67    /// @return the Dicom Element Number
68    uint16_t GetElement() { return Element; }
69  
70    /// \brief  Returns the Dicom Value Representation of the current
71    ///         DictEntry
72    /// @return the Dicom Value Representation
73    const TagName &GetVR() const { return VR; }
74  
75    /// \brief   sets the key of the current DictEntry
76    /// @param k New key to be set.
77    void SetKey(TagName const &k)  { Key = k; }
78  
79    /// \brief   returns the VM field of the current DictEntry
80    /// @return  The 'Value Multiplicity' field
81    const TagName &GetVM() const { return VM; } 
82
83    /// \brief  Returns the Dicom Name of the current DictEntry
84    ///         e.g. "Patient Name" for Dicom Tag (0x0010, 0x0010) 
85    /// @return the Dicom Name
86    const TagName &GetName() const { return Name; } 
87  
88    /// \brief  Gets the key of the current DictEntry
89    /// @return the key.
90    const TagName &GetKey() const { return Key; }
91
92 private:
93    /// \todo FIXME 
94    ///        where are the group and element used except from building up
95    ///        a TagKey. If the answer is nowhere then there is no need
96    ///        to store the group and element independently.
97    ///
98    ///        --> EVERYWHERE ! The alternate question would be :
99    ///                         What's TagKey used for ?
100    
101    /// DicomGroup number
102    uint16_t Group;   // e.g. 0x0010
103
104    /// DicomElement number
105    uint16_t Element; // e.g. 0x0103
106
107    /// \brief Value Representation i.e. some clue about the nature
108    ///        of the data represented e.g. "FD" short for
109    ///        "Floating Point Double" (see \ref VR)
110    TagName VR;
111
112    /*
113     *  .
114     *  Formerly 'Group name abbreviations'
115     *  Here is a small dictionary we encountered in "nature":
116     *  - CMD      Command        
117     *  - META     Meta Information 
118     *  - DIR      Directory
119     *  - ID       ???
120     *  - PAT      Patient
121     *  - ACQ      Acquisition
122     *  - REL      Related
123     *  - IMG      Image
124     *  - SDY      Study
125     *  - VIS      Visit 
126     *  - WAV      Waveform
127     *  - PRC      ???
128     *  - DEV      Device
129     *  - NMI      Nuclear Medicine
130     *  - MED      ???
131     *  - BFS      Basic Film Session
132     *  - BFB      Basic Film Box
133     *  - BIB      Basic Image Box
134     *  - BAB
135     *  - IOB
136     *  - PJ
137     *  - PRINTER
138     *  - RT       Radio Therapy
139     *  - DVH   
140     *  - SSET
141     *  - RES      Results
142     *  - CRV      Curve
143     *  - OLY      Overlays
144     *  - PXL      Pixels
145     *  - DL       Delimiters
146     *  .
147     *
148     *  Other usefull abreviations used for Radiographic view associated with
149     *  Patient Position (0018,5100):
150     *  -  AP = Anterior/Posterior 
151     *  -  PA = Posterior/Anterior 
152     *  -  LL = Left Lateral 
153     *  -  RL = Right Lateral 
154     *  - RLD = Right Lateral Decubitus 
155     *  - LLD = Left  Lateral Decubitus 
156     *  - RLO = Right Lateral Oblique 
157     *  - LLO = Left  Lateral Oblique  
158     *  .
159     */
160   /// \brief Value Multiplicity (e.g. "1", "1-n", "6")
161    TagName VM; 
162
163    /// e.g. "Patient's Name"                    
164    TagName Name;      
165
166    /// Redundant with (group, element) but we add it for efficiency purpose.
167    TagKey  Key;
168 };
169 } // end namespace gdcm
170 //-----------------------------------------------------------------------------
171 #endif