NIREP
|
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 #pragma once 00013 #ifndef _NIREP_EVALUATOR_H_ 00014 #define _NIREP_EVALUATOR_H_ 00015 00016 /* +-----------+ 00017 | Libraries | 00018 +-----------+ */ 00019 // standard libraries 00020 #include <iostream> 00021 #include <map> 00022 #include <vector> 00023 #include <string> 00024 00025 // our libraries 00026 #include "gecSpatialData.h" 00027 #include "gecImage.h" 00028 #include "gecObjectMap.h" 00029 #include "gecTransformation.h" 00030 //#include "gecMath.h" 00031 #include "gecJacobian.h" 00032 #include "NIREPDataManager.h" 00033 #include "DisplayDescription.h" 00034 #include <vtkImageFlip.h> 00035 00036 00037 /* +---------+ 00038 | Classes | 00039 +---------+ */ 00040 // Forward declarations 00041 class Panel; 00042 00043 00044 struct TextTable { 00045 std::string Title; //Title displayed in the text widgets. For example: 00046 // Inverse Consistency Error NA01 to NA02 to NA01 00047 // using h(g(x))-x method 00048 00049 std::vector<std::string> ColumnHeading; //Heading displayed above the value(s) 00050 //example: Average Variance Max 00051 00052 std::vector< std::vector<float> > Value; //Row(s) of value(s) appearing under each heading 00053 //example: .01 .02 .05 00054 00055 00056 }; 00057 00082 class NIREPEvaluator 00083 { 00084 public: 00085 00086 00087 00088 /* +----------------+ 00089 | Public Methods | 00090 +----------------+ */ 00091 00095 NIREPEvaluator(void); 00096 00100 NIREPEvaluator(NIREPDataManager* dm); 00101 00104 ~NIREPEvaluator(void); 00105 00108 //void SetTaskList(EvaluatorList* list) 00109 //{ 00110 // this->taskList = list; 00111 //}; 00112 00115 //EvaluatorList* GetTaskList() 00116 //{ 00117 // return this->taskList; 00118 //}; 00119 00120 00129 vtkImageData* GetImage(Panel* p, const std::string& command, DisplayDescription * displayDescription) 00130 { 00131 if(this->Evaluate(command, displayDescription) == NULL) { 00132 return NULL; 00133 } 00134 return dynamic_cast<vtkImageData *>(this->Evaluate(command, displayDescription)->GetVTKData()); 00135 // NOTE: The above code causes the reference count in the Display manager by 2. 00136 }; 00137 00146 gec::ObjectMap* GetObjectMap(Panel* p, const std::string& command, DisplayDescription * displayDescription) 00147 { 00148 return dynamic_cast<gec::ObjectMap *>(this->Evaluate(command, displayDescription)); 00149 }; 00150 00157 gec::SpatialData* GetSpatialData(const std::string& command, DisplayDescription * displayDescription) 00158 { 00159 return this->Evaluate(command, displayDescription); 00160 }; 00161 00162 unsigned long GetMemoryUsage(){return this->dataManager->GetMemoryUsage();}; 00163 00171 gec::SpatialData* ReadSpatialData(const std::string& datasetID, 00172 const std::string& dataID, 00173 DisplayDescription * displayDescription); 00174 00175 // \fn ReadTransformation 00183 gec::SpatialData* ReadTransformation(const std::string& source, 00184 const std::string& target, 00185 const std::string& transformation, 00186 DisplayDescription * displayDescription); 00187 00188 NIREPDataManager* GetDataManager(){return dataManager;}; 00189 00190 gec::SpatialData* TransformGrid(const std::string& transformID, DisplayDescription * displayDescription); 00191 00192 gec::SpatialData* VectorField(const std::string& transformID, DisplayDescription * displayDescription); 00193 00194 00195 private: 00196 00197 /* +----------+ 00198 | typedefs | 00199 +----------+ */ 00200 00201 /* +-----------------+ 00202 | Private Methods | 00203 +-----------------+ */ 00204 00207 void Init(); 00208 00214 gec::SpatialData* Evaluate(const std::string& command, DisplayDescription * displayDescription); 00215 00223 gec::SpatialData* Diff(const std::string& img1, const std::string& img2, DisplayDescription * displayDescription); 00224 00232 gec::SpatialData* Disp(const std::string& transformID, const unsigned int& index, DisplayDescription * displayDescription); 00233 00240 gec::SpatialData* Jacobian(const std::string& transformID, DisplayDescription * displayDescription); 00241 00249 gec::SpatialData* Transform(const std::string& imageID, const std::string& transformID, DisplayDescription * displayDescription); 00250 00257 gec::SpatialData* InvertTransformation(const std::string& transformID, DisplayDescription * displayDescription); 00258 00267 gec::SpatialData* InverseConsistencyError(const std::string& fwdTransID, 00268 const std::string& revTransID, 00269 const std::string& method, 00270 DisplayDescription * displayDescription); 00271 00280 gec::SpatialData* TransitivityError(const std::string& transABID, 00281 const std::string& transBCID, 00282 const std::string& transACID, 00283 const std::string& method, 00284 DisplayDescription * displayDescription); 00285 00292 gec::SpatialData* IntensityVariance(std::vector<std::string>& arg, 00293 std::string version, 00294 DisplayDescription * displayDescription); 00295 00296 /* +--------------------+ 00297 | Private Parameters | 00298 +--------------------+ */ 00299 //EvaluatorList* taskList; ///@taskList reference to the evaluator list 00300 NIREPDataManager* dataManager; 00301 }; 00302 00303 #endif 00304