]> Creatis software - gdcm.git/blob - src/gdcmDicomEntry.h
Fix mistypings
[gdcm.git] / src / gdcmDicomEntry.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDicomEntry.h,v $
5   Language:  C++
6   Date:      $Date: 2007/09/17 12:21:56 $
7   Version:   $Revision: 1.14 $
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 _GDCMDICOMENTRY_H_
20 #define _GDCMDICOMENTRY_H_
21
22 #include "gdcmCommon.h"
23 #include "gdcmRefCounter.h"
24 #include "gdcmVRKey.h"
25 #include "gdcmTagKey.h"
26
27 namespace GDCM_NAME_SPACE
28 {
29 //-----------------------------------------------------------------------------
30 /**
31  * \brief
32  * a DicomEntry is an element contained by the Dict.
33  * It contains :
34  *  - the key referenced by the DICOM norm or the manufacturer(for private keys)
35  *    i.e. 
36  *    - - the Group number
37  *    - - the Element number
38  *  - the VR (Value Representation)
39  *  - the VM (Value Multiplicity)
40  *  - the corresponding name in english
41  */
42 class GDCM_EXPORT DicomEntry : public RefCounter
43 {
44    gdcmTypeMacro(DicomEntry);
45
46 public:
47 // Print
48    void Print(std::ostream &os = std::cout, std::string const &indent = "");
49
50    /// \brief  Returns the Dicom Group Number
51    /// @return the Dicom Group Number
52    const uint16_t &GetGroup() const { return Tag[0]; }
53
54    /// \brief  Returns the Dicom Element Number
55    /// @return the Dicom Element Number
56    const uint16_t &GetElement() const { return Tag[1]; }
57
58    /// \brief  Returns the Dicom Tag Key
59    /// @return the Dicom Tag Key
60    const TagKey &GetKey() const { return Tag; }
61    
62    /// \brief  Set the Dicom Value Representation 
63    /// \param vr the Dicom Value Representation
64    virtual void SetVR(VRKey const &vr) { VR = vr; }
65    /// \brief  Returns the Dicom Value Representation 
66    /// @return the Dicom Value Representation
67    const VRKey &GetVR() const { return VR; }
68    /// \brief tells if the V(alue) R(epresentation) is known (?!)
69    /// @return 
70    bool IsVRUnknown() const { return VR == GDCM_VRUNKNOWN; }
71
72    const TagKey &GetKey() const { return Tag; }
73
74 // Key creation
75    static TagKey TranslateToKey(uint16_t group, uint16_t elem)
76                                 { return TagKey(group,elem); }
77
78 protected:
79    DicomEntry(const uint16_t &group,const uint16_t &elt,
80               const VRKey &vr = GDCM_VRUNKNOWN);
81    ~DicomEntry();
82
83 private:
84    /// Dicom  TagKey. Contains Dicom Group number and Dicom Element number
85    TagKey Tag;
86
87    /// \brief Value Representation i.e. some clue about the nature
88    ///        of the data represented e.g. 
89    ///        - "FD" short for "Floating Point Double"(see  VR)
90    ///        - "PN" short for "Person Name"       
91    VRKey VR;
92 };
93 } // end namespace gdcm
94 //-----------------------------------------------------------------------------
95 #endif