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