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;
27 /// The attribute can be edited
28 static const unsigned int EDITABLE;
31 /// The attribute is of numeric type
32 static const int NUMBER=1;
33 /// The attribute is of string type
34 static const int STRING=2;
35 /// The attribute's type is unknown
36 static const int UNKNOWN=0;
40 : mKey(""), mName(""), mGroup(0), mElement(0), mFlags(0)
43 /// Ctor with all explicitely
44 AttributeDescriptor(const std::string& key,
45 const std::string& name,
47 unsigned short element,
49 : mKey(key), mName(name), mGroup(group), mElement(element),
54 // Ctor with key, name and flags
55 AttributeDescriptor(const std::string& key,
56 const std::string& name,
57 unsigned int flags = 0);
58 // Ctor with dicom group, elem and flags
59 // The key is built as 'Dgroup_elem'
60 // The user name is retreived from dicom dictionnary
61 AttributeDescriptor(unsigned short group,
62 unsigned short element,
63 unsigned int flags = 0);
64 /// Returns the key of the attribute
65 const std::string& GetKey() const { return mKey; }
66 /// Returns the name of the attribute
67 const std::string& GetName() const { return mName; }
68 /// Returns the DICOM group code of the attribute
69 unsigned short GetGroup() const { return mGroup; }
70 /// Returns the DICOM element code of the attribute
71 unsigned short GetElement() const { return mElement; }
72 /// Returns the flags of the attribute
73 unsigned int GetFlags() const { return mFlags; }
75 /// Extracts group and element from a key of the form "Dgroup_elem"
76 static void GetDicomGroupElementFromKey(const std::string& key,
77 unsigned short& group,
78 unsigned short& elem);
80 /// Replace simple quote by double quotes
81 /// Cut string at NULL chars
82 void CleanName(std::string& str) const;
83 ///Decodes the type of attribute into the existing ones
84 void DecodeType(unsigned int& type) const;
86 bool isDateEntry() const;
87 bool isTimeEntry() const;
92 unsigned short mGroup;
93 unsigned short mElement;
96 // EO class AttributeDescriptor
97 //=====================================================================
101 } // EO namespace tree
103 } // EO namespace creaImageIO
109 #endif // #ifndef __creaImageIOTreeAttributeDescriptor_h_INCLUDED__