return vectimages;
}
+void KernelManagerContour::changeImage(int id, vtkImageData *img)
+{
+ if ( id<vectimages.size() )
+ {
+ vectimages[id]=img;
+ }
+ double spc[3];
+ std::vector<double> vectspc;
+ img->GetSpacing(spc);
+ vectspc.push_back(spc[0]);
+ vectspc.push_back(spc[1]);
+ vectspc.push_back(spc[2]);
+ vectimagesSpacing[id]=vectspc;
+ std::string imgstring = "Source Image "+intToString(id+1);
+ ImageSourceThing *imagesourcething = modelManager->getImageSourceThingByKeyName( imgstring );
+ imagesourcething->setSourceImage( img );
+}
void KernelManagerContour::setVectImages(std::vector<vtkImageData*> vectimg)
{
std::vector<double> vectspc;
for(int i = 0; i < (int)(vectimg.size()); i++)
{
- vtkImageData* img = vectimg[i];
- vtkImageChangeInformation* change = vtkImageChangeInformation::New();
+ vtkImageData *img = vectimg[i];
+ vtkImageChangeInformation *change = vtkImageChangeInformation::New();
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
change->SetInformationInput(img);
void KernelManagerContour::initializeEnvironment(std::string datadir)
{
- _datadir = datadir;
- std::string conceptsFN = datadir+"holaConceptsFile.cf";
- std::string imageSourcesFN = datadir+"holaImagesInstantsFile.of";
- std::string imageSectionsFN = "";
- std::string axeThingsFN = "";
- std::map<std::string, ImageSourceThing *> * sourcesMap = new std::map<std::string, ImageSourceThing *>();
- std::map<std::string, ImageSectionThing *>* sectionsMap = new std::map<std::string, ImageSectionThing *>();
- std::map<std::string, AxeThing *>* axesMap = new std::map<std::string, AxeThing *>();
- std::map<std::string, ContourThing *>* outlinesMap = new std::map<std::string, ContourThing *>();
+ _datadir = datadir;
+ std::string conceptsFN = datadir+"holaConceptsFile.cf";
+ std::string imageSourcesFN = datadir+"holaImagesInstantsFile.of";
+ std::string imageSectionsFN = "";
+ std::string axeThingsFN = "";
+ std::map<std::string, ImageSourceThing *> *sourcesMap = new std::map<std::string, ImageSourceThing *>();
+ std::map<std::string, ImageSectionThing *> *sectionsMap = new std::map<std::string, ImageSectionThing *>();
+ std::map<std::string, AxeThing *> *axesMap = new std::map<std::string, AxeThing *>();
+ std::map<std::string, ContourThing *> *outlinesMap = new std::map<std::string, ContourThing *>();
for(int i = 0; i < (int)(vectimages.size()); i++)
{
- vtkImageData* selectedimage = vectimages[i];
- ImageSourceThing * thing = new ImageSourceThing(selectedimage);
- std::string imgstring = "Source Image "+intToString(i+1);
+ vtkImageData *selectedimage = vectimages[i];
+ ImageSourceThing *thing = new ImageSourceThing(selectedimage);
+ std::string imgstring = "Source Image "+intToString(i+1);
sourcesMap->insert(std::pair<std::string, ImageSourceThing *>( imgstring, thing));
} // for
- OutlineModelBuilder * _builder = new OutlineModelBuilder( conceptsFN ,datadir);
+ OutlineModelBuilder *_builder = new OutlineModelBuilder( conceptsFN ,datadir);
_builder->buildImageSource_Envornment( imageSourcesFN, sourcesMap );
_builder->buildImageSection_Envornment( imageSectionsFN, sectionsMap );
_builder->buildAxe_Envornment(axeThingsFN, axesMap );
modelManager-> getConceptsInformation(conceptNameVect, conceptSizeVect);
}
-
-vtkImageData* KernelManagerContour::getImageAtInstant(std::vector<int> inst){
+vtkImageData* KernelManagerContour::getImageAtInstant(std::vector<int> inst)
+{
int index = inst[5]-1;
-
- if(index < (int)(vectimages.size())&&index!=_currentIndex){
- _currentIndex=index;
+ if(index < (int)(vectimages.size())&&index!=_currentIndex)
+ {
+ _currentIndex = index;
return vectimages[index];
}
return NULL;
}
-std::string KernelManagerContour::getCurrentFileName(){
+std::string KernelManagerContour::getCurrentFileName()
+{
return filename;
}
-void KernelManagerContour::setCurrentFileName(std::string filenam){
+void KernelManagerContour::setCurrentFileName(std::string filenam)
+{
this->filename = filenam;
}
-std::string KernelManagerContour::parseOsirixFile(std::string filename){
-
-
+std::string KernelManagerContour::parseOsirixFile(std::string filename)
+{
#ifdef ParserOsirix_BUILD
vtkImageData* sourceimage;
std::string xsdfile;
-
xsdfile = _datadir;
-
xsdfile.append("\\XML\\osirixschema.xsd");
-
sourceimage = getSourceImage();
OsirixParser p(xsdfile.c_str(), sourceimage->GetSpacing(), sourceimage->GetExtent());
-
- if(p.ParseFile(filename.c_str())!= 0){
-
+ if(p.ParseFile(filename.c_str())!= 0)
+ {
}
-
return p.getContoursFileName();
#else
return "";
#endif
-
-
}