]> Creatis software - gdcm.git/blob - src/gdcmDictEntry.h
* Fix compilation error for the Python part
[gdcm.git] / src / gdcmDictEntry.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDictEntry.h,v $
5   Language:  C++
6   Date:      $Date: 2005/10/21 11:50:04 $
7   Version:   $Revision: 1.41 $
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 "gdcmDicomEntry.h"
23
24 namespace gdcm 
25 {
26 //-----------------------------------------------------------------------------
27 /**
28  * \brief
29  * the DictEntry in an element contained by the Dict.
30  * It contains :
31  *  - the key referenced by the DICOM norm or the constructor (for private keys)
32  *    i.e. the Group number
33  *         the Element number
34  *  - the VR (Value Representation)
35  *  - the VM (Value Multplicity)
36  *  - the corresponding name in english
37  */
38 class GDCM_EXPORT DictEntry : public DicomEntry
39 {
40    gdcmTypeMacro(DictEntry)
41
42 public:
43    static DictEntry *New(uint16_t group, uint16_t elem,
44              VRKey const &vr       = GDCM_VRUNKNOWN,
45              TagName const &vm     = GDCM_UNKNOWN,
46              TagName const &name   = GDCM_UNKNOWN);
47
48 // Print
49    void Print(std::ostream &os = std::cout, std::string const &indent = "");
50
51 // Content of DictEntry
52    virtual void SetVR(VRKey const &vr);
53    virtual void SetVM(TagName const &vm);
54    /// \brief   returns the VM field of the current DictEntry
55    /// @return  The 'Value Multiplicity' field
56    const TagName &GetVM() const { return VM; } 
57
58    /// \brief tells if the V(alue) M(ultiplicity) is known (?!)
59    /// @return 
60    bool IsVMUnknown() const { return VM == GDCM_UNKNOWN; }
61
62    /// \brief  Returns the Dicom Name of the current DictEntry
63    ///         e.g. "Patient Name" for Dicom Tag (0x0010, 0x0010) 
64    /// @return the Dicom Name
65    const TagName &GetName() const { return Name; } 
66
67 protected:
68    DictEntry(uint16_t group, uint16_t elem,
69              VRKey const &vr       = GDCM_VRUNKNOWN,
70              TagName const &vm     = GDCM_UNKNOWN,
71              TagName const &name   = GDCM_UNKNOWN);
72
73 private:
74    /// \brief Value Multiplicity (e.g. "1", "1-n", "6")
75    TagName VM; 
76
77    /// e.g. "Patient's Name"                    
78    TagName Name;      
79 };
80 } // end namespace gdcm
81 //-----------------------------------------------------------------------------
82 #endif