1 #ifndef __creaImageIOTreeAttributeDescriptor_h_INCLUDED__
2 #define __creaImageIOTreeAttributeDescriptor_h_INCLUDED__
15 //=====================================================================
16 /// Descriptor of an attribute of a node of a Tree (name, dicom group/element)
17 class AttributeDescriptor
21 /// The attribute is hidden (not visible to user)
22 static const unsigned int PRIVATE;
23 /// The attribute enters in unique identifier constitution
24 static const unsigned int IDENTIFIER;
25 /// The attribute enters in label constitution (for printing)
26 static const unsigned int LABEL;
29 /// The attribute is of numeric type
30 static const int NUMBER=1;
31 /// The attribute is of string type
32 static const int STRING=2;
33 /// The attribute's type is unknown
34 static const int UNKNOWN=0;
38 : mKey(""), mName(""), mGroup(0), mElement(0), mFlags(0)
41 /// Ctor with all explicitely
42 AttributeDescriptor(const std::string& key,
43 const std::string& name,
45 unsigned short element,
47 : mKey(key), mName(name), mGroup(group), mElement(element),
52 // Ctor with key, name and flags
53 AttributeDescriptor(const std::string& key,
54 const std::string& name,
55 unsigned int flags = 0);
56 // Ctor with dicom group, elem and flags
57 // The key is built as 'Dgroup_elem'
58 // The user name is retreived from dicom dictionnary
59 AttributeDescriptor(unsigned short group,
60 unsigned short element,
61 unsigned int flags = 0);
62 /// Returns the key of the attribute
63 const std::string& GetKey() const { return mKey; }
64 /// Returns the name of the attribute
65 const std::string& GetName() const { return mName; }
66 /// Returns the DICOM group code of the attribute
67 unsigned short GetGroup() const { return mGroup; }
68 /// Returns the DICOM element code of the attribute
69 unsigned short GetElement() const { return mElement; }
70 /// Returns the flags of the attribute
71 unsigned int GetFlags() const { return mFlags; }
73 /// Extracts group and element from a key of the form "Dgroup_elem"
74 static void GetDicomGroupElementFromKey(const std::string& key,
75 unsigned short& group,
76 unsigned short& elem);
78 /// Replace simple quote by double quotes
79 /// Cut string at NULL chars
80 void CleanName(std::string& str) const;
81 ///Decodes the type of attribute into the existing ones
82 void DecodeType(unsigned int& type) const;
87 unsigned short mGroup;
88 unsigned short mElement;
91 // EO class AttributeDescriptor
92 //=====================================================================
96 } // EO namespace tree
98 } // EO namespace creaImageIO
104 #endif // #ifndef __creaImageIOTreeAttributeDescriptor_h_INCLUDED__