MeVisLabToolboxReference
|
00001 //---------------------------------------------------------------------------------- 00002 // **InsertLicense** code 00003 //---------------------------------------------------------------------------------- 00005 00010 //---------------------------------------------------------------------------------- 00011 #ifndef CLASS_DCMTREE_IOPARAMETER 00012 #define CLASS_DCMTREE_IOPARAMETER 00013 00014 #include "DCMTree_Defines.h" 00015 #include "DCMTree_Lib.h" 00016 00017 #ifdef _MSC_VER 00018 #pragma warning (push) 00019 #pragma warning (disable : 4251) 00020 #endif 00021 00035 namespace DCMTree 00036 { 00037 class IOParameter; 00038 typedef boost::shared_ptr<IOParameter> IOParameterPtr; 00039 typedef boost::shared_ptr<const IOParameter> Const_IOParameterPtr; 00040 00054 class DCMTREE_EXPORT IOParameter 00055 { 00056 public: 00058 IOParameter(); 00059 00061 explicit IOParameter(const IOParameter &other); 00062 00070 static IOParameterPtr create(std::string filename, bool readPixelData = true, 00071 bool readPrivateTags = true, bool convertToUTF8 = true ); 00072 00074 virtual std::string filename() const = 0; 00075 00077 virtual bool readPixelData() const = 0; 00078 00080 virtual bool readPrivateTags() const = 0; 00081 00083 virtual bool convertToUTF8() const = 0; 00084 00086 virtual ~IOParameter(); 00087 00089 IOParameter &operator=(const IOParameter &other); 00090 00100 TagIdPtrPair &tagId_Interval(); 00101 00103 const TagIdPtrPair &tagId_Interval() const; 00104 00109 TagIdVector &tag_Ids_ToIgnore(); 00110 00112 const TagIdVector &tag_Ids_ToIgnore() const; 00113 00118 TagIdVector &tag_Ids_ToProcess(); 00119 00121 const TagIdVector &tag_Ids_ToProcess() const; 00122 00127 VrVector &vrs_ToIgnore(); 00128 00130 const VrVector &vrs_ToIgnore() const; 00131 00136 VrVector &vrs_ToProcess(); 00137 00139 const VrVector &vrs_ToProcess() const; 00140 00144 static bool processVR(const VrVector &toignore,const VrVector &toprocess,const Vr &vr); 00145 00149 static bool processTagId (const TagIdVector &toignore,const TagIdVector &toprocess,const TagIdPtrPair &interval,const TagId &id); 00150 00154 bool processVR (const Vr &vr); 00155 00159 bool processTagId (const TagId &id); 00160 00164 bool process (const TagInfo &info); 00165 00167 virtual void setNumberOfToleratedBadTags(unsigned int numBadTags=5); 00168 00170 virtual unsigned int getNumberOfToleratedBadTags() const; 00171 00172 protected: 00174 static Const_IOParameterPtr prototype(); 00175 00177 static void setPrototype(Const_IOParameterPtr prototype); 00178 00186 virtual IOParameterPtr createConcrete(std::string filename, bool readPixelData, 00187 bool readPrivateTags, bool convertToUTF8) const = 0; 00188 00189 private: 00191 static Const_IOParameterPtr _prototype; 00192 00193 TagIdPtrPair _tagid_interval; 00194 TagIdVector _tagid_toignore; 00195 TagIdVector _tagid_toprocess; 00196 VrVector _vr_toignore; 00197 VrVector _vr_toprocess; 00198 unsigned int _numberOfToleratedBadTags; 00199 }; 00200 00201 } 00202 00203 #ifdef _MSC_VER 00204 #pragma warning (pop) 00205 #endif 00206 00207 #endif 00208 00209