creaContours_lib
KernelManagerContour Class Reference

#include <KernelManagerContour.h>

Collaboration diagram for KernelManagerContour:

Public Member Functions

 KernelManagerContour ()
 
 KernelManagerContour (std::vector< vtkImageData * > images, std::string datadir, std::string tmpdir)
 
 ~KernelManagerContour ()
 
std::vector< vtkImageData * > getVectImages ()
 
void setVectImages (std::vector< vtkImageData * > vectimg)
 
void GetSpacing (double *vecspc, int iImage)
 
vtkImageData * getSourceImage ()
 
void initializeEnvironment (std::string datadir)
 
std::string createOutline (manualBaseModel *manModelContour, std::vector< int > instantVector)
 
std::string intToString (int num)
 
std::vector< std::string > GetLstNameThingsStatic ()
 
void SaveThingName (FILE *pFile, FILE *pFileData, std::string name)
 
std::vector< std::string > GetLstNameThings ()
 
bool IsPartOfStaticList (std::string keyName)
 
void deleteCModel (std::string theKeyName)
 
void removeAllOutlines ()
 
std::vector< NameWrapper * > getActualInstantOutlines ()
 
int getNamesWrappingSize ()
 
std::string getNameWrapping (int i)
 
void setInstant (Instant *theInstant)
 
void setInstant (std::vector< int > vectInstant)
 
std::string createCopyContourOf (std::string anExistingKName, std::vector< int > &instantNoTouchData)
 
Instant * getCurrentInstant ()
 
manualBaseModel * getOutlineByKeyName (std::string cloneName)
 
bool onRedo (std::string &filename)
 
bool onUndo (std::string &filename)
 
bool onUndoSaveFile (std::string &filename)
 
std::string saveState ()
 
void changeContourOfManager (std::string keyName, Instant *instant)
 
void resetAppend ()
 
std::string onSpreadAdd (std::vector< double > *vecX, std::vector< double > *vecY, std::vector< double > *vecZ, std::vector< int > instants)
 
void getMaxMinZ (double *minZ, double *maxZ)
 
manualBaseModel * 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 * factoryManualContourModel (int typeContour)
 
void CalculeSplinePropagation ()
 
std::vector< std::string > getOutlinesNameAtInstant (std::vector< int > tempvector)
 
std::vector< ContourThing ** > getOutlinesAtInstant (Instant *instant)
 
std::vector< manualBaseModel * > ExploseEachModel (std::vector< manualBaseModel * > lstManConMod)
 
void getConceptsInformation (std::vector< std::string > &conceptNameVect, std::vector< int > &conceptSizeVect)
 
vtkImageData * getImageAtInstant (std::vector< int > inst)
 
void setCurrentFileName (std::string filenam)
 
std::string getCurrentFileName ()
 
std::string parseOsirixFile (std::string filename)
 

Private Member Functions

OutlineModelManagergetOutlineModelManager ()
 

Private Attributes

std::vector< vtkImageData * > vectimages
 
std::vector< std::vector
< double > > 
vectimagesSpacing
 
ImageSourceThingimageSource
 
OutlineModelManagermodelManager
 
std::string filename
 
int inredo
 
int inundo
 
int _currentIndex
 
std::string stundoredo
 
std::string _datadir
 
ContourPropagation * _contourPropagation
 

Detailed Description

Definition at line 54 of file KernelManagerContour.h.

Constructor & Destructor Documentation

KernelManagerContour::KernelManagerContour ( )

With this constructor the setVectImages and initialize environment must be called

THIS ALL SHOULD BE IN AN OTHER LIB CALLED PERSISTANCE

FINISH PERSISTANCE

Definition at line 33 of file KernelManagerContour.cxx.

References _contourPropagation, _currentIndex, inredo, intToString(), inundo, and stundoredo.

33  {
34 
35 
39  inredo = 0;
40  inundo = 0;
41 
42  time_t seconds;
43  seconds = time (NULL);
44  int time = seconds;
45 
46 
47  stundoredo = "data/temp"+intToString(time);
48  _currentIndex = 0;
49 
50  _contourPropagation = NULL;
51 #if(WIN32)
52  mkdir(stundoredo.c_str());
53 #else
54  mkdir(stundoredo.c_str(),755);
55 #endif
56  stundoredo += "/cont";
61 }

Here is the call graph for this function:

KernelManagerContour::KernelManagerContour ( std::vector< vtkImageData * >  images,
std::string  datadir,
std::string  tmpdir 
)

If images are available before the construction of the kernelManager this method should be used it sets the vector images and initializes the environment

THIS ALL SHOULD BE IN AN OTHER LIB CALLED PERSISTANCE

FINISH PERSISTANCE

Definition at line 62 of file KernelManagerContour.cxx.

References _contourPropagation, _currentIndex, initializeEnvironment(), inredo, intToString(), inundo, setVectImages(), and stundoredo.

63 {
64 
65 
69  inredo = 0;
70  inundo = 0;
71 
72  time_t seconds;
73  seconds = time (NULL);
74  int time = seconds;
75 
76 
77  stundoredo = tmpdir+"/temp"+intToString(time);
78  _currentIndex = 0;
79 
80  _contourPropagation = NULL;
81 #if(WIN32)
82  mkdir(tmpdir.c_str());
83  mkdir(stundoredo.c_str());
84 #else
85  mkdir(tmpdir.c_str(),755);
86  mkdir(stundoredo.c_str(),755);
87 #endif
88  stundoredo += "/cont";
92  setVectImages(images);
93  initializeEnvironment(datadir);
94 
95 }

Here is the call graph for this function:

KernelManagerContour::~KernelManagerContour ( )

Definition at line 97 of file KernelManagerContour.cxx.

98 {
99 }

Member Function Documentation

void KernelManagerContour::CalculeSplinePropagation ( )

Definition at line 364 of file KernelManagerContour.cxx.

References _contourPropagation.

Referenced by wxContourMainFrame::onSpreadGo().

365 {
366  _contourPropagation->setInterpolationNumber(100);
367  _contourPropagation->CalculeSplinePropagation();
368 }

Here is the caller graph for this function:

void KernelManagerContour::changeContourOfManager ( std::string  keyName,
Instant *  instant 
)

Definition at line 318 of file KernelManagerContour.cxx.

References OutlineModelManager::ChangeContourOfList(), and modelManager.

Referenced by wxContourMainFrame::onRigidPressed(), and wxContourMainFrame::openContours().

319 {
320  modelManager->ChangeContourOfList(keyName, instant);
321 }

Here is the call graph for this function:

Here is the caller graph for this function:

std::string KernelManagerContour::createCopyContourOf ( std::string  anExistingKName,
std::vector< int > &  instantNoTouchData 
)

Definition at line 254 of file KernelManagerContour.cxx.

References OutlineModelManager::createCopyContourOf(), and modelManager.

Referenced by wxContourMainFrame::createCopyContourOf(), and wxContourMainFrame::createMirrorContourOf().

255 {
256  return modelManager->createCopyContourOf(anExistingKName, instantNoTouchData);
257 }

Here is the call graph for this function:

Here is the caller graph for this function:

std::string KernelManagerContour::createOutline ( manualBaseModel *  manModelContour,
std::vector< int >  instantVector 
)

This methods connect the event in the class interfNewContourMenu with the world of the appli

Definition at line 181 of file KernelManagerContour.cxx.

References OutlineModelManager::createOutline(), and modelManager.

Referenced by wxContourMainFrame::createContour(), wxContourMainFrame::onCreateContourBullEye(), wxContourMainFrame::openContours(), wxContourMainFrame::SegmentationOneSlice(), and wxContourMainFrame::SegmentationOneSliceITK().

181  {
182  return modelManager->createOutline( manModelContour, instantVector );
183 }

Here is the call graph for this function:

Here is the caller graph for this function:

void KernelManagerContour::deleteCModel ( std::string  theKeyName)

Definition at line 218 of file KernelManagerContour.cxx.

References ContourThing::getModel(), OutlineModelManager::getOutlineByKeyName(), modelManager, and OutlineModelManager::removeOutline().

Referenced by wxContourMainFrame::deleteContour().

218  {
219  manualBaseModel* cModel = modelManager->getOutlineByKeyName(theKeyName)->getModel();
220  modelManager->removeOutline( theKeyName );
221 
222  delete cModel;
223 }

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< manualBaseModel * > KernelManagerContour::ExploseEachModel ( std::vector< manualBaseModel * >  lstManConMod)

Definition at line 480 of file KernelManagerContour.cxx.

Referenced by wxContourMainFrame::getMaskValue(), wxContourMainFrame::onInformationContourLabels(), and wxContourMainFrame::SaveValuesXYZ().

480  {
481  std::vector<manualBaseModel*> lstTmp;
482  std::vector<manualBaseModel*> lstResult;
483  int j,jSize;
484  int i,iSize=lstManConMod.size();
485  for (i=0;i<iSize;i++)
486  {
487  lstTmp = lstManConMod[i]->ExploseModel();
488  jSize=lstTmp.size();
489  for (j=0;j<jSize;j++)
490  {
491  lstResult.push_back( lstTmp[j] );
492  }
493  }
494  return lstResult;
495 }

Here is the caller graph for this function:

manualBaseModel * KernelManagerContour::factoryManualContourModel ( int  typeContour)

Definition at line 413 of file KernelManagerContour.cxx.

Referenced by wxContourMainFrame::createContour(), GetPoints(), wxContourMainFrame::openContours(), wxContourMainFrame::SegmentationOneSlice(), and wxContourMainFrame::SegmentationOneSliceITK().

414 {
415  manualBaseModel *manModelContour=NULL;
416 
417  // Creating the model
418  // NOTE: The view and the controler are created in the wxVtkBaseView_SceneManager class, configureViewControlTo method
419 
420  // spline
421  if (typeContour==0)
422  {
423  manModelContour = new manualContourModel();
424  }
425 
426  // spline
427  if (typeContour==1)
428  {
429  manModelContour = new manualContourModel();
430  }
431 
432  // rectangle
433  if (typeContour==2)
434  {
435  manModelContour = new manualContourModelRoi();
436  }
437 
438  // circle
439  if (typeContour==3)
440  {
441  manModelContour = new manualContourModelCircle();
442  }
443 
444  // line
445  if (typeContour==6)
446  {
447  manModelContour = new manualContourModelLine();
448  }
449 
450  // points
451  if (typeContour==7)
452  {
453  manModelContour = new manualBaseModel();
454  }
455 
456  // polygon
457  if (typeContour==10)
458  {
459  manModelContour = new manualContourModelPolygon();
460  }
461 
462  return manModelContour;
463 }

Here is the caller graph for this function:

std::vector< NameWrapper * > KernelManagerContour::getActualInstantOutlines ( )

Definition at line 229 of file KernelManagerContour.cxx.

References OutlineModelManager::getActualInstantOutlines(), and modelManager.

Referenced by getNamesWrappingSize(), and getNameWrapping().

229  {
231 }

Here is the call graph for this function:

Here is the caller graph for this function:

void KernelManagerContour::getConceptsInformation ( std::vector< std::string > &  conceptNameVect,
std::vector< int > &  conceptSizeVect 
)

Definition at line 497 of file KernelManagerContour.cxx.

References modelManager.

Referenced by wxContourMainFrame::setVectImages().

497  {
498  modelManager-> getConceptsInformation(conceptNameVect, conceptSizeVect);
499 }

Here is the caller graph for this function:

std::string KernelManagerContour::getCurrentFileName ( )

Definition at line 512 of file KernelManagerContour.cxx.

References filename.

Referenced by wxContourMainFrame::saveFileWithContoursAutomatique().

512  {
513  return filename;
514 }

Here is the caller graph for this function:

Instant * KernelManagerContour::getCurrentInstant ( )

Definition at line 246 of file KernelManagerContour.cxx.

References OutlineModelManager::getInstant(), and modelManager.

246  {
247  return modelManager->getInstant();
248 }

Here is the call graph for this function:

vtkImageData * KernelManagerContour::getImageAtInstant ( std::vector< int >  inst)

Definition at line 502 of file KernelManagerContour.cxx.

References _currentIndex, and vectimages.

Referenced by wxContourMainFrame::updateInstantImageData().

502  {
503  int index = inst[5]-1;
504 
505  if(index < (int)(vectimages.size())&&index!=_currentIndex){
506  _currentIndex=index;
507  return vectimages[index];
508  }
509  return NULL;
510 }

Here is the caller graph for this function:

std::vector< std::string > KernelManagerContour::GetLstNameThings ( )

Definition at line 207 of file KernelManagerContour.cxx.

References OutlineModelManager::GetLstNameThings(), and modelManager.

Referenced by wxContourMainFrame::saveFileWithContours(), and wxContourMainFrame::SetZForAllContours().

207  {
208  return modelManager->GetLstNameThings();
209 }

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< std::string > KernelManagerContour::GetLstNameThingsStatic ( )

Definition at line 200 of file KernelManagerContour.cxx.

References OutlineModelManager::GetLstNameThingsStatic(), and modelManager.

Referenced by wxContourMainFrame::saveFileWithContours(), and wxContourMainFrame::SetZForAllContours().

200  {
202 }

Here is the call graph for this function:

Here is the caller graph for this function:

void KernelManagerContour::getMaxMinZ ( double *  minZ,
double *  maxZ 
)

Definition at line 355 of file KernelManagerContour.cxx.

References _contourPropagation.

Referenced by wxContourMainFrame::onSpreadGo().

356 {
357  if (_contourPropagation!=NULL)
358  {
359  _contourPropagation->getMaxMinZ(minZ, maxZ);
360  }
361 }

Here is the caller graph for this function:

int KernelManagerContour::getNamesWrappingSize ( )

Definition at line 233 of file KernelManagerContour.cxx.

References getActualInstantOutlines().

Referenced by wxContourMainFrame::getNamesWrappingSize().

233  {
234  return getActualInstantOutlines().size();
235 }

Here is the call graph for this function:

Here is the caller graph for this function:

std::string KernelManagerContour::getNameWrapping ( int  i)

Definition at line 237 of file KernelManagerContour.cxx.

References getActualInstantOutlines().

Referenced by wxContourMainFrame::getNameWrapping().

237  {
238  return getActualInstantOutlines()[i]->getKeyName();
239 }

Here is the call graph for this function:

Here is the caller graph for this function:

manualBaseModel * KernelManagerContour::getOutlineByKeyName ( std::string  cloneName)
OutlineModelManager * KernelManagerContour::getOutlineModelManager ( )
private

Definition at line 177 of file KernelManagerContour.cxx.

References modelManager.

177  {
178  return modelManager;
179 }
std::vector< ContourThing ** > KernelManagerContour::getOutlinesAtInstant ( Instant *  instant)

Definition at line 476 of file KernelManagerContour.cxx.

References OutlineModelManager::getOutlinesAtInstant(), and modelManager.

Referenced by wxContourMainFrame::getMaskValue(), wxContourMainFrame::onInformationContourLabels(), wxContourMainFrame::onSpreadAddAll(), and wxContourMainFrame::SaveValuesXYZ().

476  {
477  return modelManager->getOutlinesAtInstant(instant);
478 }

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< std::string > KernelManagerContour::getOutlinesNameAtInstant ( std::vector< int >  tempvector)

Definition at line 465 of file KernelManagerContour.cxx.

References OutlineModelManager::getOutlinesAtInstant(), and modelManager.

Referenced by wxContourMainFrame::getOutlinesName().

465  {
466  Instant instant(&tempvector);
467  std::vector<ContourThing**> vectcont = modelManager->getOutlinesAtInstant( &instant );
468  std::vector<std::string> vectname;
469  for(int i = 0; i < (int)(vectcont.size()); i++){
470  ContourThing **contourthing = vectcont[i];
471  vectname.push_back((*contourthing)->getName());
472  }
473  return vectname;
474 }

Here is the call graph for this function:

Here is the caller graph for this function:

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 
)

Definition at line 370 of file KernelManagerContour.cxx.

References _contourPropagation, OutlineModelManager::createOutline(), factoryManualContourModel(), and modelManager.

Referenced by wxContourMainFrame::onSpreadGo().

371 {
372  bool addedModel = false;
373  manualBaseModel* manModelContour=NULL;
374 
375  if (_contourPropagation->ifSliceKeyContourExist(z)==false){
376 
377  manModelContour = factoryManualContourModel( typeofcontour );
378 
379  int idTmp = _contourPropagation->FindIdWithZ(z);
380 
381  if (type==0) // Initial Points
382  {
383  _contourPropagation->GetInitialControlPoints( idTmp , vecCtrlPointX,vecCtrlPointY,vecCtrlPointZ);
384  }
385  if (type==1) // Automatique Method
386  {
387  _contourPropagation->GetControlPoints( idTmp ,vecCtrlPointX,vecCtrlPointY,vecCtrlPointZ);
388  }
389  if (type==2) // sampling
390  {
391  _contourPropagation->GetControlPoints( idTmp , 20.0 ,vecCtrlPointX,vecCtrlPointY,vecCtrlPointZ);
392  }
393 //--------------------------------------------------------------------
394  int sizeCtrPt = vecCtrlPointX->size();
395  for (int j=0 ; j<sizeCtrPt ; j++)
396  {
397 //JSTG_16-07-08_----------------------------------------------------------------
398  manModelContour->AddPoint( (*vecCtrlPointX)[j] , (*vecCtrlPointY)[j] , -900 );
399 //--------------------------------------------------------------------
400  } // for j
401 
402  tempVector[1]=z;
403  theName = modelManager->createOutline( manModelContour, tempVector );
404  addedModel = theName.compare("") != 0;
405  if(!addedModel){
406  manModelContour = NULL;
407  }
408 
409  }// ifSliceKeyContourExist
410  return manModelContour;
411 }

Here is the call graph for this function:

Here is the caller graph for this function:

vtkImageData * KernelManagerContour::getSourceImage ( )

This method returns the source of the image data selected by the user.

Definition at line 174 of file KernelManagerContour.cxx.

References ImageSourceThing::getSourceImage(), and imageSource.

Referenced by parseOsirixFile(), and wxContourMainFrame::setVectImages().

174  {
175  return imageSource->getSourceImage();
176 }

Here is the call graph for this function:

Here is the caller graph for this function:

void KernelManagerContour::GetSpacing ( double *  vecspc,
int  iImage 
)

Definition at line 134 of file KernelManagerContour.cxx.

References vectimagesSpacing.

Referenced by wxContourMainFrame::SaveImageResult().

135 {
136  vecspc[0]=vectimagesSpacing[iImage][0];
137  vecspc[1]=vectimagesSpacing[iImage][1];
138  vecspc[2]=vectimagesSpacing[iImage][2];
139 }

Here is the caller graph for this function:

std::vector< vtkImageData * > KernelManagerContour::getVectImages ( )

Definition at line 101 of file KernelManagerContour.cxx.

References vectimages.

Referenced by wxContourMainFrame::getVectImages().

102 {
103  return vectimages;
104 }

Here is the caller graph for this function:

void KernelManagerContour::initializeEnvironment ( std::string  datadir)

Definition at line 142 of file KernelManagerContour.cxx.

References _datadir, OutlineModelBuilder::buildAxe_Envornment(), OutlineModelBuilder::buildCountour_Envornment(), OutlineModelBuilder::buildImageSection_Envornment(), OutlineModelBuilder::buildImageSource_Envornment(), OutlineModelBuilder::getAxesEnv(), OutlineModelBuilder::getContourEnv(), OutlineModelManager::getImageSourceThingByKeyName(), OutlineModelBuilder::getImSectionEnv(), OutlineModelBuilder::getImSourceEnv(), imageSource, intToString(), modelManager, and vectimages.

Referenced by KernelManagerContour().

142  {
143  _datadir = datadir;
144  std::string conceptsFN = datadir+"holaConceptsFile.cf";
145  std::string imageSourcesFN = datadir+"holaImagesInstantsFile.of";
146  std::string imageSectionsFN = "";
147  std::string axeThingsFN = "";
148 
149  std::map<std::string, ImageSourceThing *> * sourcesMap = new std::map<std::string, ImageSourceThing *>();
150  std::map<std::string, ImageSectionThing *>* sectionsMap = new std::map<std::string, ImageSectionThing *>();
151  std::map<std::string, AxeThing *>* axesMap = new std::map<std::string, AxeThing *>();
152  std::map<std::string, ContourThing *>* outlinesMap = new std::map<std::string, ContourThing *>();
153 
154  for(int i = 0; i < (int)(vectimages.size()); i++){
155  vtkImageData* selectedimage = vectimages[i];
156  ImageSourceThing * thing = new ImageSourceThing(selectedimage);
157  std::string imgstring = "Source Image "+intToString(i+1);
158  sourcesMap->insert(std::pair<std::string, ImageSourceThing *>( imgstring, thing));
159  }
160 
161 
162  OutlineModelBuilder * _builder = new OutlineModelBuilder( conceptsFN ,datadir);
163  _builder->buildImageSource_Envornment( imageSourcesFN, sourcesMap );
164  _builder->buildImageSection_Envornment( imageSectionsFN, sectionsMap );
165  _builder->buildAxe_Envornment(axeThingsFN, axesMap );
166  _builder->buildCountour_Envornment( imageSectionsFN, outlinesMap );
167 
168  //Creating the objects to manage
169  modelManager = new OutlineModelManager( _builder->getImSourceEnv(), _builder->getImSectionEnv(), _builder->getAxesEnv(), _builder->getContourEnv() );
170 
172 
173 }

Here is the call graph for this function:

Here is the caller graph for this function:

std::string KernelManagerContour::intToString ( int  num)

Definition at line 185 of file KernelManagerContour.cxx.

Referenced by initializeEnvironment(), KernelManagerContour(), onRedo(), onSpreadAdd(), wxContourMainFrame::onSpreadGo(), onUndo(), onUndoSaveFile(), saveState(), and wxContourMainFrame::SaveValuesXYZ().

185  {
186  std::string result;
187  if(num == 0){
188  result = "0";
189  }else{
190  int k=num;
191  while (k > 0){
192  char temp = k % 10 + 48;
193  k = k / 10;
194  result = temp + result;
195  }
196  }
197  return result;
198 }

Here is the caller graph for this function:

bool KernelManagerContour::IsPartOfStaticList ( std::string  keyName)

Definition at line 214 of file KernelManagerContour.cxx.

References OutlineModelManager::IsPartOfStaticList(), and modelManager.

Referenced by wxContourMainFrame::deleteContour().

214  {
215  return modelManager->IsPartOfStaticList(theKeyName) == -1;
216 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool KernelManagerContour::onRedo ( std::string &  filename)

Definition at line 264 of file KernelManagerContour.cxx.

References inredo, intToString(), inundo, and stundoredo.

Referenced by wxContourMainFrame::onRedo().

264  {
265  if(inredo > 0){
266  inredo--;
267  inundo++;
268  std::string str = intToString(inundo);
269  filename = stundoredo + str + ".roi";
270  //loadState(temp);
271  return true;
272  }
273  return false;
274 }

Here is the call graph for this function:

Here is the caller graph for this function:

std::string KernelManagerContour::onSpreadAdd ( std::vector< double > *  vecX,
std::vector< double > *  vecY,
std::vector< double > *  vecZ,
std::vector< int >  instants 
)

Definition at line 332 of file KernelManagerContour.cxx.

References _contourPropagation, and intToString().

Referenced by wxContourMainFrame::onSpreadAdd(), and wxContourMainFrame::onSpreadAddAll().

333 {
334  if (_contourPropagation==NULL)
335  {
336  _contourPropagation = new ContourPropagation();
337  }
338 
339  if (vecX->size()!=0){
340 
341  int i,size=vecZ->size();
342  int actualSlice = instants[1];
343  for ( i=0 ; i<size ; i++ )
344  {
345  (*vecZ)[i] = actualSlice;
346  } // for
347 
348  _contourPropagation->appendContour(vecX , vecY , vecZ);
349  return intToString(actualSlice);
350  }
351  return "";
352 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool KernelManagerContour::onUndo ( std::string &  filename)

Definition at line 276 of file KernelManagerContour.cxx.

References inredo, intToString(), inundo, and stundoredo.

Referenced by wxContourMainFrame::onUndo().

276  {
277  if(inundo>0){
278  inredo++;
279  inundo--;
280 
281  //char str[9000];
282  //itoa(inundo, str, 10);
283  std::string str = intToString(inundo);
284 
285 
286  filename = stundoredo + str + ".roi";
287 
288  return true;//loadState(temp);
289  }
290  return false;
291 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool KernelManagerContour::onUndoSaveFile ( std::string &  filename)

Definition at line 301 of file KernelManagerContour.cxx.

References inredo, intToString(), inundo, and stundoredo.

Referenced by wxContourMainFrame::onUndo().

301  {
302  if(inundo>0){
303  if(inredo==0){
304 
305  //char str[9000];
306  //itoa(inundo, str, 10);
307  std::string str = intToString(inundo);
308 
309  filename = stundoredo + str + ".roi";
310  return true;
311  //saveFileWithContours(temp);
312 
313  }
314  }
315  return false;
316 }

Here is the call graph for this function:

Here is the caller graph for this function:

std::string KernelManagerContour::parseOsirixFile ( std::string  filename)

Definition at line 520 of file KernelManagerContour.cxx.

References _datadir, OsirixParser::getContoursFileName(), and getSourceImage().

Referenced by wxContourMainFrame::onImport().

520  {
521 
522 
523 #ifdef ParserOsirix_BUILD
524  vtkImageData* sourceimage;
525  std::string xsdfile;
526 
527  xsdfile = _datadir;
528 
529  xsdfile.append("\\XML\\osirixschema.xsd");
530 
531  sourceimage = getSourceImage();
532  OsirixParser p(xsdfile.c_str(), sourceimage->GetSpacing(), sourceimage->GetExtent());
533 
534  if(p.ParseFile(filename.c_str())!= 0){
535 
536  }
537 
538  return p.getContoursFileName();
539 #else
540  return "";
541 #endif
542 
543 
544 }

Here is the call graph for this function:

Here is the caller graph for this function:

void KernelManagerContour::removeAllOutlines ( )

Definition at line 225 of file KernelManagerContour.cxx.

References modelManager, and OutlineModelManager::removeAllOutlines().

Referenced by wxContourMainFrame::deleteAllContours().

225  {
227 }

Here is the call graph for this function:

Here is the caller graph for this function:

void KernelManagerContour::resetAppend ( )

Definition at line 323 of file KernelManagerContour.cxx.

References _contourPropagation.

Referenced by wxContourMainFrame::resetAppend().

324 {
325  if (_contourPropagation!=NULL)
326  {
327  _contourPropagation->resetAppend();
328  }
329 }

Here is the caller graph for this function:

std::string KernelManagerContour::saveState ( )

Definition at line 293 of file KernelManagerContour.cxx.

References inredo, intToString(), inundo, and stundoredo.

Referenced by wxContourMainFrame::saveState().

293  {
294  inredo=0;
295  std::string str = intToString(inundo);
296  std::string temp = stundoredo + str + ".roi";
297  inundo++;
298  return temp;
299 }

Here is the call graph for this function:

Here is the caller graph for this function:

void KernelManagerContour::SaveThingName ( FILE *  pFile,
FILE *  pFileData,
std::string  name 
)

Definition at line 204 of file KernelManagerContour.cxx.

References modelManager, and OutlineModelManager::SaveThingName().

Referenced by wxContourMainFrame::saveFileWithContours().

204  {
205  modelManager->SaveThingName(pFile, pFileData, name);
206 }

Here is the call graph for this function:

Here is the caller graph for this function:

void KernelManagerContour::setCurrentFileName ( std::string  filenam)

Definition at line 516 of file KernelManagerContour.cxx.

References filename.

Referenced by wxContourMainFrame::onSave().

516  {
517  this->filename = filenam;
518 }

Here is the caller graph for this function:

void KernelManagerContour::setInstant ( Instant *  theInstant)

Definition at line 241 of file KernelManagerContour.cxx.

References modelManager, and OutlineModelManager::setInstant().

Referenced by wxContourMainFrame::changeInstant().

241  {
242  modelManager->setInstant(theInstant);
243  //_actualInstant = theInstant;
244 }

Here is the call graph for this function:

Here is the caller graph for this function:

void KernelManagerContour::setInstant ( std::vector< int >  vectInstant)

Definition at line 249 of file KernelManagerContour.cxx.

References modelManager, and OutlineModelManager::setInstant().

249  {
250  Instant* act = new Instant ( &vectInstant );
251  modelManager->setInstant(act);
252 }

Here is the call graph for this function:

void KernelManagerContour::setVectImages ( std::vector< vtkImageData * >  vectimg)

Definition at line 107 of file KernelManagerContour.cxx.

References vectimages, and vectimagesSpacing.

Referenced by KernelManagerContour().

108 {
109  double spc[3];
110  std::vector<double> vectspc;
111 
112  for(int i = 0; i < (int)(vectimg.size()); i++){
113  vtkImageData* img = vectimg[i];
114  vtkImageChangeInformation* change = vtkImageChangeInformation::New();
115  change->SetInformationInput(img);
116  change->SetInputConnection(img->GetProducerPort());
117 
118  img->GetSpacing(spc);
119  change->SetOutputSpacing(1,1,1);
120  change->Update();
121 
122  vectspc.clear();
123  vectspc.push_back(spc[0]);
124  vectspc.push_back(spc[1]);
125  vectspc.push_back(spc[2]);
126  vectimagesSpacing.push_back(vectspc);
127  vectimg[i] = change->GetOutput();
128  }
129 
130  vectimages = vectimg;
131 }

Here is the caller graph for this function:

Member Data Documentation

ContourPropagation* KernelManagerContour::_contourPropagation
private
int KernelManagerContour::_currentIndex
private

Definition at line 196 of file KernelManagerContour.h.

Referenced by getImageAtInstant(), and KernelManagerContour().

std::string KernelManagerContour::_datadir
private

Definition at line 198 of file KernelManagerContour.h.

Referenced by initializeEnvironment(), and parseOsirixFile().

std::string KernelManagerContour::filename
private

Definition at line 192 of file KernelManagerContour.h.

Referenced by getCurrentFileName(), and setCurrentFileName().

ImageSourceThing* KernelManagerContour::imageSource
private

Definition at line 186 of file KernelManagerContour.h.

Referenced by getSourceImage(), and initializeEnvironment().

int KernelManagerContour::inredo
private
int KernelManagerContour::inundo
private
std::string KernelManagerContour::stundoredo
private
std::vector<vtkImageData*> KernelManagerContour::vectimages
private
std::vector<std::vector<double> > KernelManagerContour::vectimagesSpacing
private

Definition at line 184 of file KernelManagerContour.h.

Referenced by GetSpacing(), and setVectImages().


The documentation for this class was generated from the following files: