creaImageIOTreeAttributeDescriptor.h

Go to the documentation of this file.
00001 #ifndef __creaImageIOTreeAttributeDescriptor_h_INCLUDED__
00002 #define __creaImageIOTreeAttributeDescriptor_h_INCLUDED__
00003 
00004 #include <string>
00005 //#include <iostream>
00006 
00007 namespace creaImageIO
00008 {
00009 
00010   namespace tree
00011   {
00015     //=====================================================================
00017     class AttributeDescriptor
00018     {    
00019     public:
00022       static const unsigned int PRIVATE;
00024       static const unsigned int IDENTIFIER;
00026       static const unsigned int LABEL;
00028       static const unsigned int EDITABLE;
00029 
00032       static const int NUMBER=1;
00034       static const int STRING=2;
00036       static const int UNKNOWN=0;
00037 
00039       AttributeDescriptor()
00040         : mKey(""), mName(""), mGroup(0), mElement(0), mFlags(0)
00041       {
00042       }
00044       AttributeDescriptor(const std::string& key,
00045                           const std::string& name,
00046                           unsigned short group,
00047                           unsigned short element,
00048                           unsigned int flags)
00049         : mKey(key), mName(name), mGroup(group), mElement(element), 
00050           mFlags(flags)
00051       {
00052       }
00053 
00054       // Ctor with key, name and flags
00055       AttributeDescriptor(const std::string& key,
00056                           const std::string& name,
00057                           unsigned int flags = 0);
00058       // Ctor with dicom group, elem and flags
00059       // The key is built as 'Dgroup_elem'
00060       // The user name is retreived from dicom dictionnary
00061       AttributeDescriptor(unsigned short group,
00062                           unsigned short element,
00063                           unsigned int flags = 0);
00065       const std::string& GetKey() const { return mKey; }
00067       const std::string& GetName() const { return mName; }
00069       unsigned short GetGroup() const { return mGroup; }
00071       unsigned short GetElement() const { return mElement; }
00073       unsigned int GetFlags() const { return mFlags; }
00074           
00076       static void GetDicomGroupElementFromKey(const std::string& key,
00077                                               unsigned short& group,
00078                                               unsigned short& elem);
00082       void CleanName(std::string& str) const;
00084           void DecodeType(unsigned int& type) const;
00085 
00086           bool isDateEntry() const;
00087           bool isTimeEntry() const;
00088 
00089     private:
00090       std::string mKey;
00091       std::string mName;
00092       unsigned short mGroup;
00093       unsigned short mElement;
00094       unsigned int mFlags;
00095     };
00096     // EO class AttributeDescriptor
00097     //=====================================================================
00098 
00099    
00100 
00101   } // EO namespace tree
00102 
00103 } // EO namespace creaImageIO
00104 
00105 
00106 
00107 
00108 
00109 #endif // #ifndef __creaImageIOTreeAttributeDescriptor_h_INCLUDED__

Generated on Mon Jun 22 10:49:30 2009 for CreaImageIO by  doxygen 1.5.3