X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOTreeAttributeDescriptor.h;h=68f0da965af186c68791c86404a7b812ae6fcf65;hb=b029354f54449e058d14c671e7155e65b4086de6;hp=1a68bfa1f3e69c5593870cb86b5bda647516c8c9;hpb=bae4df8a3e1ea669400c3a6c44ef4aa8d90fa1ed;p=creaImageIO.git diff --git a/src2/creaImageIOTreeAttributeDescriptor.h b/src2/creaImageIOTreeAttributeDescriptor.h index 1a68bfa..68f0da9 100644 --- a/src2/creaImageIOTreeAttributeDescriptor.h +++ b/src2/creaImageIOTreeAttributeDescriptor.h @@ -9,18 +9,31 @@ namespace creaImageIO namespace tree { + /** + * \ingroup Tree + */ //===================================================================== - /// Descriptor of an attribute of a node of a tree (name, dicom group/element) + /// 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 PRIVATE; - /// The attribute enters in unique identifier constitution (KEY) - static const unsigned int KEY; + /// The attribute enters in unique identifier constitution + static const unsigned int IDENTIFIER; /// The attribute enters in label constitution (for printing) static const unsigned int LABEL; + /// The attribute can be edited + static const unsigned int EDITABLE; + + /// Types + /// The attribute is of numeric type + static const int NUMBER=1; + /// The attribute is of string type + static const int STRING=2; + /// The attribute's type is unknown + static const int UNKNOWN=0; /// Default ctor AttributeDescriptor() @@ -58,7 +71,7 @@ namespace creaImageIO unsigned short GetElement() const { return mElement; } /// Returns the flags of the attribute unsigned int GetFlags() const { return mFlags; } - + /// Extracts group and element from a key of the form "Dgroup_elem" static void GetDicomGroupElementFromKey(const std::string& key, unsigned short& group, @@ -67,6 +80,12 @@ namespace creaImageIO /// Replace simple quote by double quotes /// Cut string at NULL chars void CleanName(std::string& str) const; + ///Decodes the type of attribute into the existing ones + void DecodeType(unsigned int& type) const; + + bool isDateEntry() const; + bool isTimeEntry() const; + private: std::string mKey; std::string mName; @@ -84,16 +103,7 @@ namespace creaImageIO } // 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__