1 #ifndef __creaImageIOTreeAttributeDescriptor_h_INCLUDED__
2 #define __creaImageIOTreeAttributeDescriptor_h_INCLUDED__
12 //=====================================================================
13 /// Descriptor of an attribute of a node of a tree (name, dicom group/element)
14 class AttributeDescriptor
18 /// The attribute is hidden (not visible to user)
19 static const unsigned int HIDDEN;
20 /// The attribute enters in unique identifier constitution (KEY)
21 static const unsigned int KEY;
22 /// The attribute enters in label constitution (for printing)
23 static const unsigned int LABEL;
27 : mKey(""), mName(""), mGroup(0), mElement(0), mFlags(0)
30 // Ctor with key and flags
31 // If the key is of the form "0020|000E"
32 // (Two hex short separated by a pipe at 5th position)
33 // it is interpreted as a Dicom Tag
34 // The user name is retreived from dicom dictionnary
35 // and the group and elem are filled
36 // Else the name is set to the key
37 AttributeDescriptor(const std::string& key,
38 unsigned int flags = 0);
39 /// Returns the name of the attribute
40 const std::string& GetName() const { return mName; }
41 /// Returns the DICOM group code of the attribute
42 unsigned short GetGroup() const { return mGroup; }
43 /// Returns the DICOM element code of the attribute
44 unsigned short GetElement() const { return mElement; }
45 /// Returns the flags of the attribute
46 unsigned int GetFlags() const { return mFlags; }
51 unsigned short mGroup;
52 unsigned short mElement;
55 // EO class AttributeDescriptor
56 //=====================================================================
60 } // EO namespace tree
62 } // EO namespace creaImageIO
66 //=====================================================================
67 inline std::ostream& operator<<(std::ostream& s,
68 const creaImageIO::tree::AttributeDescriptor& d)
70 s << "[" << d.key << ":" << d.name << "]";
73 //=====================================================================
77 #endif // #ifndef __creaImageIOTreeAttributeDescriptor_h_INCLUDED__