**/
}
-KernelManagerContour::KernelManagerContour(std::vector<vtkImageData*> images){
+KernelManagerContour::KernelManagerContour(std::vector<vtkImageData*> images,std::string datadir,std::string tmpdir)
+{
/**THIS ALL SHOULD BE IN AN OTHER LIB CALLED PERSISTANCE
int time = seconds;
- stundoredo = "data/temp"+intToString(time);
+ stundoredo = tmpdir+"/temp"+intToString(time);
_currentIndex = 0;
_contourPropagation = NULL;
#if(WIN32)
- mkdir(stundoredo.c_str());
+ mkdir(tmpdir.c_str());
+ mkdir(stundoredo.c_str());
#else
- mkdir(stundoredo.c_str(),755);
+ mkdir(tmpdir.c_str(),755);
+ mkdir(stundoredo.c_str(),755);
#endif
stundoredo += "/cont";
/**
** FINISH PERSISTANCE
**/
setVectImages(images);
- initializeEnvironment();
+ initializeEnvironment(datadir);
}
KernelManagerContour::~KernelManagerContour(){
-}
+}
std::vector<vtkImageData*> KernelManagerContour::getVectImages(){
return vectimages;
}
void KernelManagerContour::setVectImages(std::vector<vtkImageData*> vectimg){
- for(int i = 0; i < vectimg.size(); i++){
+ for(int i = 0; i < (int)(vectimg.size()); i++){
vtkImageData* img = vectimg[i];
vtkImageChangeInformation* change = vtkImageChangeInformation::New();
change->SetInformationInput(img);
change->SetInputConnection(img->GetProducerPort());
- change->SetOutputSpacing(0.6,0.6,0.6);
+ change->SetOutputSpacing(1,1,1);
change->Update();
vectimages = vectimg;
}
-void KernelManagerContour::initializeEnvironment(){
- std::string conceptsFN = "data/holaConceptsFile.cf";
- std::string imageSourcesFN = "data/holaImagesInstantsFile.of";
+void KernelManagerContour::initializeEnvironment(std::string datadir){
+ std::string conceptsFN = datadir+"holaConceptsFile.cf";
+ std::string imageSourcesFN = datadir+"holaImagesInstantsFile.of";
std::string imageSectionsFN = "";
std::string axeThingsFN = "";
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 < vectimages.size(); i++){
+ 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);
}
- OutlineModelBuilder * _builder = new OutlineModelBuilder( conceptsFN );
+ OutlineModelBuilder * _builder = new OutlineModelBuilder( conceptsFN ,datadir);
_builder->buildImageSource_Envornment( imageSourcesFN, sourcesMap );
_builder->buildImageSection_Envornment( imageSectionsFN, sectionsMap );
_builder->buildAxe_Envornment(axeThingsFN, axesMap );
return modelManager;
}
-std::string KernelManagerContour::createOutline(manualContourModel * manModelContour,std::vector<int> instantVector){
+std::string KernelManagerContour::createOutline(manualBaseModel * manModelContour,std::vector<int> instantVector){
return modelManager->createOutline( manModelContour, instantVector );
}
return modelManager->GetLstNameThingsStatic();
}
-void KernelManagerContour::SaveThingName(FILE* pFile, std::string name ){
- modelManager->SaveThingName(pFile, name);
+void KernelManagerContour::SaveThingName(FILE* pFile, FILE *pFileData, std::string name ){
+ modelManager->SaveThingName(pFile, pFileData, name);
}
std::vector<std::string> KernelManagerContour::GetLstNameThings(){
return modelManager->GetLstNameThings();
}
void KernelManagerContour::deleteCModel(std::string theKeyName){
- manualContourModel* cModel = modelManager->getOutlineByKeyName(theKeyName)->getModel();
+ manualBaseModel* cModel = modelManager->getOutlineByKeyName(theKeyName)->getModel();
modelManager->removeOutline( theKeyName );
delete cModel;
modelManager->setInstant(act);
}
-std::string KernelManagerContour::createCopyContourOf ( std::string anExistingKName, std::vector<int> &instantNoTouchData){
+std::string KernelManagerContour::createCopyContourOf ( std::string anExistingKName, std::vector<int> &instantNoTouchData)
+{
return modelManager->createCopyContourOf(anExistingKName, instantNoTouchData);
}
-manualContourModel* KernelManagerContour::getOutlineByKeyName(std::string cloneName){
+manualBaseModel* KernelManagerContour::getOutlineByKeyName(std::string cloneName){
return modelManager->getOutlineByKeyName (cloneName )->getModel();
}
_contourPropagation->CalculeSplinePropagation();
}
-manualContourModel* KernelManagerContour::GetPoints(int z,int type, std::vector<double>* vecCtrlPointX,std::vector<double>* vecCtrlPointY,std::vector<double>* vecCtrlPointZ, std::string& theName,int typeofcontour, std::vector<int> tempVector){
+manualBaseModel* KernelManagerContour::GetPoints(int z,int type, std::vector<double>* vecCtrlPointX,std::vector<double>* vecCtrlPointY,std::vector<double>* vecCtrlPointZ, std::string& theName,int typeofcontour, std::vector<int> tempVector){
bool addedModel = false;
- manualContourModel* manModelContour=NULL;
+ manualBaseModel* manModelContour=NULL;
if (_contourPropagation->ifSliceKeyContourExist(z)==false){
for (int j=0 ; j<sizeCtrPt ; j++)
{
//JSTG_16-07-08_----------------------------------------------------------------
- manModelContour->AddPoint( (*vecCtrlPointX)[j] , (*vecCtrlPointY)[j] , -900 );
+ manModelContour->AddPoint( (*vecCtrlPointX)[j] , (*vecCtrlPointY)[j] , 900 );
//--------------------------------------------------------------------
} // for j
}// ifSliceKeyContourExist
return manModelContour;
-
}
-manualContourModel * KernelManagerContour::factoryManualContourModel(int typeContour)
+manualBaseModel * KernelManagerContour::factoryManualContourModel(int typeContour)
{
- manualContourModel *manModelContour=NULL;
+ manualBaseModel *manModelContour=NULL;
+
+ // Creating the model
+ // NOTE: The view and the controler are created in the wxVtkBaseView_SceneManager class, configureViewControlTo method
// spline
if (typeContour==0)
manModelContour = new manualContourModelCircle();
}
+ // line
+ if (typeContour==6)
+ {
+ manModelContour = new manualContourModelLine();
+ }
+
+ // points
+ if (typeContour==7)
+ {
+ manModelContour = new manualBaseModel();
+ }
+
+ // polygon
+ if (typeContour==10)
+ {
+ manModelContour = new manualContourModelPolygon();
+ }
+
return manModelContour;
}
Instant instant(&tempvector);
std::vector<ContourThing**> vectcont = modelManager->getOutlinesAtInstant( &instant );
std::vector<std::string> vectname;
- for(int i = 0; i < vectcont.size(); i++){
+ for(int i = 0; i < (int)(vectcont.size()); i++){
ContourThing **contourthing = vectcont[i];
vectname.push_back((*contourthing)->getName());
}
return modelManager->getOutlinesAtInstant(instant);
}
-std::vector<manualContourModel*> KernelManagerContour::ExploseEachModel( std::vector<manualContourModel*> lstManConMod ){
- std::vector<manualContourModel*> lstTmp;
- std::vector<manualContourModel*> lstResult;
+std::vector<manualBaseModel*> KernelManagerContour::ExploseEachModel( std::vector<manualBaseModel*> lstManConMod ){
+ std::vector<manualBaseModel*> lstTmp;
+ std::vector<manualBaseModel*> lstResult;
int j,jSize;
int i,iSize=lstManConMod.size();
for (i=0;i<iSize;i++)
vtkImageData* KernelManagerContour::getImageAtInstant(std::vector<int> inst){
int index = inst[5]-1;
- if(index < vectimages.size()&&index!=_currentIndex){
+ if(index < (int)(vectimages.size())&&index!=_currentIndex){
_currentIndex=index;
return vectimages[index];
}
void KernelManagerContour::setCurrentFileName(std::string filenam){
this->filename = filenam;
-}
\ No newline at end of file
+}
+
+