#ifndef __creaImageIOTreeAttributeDescriptor_h_INCLUDED__ #define __creaImageIOTreeAttributeDescriptor_h_INCLUDED__ #include //#include namespace creaImageIO { namespace tree { //===================================================================== /// Descriptor of an attribute of a node of a tree (name, dicom group/element) class AttributeDescriptor { public: /// Flags /// The attribute is hidden (not visible to user) static const unsigned int HIDDEN; /// The attribute enters in unique identifier constitution (KEY) static const unsigned int KEY; /// The attribute enters in label constitution (for printing) static const unsigned int LABEL; /// Default ctor AttributeDescriptor() : mKey(""), mName(""), mGroup(0), mElement(0), mFlags(0) { } // Ctor with key and flags // If the key is of the form "0020|000E" // (Two hex short separated by a pipe at 5th position) // it is interpreted as a Dicom Tag // The user name is retreived from dicom dictionnary // and the group and elem are filled // Else the name is set to the key AttributeDescriptor(const std::string& key, unsigned int flags = 0); /// Returns the name of the attribute const std::string& GetName() const { return mName; } /// Returns the DICOM group code of the attribute unsigned short GetGroup() const { return mGroup; } /// Returns the DICOM element code of the attribute unsigned short GetElement() const { return mElement; } /// Returns the flags of the attribute unsigned int GetFlags() const { return mFlags; } private: std::string mKey; std::string mName; unsigned short mGroup; unsigned short mElement; unsigned int mFlags; }; // EO class AttributeDescriptor //===================================================================== } // EO namespace tree } // EO namespace creaImageIO /* //===================================================================== inline std::ostream& operator<<(std::ostream& s, const creaImageIO::tree::AttributeDescriptor& d) { s << "[" << d.key << ":" << d.name << "]"; return s; } //===================================================================== */ #endif // #ifndef __creaImageIOTreeAttributeDescriptor_h_INCLUDED__