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