]> Creatis software - gdcm.git/blob - src/gdcmDictEntry.h
* Add a RefCounter object that is deleted only when it's reference count is
[gdcm.git] / src / gdcmDictEntry.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDictEntry.h,v $
5   Language:  C++
6   Date:      $Date: 2005/10/20 15:24:08 $
7   Version:   $Revision: 1.39 $
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 public:
41    gdcmTypeMacro(DictEntry);
42
43 public:
44    static DictEntry *New(uint16_t group, uint16_t elem,
45              VRKey const &vr       = GDCM_VRUNKNOWN,
46              TagName const &vm     = GDCM_UNKNOWN,
47              TagName const &name   = GDCM_UNKNOWN);
48
49 // Print
50    void Print(std::ostream &os = std::cout, std::string const &indent = "");
51
52 // Content of DictEntry
53    virtual void SetVR(VRKey const &vr);
54    virtual void SetVM(TagName const &vm);
55    /// \brief   returns the VM field of the current DictEntry
56    /// @return  The 'Value Multiplicity' field
57    const TagName &GetVM() const { return VM; } 
58
59    /// \brief tells if the V(alue) M(ultiplicity) is known (?!)
60    /// @return 
61    bool IsVMUnknown() const { return VM == GDCM_UNKNOWN; }
62
63    /// \brief  Returns the Dicom Name of the current DictEntry
64    ///         e.g. "Patient Name" for Dicom Tag (0x0010, 0x0010) 
65    /// @return the Dicom Name
66    const TagName &GetName() const { return Name; } 
67
68 protected:
69    DictEntry(uint16_t group, uint16_t elem,
70              VRKey const &vr       = GDCM_VRUNKNOWN,
71              TagName const &vm     = GDCM_UNKNOWN,
72              TagName const &name   = GDCM_UNKNOWN);
73
74 private:
75    /// \brief Value Multiplicity (e.g. "1", "1-n", "6")
76    TagName VM; 
77
78    /// e.g. "Patient's Name"                    
79    TagName Name;      
80 };
81 } // end namespace gdcm
82 //-----------------------------------------------------------------------------
83 #endif