1 /*=========================================================================
4 Module: $RCSfile: gdcmDictEntry.h,v $
6 Date: $Date: 2007/09/17 12:16:02 $
7 Version: $Revision: 1.47 $
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.
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.
17 =========================================================================*/
19 #ifndef _GDCMDICTENTRY_H_
20 #define _GDCMDICTENTRY_H_
22 #include "gdcmRefCounter.h"
23 #include "gdcmTagKey.h"
24 #include "gdcmVRKey.h"
26 namespace GDCM_NAME_SPACE
28 //-----------------------------------------------------------------------------
33 * the DictEntry in an element contained by the Dict.
35 * - the key referenced by the DICOM norm or the constructor (for private keys)
36 * i.e. the Group number
38 * - the VR (Value Representation)
39 * - the VM (Value Multiplicity)
40 * - the corresponding name in english
42 class GDCM_EXPORT DictEntry : public RefCounter
44 gdcmTypeMacro(DictEntry);
47 static DictEntry *New(uint16_t group, uint16_t elem,
48 VRKey const &vr = GDCM_VRUNKNOWN,
49 TagName const &vm = GDCM_UNKNOWN,
50 TagName const &name = GDCM_UNKNOWN);
53 void Print(std::ostream &os = std::cout, std::string const &indent = "");
55 /// \brief Returns the Dicom Group Number
56 /// @return the Dicom Group Number
57 const uint16_t &GetGroup() const { return Tag[0]; }
59 /// \brief Returns the Dicom Element Number
60 /// @return the Dicom Element Number
61 const uint16_t &GetElement() const { return Tag[1]; }
63 /// \brief Set the Dicom Value Representation
64 /// \param vr the Dicom Value Representation
65 virtual void SetVR(VRKey const &vr) { VR = vr; }
66 /// \brief Returns the Dicom Value Representation
67 /// @return the Dicom Value Representation
68 const VRKey &GetVR() const { return VR; }
69 /// \brief tells if the V(alue) R(epresentation) is known (?!)
71 bool IsVRUnknown() const { return VR == GDCM_VRUNKNOWN; }
73 const TagKey &GetKey() const { return Tag; }
76 static TagKey TranslateToKey(uint16_t group, uint16_t elem);
78 /// \brief returns the VM field of the current DictEntry
79 /// @return The 'Value Multiplicity' field
80 const TagName &GetVM() const { return VM; }
81 /// \brief Set the VM field of the current DictEntry
82 /// \param vm the'Value Multiplicity'
83 virtual void SetVM(TagName const &vm) { VM = vm; }
84 /// \brief tells if the V(alue) M(ultiplicity) is known (?!)
86 bool IsVMUnknown() const { return VM == GDCM_UNKNOWN; }
88 /// \brief Returns the Dicom Name of the current DictEntry
89 /// e.g. "Patient Name" for Dicom Tag (0x0010, 0x0010)
90 /// @return the Dicom Name
91 const TagName &GetName() const { return Name; }
94 DictEntry(uint16_t group, uint16_t elem,
95 VRKey const &vr = GDCM_VRUNKNOWN,
96 TagName const &vm = GDCM_UNKNOWN,
97 TagName const &name = GDCM_UNKNOWN);
102 /// Dicom TagKey. Contains Dicom Group number and Dicom Element number
105 /// \brief Value Representation i.e. some clue about the nature
106 /// of the data represented e.g.
107 /// - "FD" short for "Floating Point Double"(see VR)
108 /// - "PN" short for "Person Name"
111 /// \brief Value Multiplicity (e.g. "1", "1-n", "2-n", "6")
114 /// \brief English name of the entry (e.g. "Patient's Name")
117 } // end namespace gdcm
118 //-----------------------------------------------------------------------------