+
+vtkImageData* wxMaracasIRMViewManager::getImageData(std::string filename){
+ if(filename.compare("")!= 0){
+
+
+ vtkMetaImageReader* reader = vtkMetaImageReader::New();
+ reader->SetFileName(filename.c_str());
+ reader->Update();
+ vtkImageData* img = reader->GetOutput();
+ //reader->Delete();
+ return img;
+ }
+ return NULL;
+}
+
+void wxMaracasIRMViewManager::checkInvariant() throw(char*){
+ if(this->_renderer==NULL){
+ throw "Renderer not set";
+ }
+}
+
+wxMaracasIRMViewManagerData* wxMaracasIRMViewManager::getViewData(int id) throw(char*){
+ int i;
+ for(i = 0; i < (int)(prop3Dvect.size());i++){
+ if(prop3Dvect[i]->getId() == id){
+ return prop3Dvect[i];
+ }
+ }
+ throw "id not found in the data";
+
+ return NULL;
+}
+
+int wxMaracasIRMViewManager::getMaxIsoValue(int propid) throw(char*){
+
+ return ((wxMaracasIRMViewManagerDataMhd*)this->getViewData(propid))->getMaxGreyLevel();
+
+}
+
+void wxMaracasIRMViewManager::changeColor(int propid, double red, double green, double blue) throw(char*){
+ checkInvariant();
+ this->getViewData(propid)->changeColor(red, green, blue);
+
+ _renderer->Render();
+}
+
+void wxMaracasIRMViewManager::deleteActor(int propid) throw (char *){
+ checkInvariant();
+
+ this->addRemoveActor(propid, false);
+
+ int i,n;
+ bool exit = false;
+ for(i = 0; i < (int)(prop3Dvect.size())&&!exit;i++){
+ if(prop3Dvect[i]->getId() == propid){
+ n=i;
+ exit = true;
+ }
+ }
+ if(exit){
+ wxMaracasIRMViewManagerData* data = prop3Dvect[n];
+ int j;
+ for(j = i; j < (int)(prop3Dvect.size())-1;j++){
+ prop3Dvect[j] = prop3Dvect[j+1];
+ }
+ delete data;
+ prop3Dvect.pop_back();
+ }else{
+ throw "id not found in the data";
+ }
+
+
+
+
+}
+
+