1 #ifndef __creaImageIOTree_h_INCLUDED__
2 #define __creaImageIOTree_h_INCLUDED__
4 #include <creaImageIOTreeNode.h>
14 //=====================================================================
15 /// Abstract class to store user data on a Tree
19 virtual ~TreeData() {}
21 //=====================================================================
23 //=====================================================================
24 /// An attributed Tree structure
27 class Tree : public Node
32 /// Virtual destructor
35 /// Returns the descriptor of the tree
37 /// Returns the tree to which the node belongs
38 virtual Tree* GetTree() { return this; }
39 /// Returns the tree to which the node belongs
40 virtual const Tree* GetTree() const { return this; }
41 /// Returns the level of the node in the tree
42 virtual int GetLevel() const { return 0; }
44 /// Returns the Descriptor of the tree (const)
45 const Descriptor& GetDescriptor() const { return mDescriptor; }
46 /// Returns the descriptor of the tree
47 Descriptor& GetDescriptor() { return mDescriptor; }
49 /// Returns the number of levels of the tree
50 unsigned int GetNumberOfLevels()
51 { return GetDescriptor().GetNumberOfLevels(); }
53 /// Returns the LevelDescriptor of a given level (const ref)
54 const LevelDescriptor& GetLevelDescriptor(int level) const
55 { return GetDescriptor().GetLevelDescriptor(level); }
57 /// Returns the AttributeDescriptorList of a given level (const ref)
58 /// type = 0 all attributes
59 /// type = 1 without ID and PATIENT_ID
60 const LevelDescriptor::AttributeDescriptorListType&
61 GetAttributeDescriptorList(int level, int type = 0) const
62 { return GetDescriptor().GetAttributeDescriptorList(level, type); }
64 virtual void Print() const;
67 /// Copy descriptor list without ID tag
68 void CopyAttributeDescriptorList(int level)
70 GetDescriptor().CopyAttributeDescriptorList(level);
73 /// Test if this attribute is available in this tree description
74 const std::string isAttributeExist(const std::string i_attr)
76 return mDescriptor.isExist(i_attr);
80 Descriptor mDescriptor;
84 //=====================================================================
86 } // EO namespace tree
88 } // EO namespace creaImageIO