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;
30 : mKey(""), mName(""), mGroup(0), mElement(0), mFlags(0)
33 /// Ctor with all explicitely
34 AttributeDescriptor(const std::string& key,
35 const std::string& name,
37 unsigned short element,
39 : mKey(key), mName(name), mGroup(group), mElement(element),
44 // Ctor with key, name and flags
45 AttributeDescriptor(const std::string& key,
46 const std::string& name,
47 unsigned int flags = 0);
48 // Ctor with dicom group, elem and flags
49 // The key is built as 'Dgroup_elem'
50 // The user name is retreived from dicom dictionnary
51 AttributeDescriptor(unsigned short group,
52 unsigned short element,
53 unsigned int flags = 0);
54 /// Returns the key of the attribute
55 const std::string& GetKey() const { return mKey; }
56 /// Returns the name of the attribute
57 const std::string& GetName() const { return mName; }
58 /// Returns the DICOM group code of the attribute
59 unsigned short GetGroup() const { return mGroup; }
60 /// Returns the DICOM element code of the attribute
61 unsigned short GetElement() const { return mElement; }
62 /// Returns the flags of the attribute
63 unsigned int GetFlags() const { return mFlags; }
65 /// Extracts group and element from a key of the form "Dgroup_elem"
66 static void GetDicomGroupElementFromKey(const std::string& key,
67 unsigned short& group,
68 unsigned short& elem);
70 /// Replace simple quote by double quotes
71 /// Cut string at NULL chars
72 void CleanName(std::string& str) const;
76 unsigned short mGroup;
77 unsigned short mElement;
80 // EO class AttributeDescriptor
81 //=====================================================================
85 } // EO namespace tree
87 } // EO namespace creaImageIO
93 #endif // #ifndef __creaImageIOTreeAttributeDescriptor_h_INCLUDED__