#include <KernelManagerContour.h>
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 | |
OutlineModelManager * | getOutlineModelManager () |
Private Attributes | |
std::vector< vtkImageData * > | vectimages |
std::vector< std::vector < double > > | vectimagesSpacing |
ImageSourceThing * | imageSource |
OutlineModelManager * | modelManager |
std::string | filename |
int | inredo |
int | inundo |
int | _currentIndex |
std::string | stundoredo |
std::string | _datadir |
ContourPropagation * | _contourPropagation |
Definition at line 29 of file KernelManagerContour.h.
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 8 of file KernelManagerContour.cxx.
References _contourPropagation, _currentIndex, inredo, intToString(), inundo, and stundoredo.
00008 { 00009 00010 00014 inredo = 0; 00015 inundo = 0; 00016 00017 time_t seconds; 00018 seconds = time (NULL); 00019 int time = seconds; 00020 00021 00022 stundoredo = "data/temp"+intToString(time); 00023 _currentIndex = 0; 00024 00025 _contourPropagation = NULL; 00026 #if(WIN32) 00027 mkdir(stundoredo.c_str()); 00028 #else 00029 mkdir(stundoredo.c_str(),755); 00030 #endif 00031 stundoredo += "/cont"; 00036 }
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 37 of file KernelManagerContour.cxx.
References _contourPropagation, _currentIndex, initializeEnvironment(), inredo, intToString(), inundo, setVectImages(), and stundoredo.
00038 { 00039 00040 00044 inredo = 0; 00045 inundo = 0; 00046 00047 time_t seconds; 00048 seconds = time (NULL); 00049 int time = seconds; 00050 00051 00052 stundoredo = tmpdir+"/temp"+intToString(time); 00053 _currentIndex = 0; 00054 00055 _contourPropagation = NULL; 00056 #if(WIN32) 00057 mkdir(tmpdir.c_str()); 00058 mkdir(stundoredo.c_str()); 00059 #else 00060 mkdir(tmpdir.c_str(),755); 00061 mkdir(stundoredo.c_str(),755); 00062 #endif 00063 stundoredo += "/cont"; 00067 setVectImages(images); 00068 initializeEnvironment(datadir); 00069 00070 }
KernelManagerContour::~KernelManagerContour | ( | ) |
void KernelManagerContour::CalculeSplinePropagation | ( | ) |
Definition at line 339 of file KernelManagerContour.cxx.
References _contourPropagation.
Referenced by wxContourMainFrame::onSpreadGo().
00340 { 00341 _contourPropagation->setInterpolationNumber(100); 00342 _contourPropagation->CalculeSplinePropagation(); 00343 }
void KernelManagerContour::changeContourOfManager | ( | std::string | keyName, | |
Instant * | instant | |||
) |
Definition at line 293 of file KernelManagerContour.cxx.
References OutlineModelManager::ChangeContourOfList(), and modelManager.
Referenced by wxContourMainFrame::onRigidPressed(), and wxContourMainFrame::openContours().
00294 { 00295 modelManager->ChangeContourOfList(keyName, instant); 00296 }
std::string KernelManagerContour::createCopyContourOf | ( | std::string | anExistingKName, | |
std::vector< int > & | instantNoTouchData | |||
) |
Definition at line 229 of file KernelManagerContour.cxx.
References OutlineModelManager::createCopyContourOf(), and modelManager.
Referenced by wxContourMainFrame::createCopyContourOf(), and wxContourMainFrame::createMirrorContourOf().
00230 { 00231 return modelManager->createCopyContourOf(anExistingKName, instantNoTouchData); 00232 }
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 156 of file KernelManagerContour.cxx.
References OutlineModelManager::createOutline(), and modelManager.
Referenced by wxContourMainFrame::createContour(), wxContourMainFrame::onCreateContourBullEye(), wxContourMainFrame::openContours(), wxContourMainFrame::SegmentationOneSlice(), and wxContourMainFrame::SegmentationOneSliceITK().
00156 { 00157 return modelManager->createOutline( manModelContour, instantVector ); 00158 }
void KernelManagerContour::deleteCModel | ( | std::string | theKeyName | ) |
Definition at line 193 of file KernelManagerContour.cxx.
References ContourThing::getModel(), OutlineModelManager::getOutlineByKeyName(), modelManager, and OutlineModelManager::removeOutline().
Referenced by wxContourMainFrame::deleteContour().
00193 { 00194 manualBaseModel* cModel = modelManager->getOutlineByKeyName(theKeyName)->getModel(); 00195 modelManager->removeOutline( theKeyName ); 00196 00197 delete cModel; 00198 }
std::vector< manualBaseModel * > KernelManagerContour::ExploseEachModel | ( | std::vector< manualBaseModel * > | lstManConMod | ) |
Definition at line 455 of file KernelManagerContour.cxx.
Referenced by wxContourMainFrame::getMaskValue(), wxContourMainFrame::onInformationContourLabels(), and wxContourMainFrame::SaveValuesXYZ().
00455 { 00456 std::vector<manualBaseModel*> lstTmp; 00457 std::vector<manualBaseModel*> lstResult; 00458 int j,jSize; 00459 int i,iSize=lstManConMod.size(); 00460 for (i=0;i<iSize;i++) 00461 { 00462 lstTmp = lstManConMod[i]->ExploseModel(); 00463 jSize=lstTmp.size(); 00464 for (j=0;j<jSize;j++) 00465 { 00466 lstResult.push_back( lstTmp[j] ); 00467 } 00468 } 00469 return lstResult; 00470 }
manualBaseModel * KernelManagerContour::factoryManualContourModel | ( | int | typeContour | ) |
Definition at line 388 of file KernelManagerContour.cxx.
Referenced by wxContourMainFrame::createContour(), GetPoints(), wxContourMainFrame::openContours(), wxContourMainFrame::SegmentationOneSlice(), and wxContourMainFrame::SegmentationOneSliceITK().
00389 { 00390 manualBaseModel *manModelContour=NULL; 00391 00392 // Creating the model 00393 // NOTE: The view and the controler are created in the wxVtkBaseView_SceneManager class, configureViewControlTo method 00394 00395 // spline 00396 if (typeContour==0) 00397 { 00398 manModelContour = new manualContourModel(); 00399 } 00400 00401 // spline 00402 if (typeContour==1) 00403 { 00404 manModelContour = new manualContourModel(); 00405 } 00406 00407 // rectangle 00408 if (typeContour==2) 00409 { 00410 manModelContour = new manualContourModelRoi(); 00411 } 00412 00413 // circle 00414 if (typeContour==3) 00415 { 00416 manModelContour = new manualContourModelCircle(); 00417 } 00418 00419 // line 00420 if (typeContour==6) 00421 { 00422 manModelContour = new manualContourModelLine(); 00423 } 00424 00425 // points 00426 if (typeContour==7) 00427 { 00428 manModelContour = new manualBaseModel(); 00429 } 00430 00431 // polygon 00432 if (typeContour==10) 00433 { 00434 manModelContour = new manualContourModelPolygon(); 00435 } 00436 00437 return manModelContour; 00438 }
std::vector< NameWrapper * > KernelManagerContour::getActualInstantOutlines | ( | ) |
Definition at line 204 of file KernelManagerContour.cxx.
References OutlineModelManager::getActualInstantOutlines(), and modelManager.
Referenced by getNamesWrappingSize(), and getNameWrapping().
00204 { 00205 return modelManager->getActualInstantOutlines(); 00206 }
void KernelManagerContour::getConceptsInformation | ( | std::vector< std::string > & | conceptNameVect, | |
std::vector< int > & | conceptSizeVect | |||
) |
Definition at line 472 of file KernelManagerContour.cxx.
References modelManager.
Referenced by wxContourMainFrame::setVectImages().
00472 { 00473 modelManager-> getConceptsInformation(conceptNameVect, conceptSizeVect); 00474 }
std::string KernelManagerContour::getCurrentFileName | ( | ) |
Definition at line 487 of file KernelManagerContour.cxx.
References filename.
Referenced by wxContourMainFrame::saveFileWithContoursAutomatique().
00487 { 00488 return filename; 00489 }
Instant * KernelManagerContour::getCurrentInstant | ( | ) |
Definition at line 221 of file KernelManagerContour.cxx.
References OutlineModelManager::getInstant(), and modelManager.
00221 { 00222 return modelManager->getInstant(); 00223 }
vtkImageData * KernelManagerContour::getImageAtInstant | ( | std::vector< int > | inst | ) |
Definition at line 477 of file KernelManagerContour.cxx.
References _currentIndex, and vectimages.
Referenced by wxContourMainFrame::updateInstantImageData().
00477 { 00478 int index = inst[5]-1; 00479 00480 if(index < (int)(vectimages.size())&&index!=_currentIndex){ 00481 _currentIndex=index; 00482 return vectimages[index]; 00483 } 00484 return NULL; 00485 }
std::vector< std::string > KernelManagerContour::GetLstNameThings | ( | ) |
Definition at line 182 of file KernelManagerContour.cxx.
References OutlineModelManager::GetLstNameThings(), and modelManager.
Referenced by wxContourMainFrame::saveFileWithContours().
00182 { 00183 return modelManager->GetLstNameThings(); 00184 }
std::vector< std::string > KernelManagerContour::GetLstNameThingsStatic | ( | ) |
Definition at line 175 of file KernelManagerContour.cxx.
References OutlineModelManager::GetLstNameThingsStatic(), and modelManager.
Referenced by wxContourMainFrame::saveFileWithContours().
00175 { 00176 return modelManager->GetLstNameThingsStatic(); 00177 }
void KernelManagerContour::getMaxMinZ | ( | double * | minZ, | |
double * | maxZ | |||
) |
Definition at line 330 of file KernelManagerContour.cxx.
References _contourPropagation.
Referenced by wxContourMainFrame::onSpreadGo().
00331 { 00332 if (_contourPropagation!=NULL) 00333 { 00334 _contourPropagation->getMaxMinZ(minZ, maxZ); 00335 } 00336 }
int KernelManagerContour::getNamesWrappingSize | ( | ) |
Definition at line 208 of file KernelManagerContour.cxx.
References getActualInstantOutlines().
Referenced by wxContourMainFrame::getNamesWrappingSize().
00208 { 00209 return getActualInstantOutlines().size(); 00210 }
std::string KernelManagerContour::getNameWrapping | ( | int | i | ) |
Definition at line 212 of file KernelManagerContour.cxx.
References getActualInstantOutlines().
Referenced by wxContourMainFrame::getNameWrapping().
00212 { 00213 return getActualInstantOutlines()[i]->getKeyName(); 00214 }
manualBaseModel * KernelManagerContour::getOutlineByKeyName | ( | std::string | cloneName | ) |
Definition at line 234 of file KernelManagerContour.cxx.
References ContourThing::getModel(), OutlineModelManager::getOutlineByKeyName(), and modelManager.
Referenced by wxContourMainFrame::createCopyContourOf(), wxContourMainFrame::createMirrorContourOf(), wxContourMainFrame::getContour(), wxContourMainFrame::getContourSizeInPixels(), wxContourMainFrame::getType(), and wxContourMainFrame::saveFileWithContours().
00235 { 00236 return modelManager->getOutlineByKeyName (cloneName )->getModel(); 00237 }
OutlineModelManager * KernelManagerContour::getOutlineModelManager | ( | ) | [private] |
Definition at line 152 of file KernelManagerContour.cxx.
References modelManager.
00152 { 00153 return modelManager; 00154 }
std::vector< ContourThing ** > KernelManagerContour::getOutlinesAtInstant | ( | Instant * | instant | ) |
Definition at line 451 of file KernelManagerContour.cxx.
References OutlineModelManager::getOutlinesAtInstant(), and modelManager.
Referenced by wxContourMainFrame::getMaskValue(), wxContourMainFrame::onInformationContourLabels(), wxContourMainFrame::onSpreadAddAll(), and wxContourMainFrame::SaveValuesXYZ().
00451 { 00452 return modelManager->getOutlinesAtInstant(instant); 00453 }
std::vector< std::string > KernelManagerContour::getOutlinesNameAtInstant | ( | std::vector< int > | tempvector | ) |
Definition at line 440 of file KernelManagerContour.cxx.
References OutlineModelManager::getOutlinesAtInstant(), and modelManager.
Referenced by wxContourMainFrame::getOutlinesName().
00440 { 00441 Instant instant(&tempvector); 00442 std::vector<ContourThing**> vectcont = modelManager->getOutlinesAtInstant( &instant ); 00443 std::vector<std::string> vectname; 00444 for(int i = 0; i < (int)(vectcont.size()); i++){ 00445 ContourThing **contourthing = vectcont[i]; 00446 vectname.push_back((*contourthing)->getName()); 00447 } 00448 return vectname; 00449 }
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 345 of file KernelManagerContour.cxx.
References _contourPropagation, OutlineModelManager::createOutline(), factoryManualContourModel(), and modelManager.
Referenced by wxContourMainFrame::onSpreadGo().
00346 { 00347 bool addedModel = false; 00348 manualBaseModel* manModelContour=NULL; 00349 00350 if (_contourPropagation->ifSliceKeyContourExist(z)==false){ 00351 00352 manModelContour = factoryManualContourModel( typeofcontour ); 00353 00354 int idTmp = _contourPropagation->FindIdWithZ(z); 00355 00356 if (type==0) // Initial Points 00357 { 00358 _contourPropagation->GetInitialControlPoints( idTmp , vecCtrlPointX,vecCtrlPointY,vecCtrlPointZ); 00359 } 00360 if (type==1) // Automatique Method 00361 { 00362 _contourPropagation->GetControlPoints( idTmp ,vecCtrlPointX,vecCtrlPointY,vecCtrlPointZ); 00363 } 00364 if (type==2) // sampling 00365 { 00366 _contourPropagation->GetControlPoints( idTmp , 20.0 ,vecCtrlPointX,vecCtrlPointY,vecCtrlPointZ); 00367 } 00368 //-------------------------------------------------------------------- 00369 int sizeCtrPt = vecCtrlPointX->size(); 00370 for (int j=0 ; j<sizeCtrPt ; j++) 00371 { 00372 //JSTG_16-07-08_---------------------------------------------------------------- 00373 manModelContour->AddPoint( (*vecCtrlPointX)[j] , (*vecCtrlPointY)[j] , -900 ); 00374 //-------------------------------------------------------------------- 00375 } // for j 00376 00377 tempVector[1]=z; 00378 theName = modelManager->createOutline( manModelContour, tempVector ); 00379 addedModel = theName.compare("") != 0; 00380 if(!addedModel){ 00381 manModelContour = NULL; 00382 } 00383 00384 }// ifSliceKeyContourExist 00385 return manModelContour; 00386 }
vtkImageData * KernelManagerContour::getSourceImage | ( | ) |
This method returns the source of the image data selected by the user.
Definition at line 149 of file KernelManagerContour.cxx.
References ImageSourceThing::getSourceImage(), and imageSource.
Referenced by parseOsirixFile(), and wxContourMainFrame::setVectImages().
00149 { 00150 return imageSource->getSourceImage(); 00151 }
void KernelManagerContour::GetSpacing | ( | double * | vecspc, | |
int | iImage | |||
) |
Definition at line 109 of file KernelManagerContour.cxx.
References vectimagesSpacing.
Referenced by wxContourMainFrame::SaveImageResult().
00110 { 00111 vecspc[0]=vectimagesSpacing[iImage][0]; 00112 vecspc[1]=vectimagesSpacing[iImage][1]; 00113 vecspc[2]=vectimagesSpacing[iImage][2]; 00114 }
std::vector< vtkImageData * > KernelManagerContour::getVectImages | ( | ) |
Definition at line 76 of file KernelManagerContour.cxx.
References vectimages.
Referenced by wxContourMainFrame::getVectImages().
00077 { 00078 return vectimages; 00079 }
void KernelManagerContour::initializeEnvironment | ( | std::string | datadir | ) |
Definition at line 117 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().
00117 { 00118 _datadir = datadir; 00119 std::string conceptsFN = datadir+"holaConceptsFile.cf"; 00120 std::string imageSourcesFN = datadir+"holaImagesInstantsFile.of"; 00121 std::string imageSectionsFN = ""; 00122 std::string axeThingsFN = ""; 00123 00124 std::map<std::string, ImageSourceThing *> * sourcesMap = new std::map<std::string, ImageSourceThing *>(); 00125 std::map<std::string, ImageSectionThing *>* sectionsMap = new std::map<std::string, ImageSectionThing *>(); 00126 std::map<std::string, AxeThing *>* axesMap = new std::map<std::string, AxeThing *>(); 00127 std::map<std::string, ContourThing *>* outlinesMap = new std::map<std::string, ContourThing *>(); 00128 00129 for(int i = 0; i < (int)(vectimages.size()); i++){ 00130 vtkImageData* selectedimage = vectimages[i]; 00131 ImageSourceThing * thing = new ImageSourceThing(selectedimage); 00132 std::string imgstring = "Source Image "+intToString(i+1); 00133 sourcesMap->insert(std::pair<std::string, ImageSourceThing *>( imgstring, thing)); 00134 } 00135 00136 00137 OutlineModelBuilder * _builder = new OutlineModelBuilder( conceptsFN ,datadir); 00138 _builder->buildImageSource_Envornment( imageSourcesFN, sourcesMap ); 00139 _builder->buildImageSection_Envornment( imageSectionsFN, sectionsMap ); 00140 _builder->buildAxe_Envornment(axeThingsFN, axesMap ); 00141 _builder->buildCountour_Envornment( imageSectionsFN, outlinesMap ); 00142 00143 //Creating the objects to manage 00144 modelManager = new OutlineModelManager( _builder->getImSourceEnv(), _builder->getImSectionEnv(), _builder->getAxesEnv(), _builder->getContourEnv() ); 00145 00146 imageSource = modelManager->getImageSourceThingByKeyName( "Source Image 1" ); 00147 00148 }
std::string KernelManagerContour::intToString | ( | int | num | ) |
Definition at line 160 of file KernelManagerContour.cxx.
Referenced by initializeEnvironment(), KernelManagerContour(), onRedo(), onSpreadAdd(), wxContourMainFrame::onSpreadGo(), onUndo(), onUndoSaveFile(), saveState(), and wxContourMainFrame::SaveValuesXYZ().
00160 { 00161 std::string result; 00162 if(num == 0){ 00163 result = "0"; 00164 }else{ 00165 int k=num; 00166 while (k > 0){ 00167 char temp = k % 10 + 48; 00168 k = k / 10; 00169 result = temp + result; 00170 } 00171 } 00172 return result; 00173 }
bool KernelManagerContour::IsPartOfStaticList | ( | std::string | keyName | ) |
Definition at line 189 of file KernelManagerContour.cxx.
References OutlineModelManager::IsPartOfStaticList(), and modelManager.
Referenced by wxContourMainFrame::deleteContour().
00189 { 00190 return modelManager->IsPartOfStaticList(theKeyName) == -1; 00191 }
bool KernelManagerContour::onRedo | ( | std::string & | filename | ) |
Definition at line 239 of file KernelManagerContour.cxx.
References inredo, intToString(), inundo, and stundoredo.
Referenced by wxContourMainFrame::onRedo().
00239 { 00240 if(inredo > 0){ 00241 inredo--; 00242 inundo++; 00243 std::string str = intToString(inundo); 00244 filename = stundoredo + str + ".roi"; 00245 //loadState(temp); 00246 return true; 00247 } 00248 return false; 00249 }
std::string KernelManagerContour::onSpreadAdd | ( | std::vector< double > * | vecX, | |
std::vector< double > * | vecY, | |||
std::vector< double > * | vecZ, | |||
std::vector< int > | instants | |||
) |
Definition at line 307 of file KernelManagerContour.cxx.
References _contourPropagation, and intToString().
Referenced by wxContourMainFrame::onSpreadAdd(), and wxContourMainFrame::onSpreadAddAll().
00308 { 00309 if (_contourPropagation==NULL) 00310 { 00311 _contourPropagation = new ContourPropagation(); 00312 } 00313 00314 if (vecX->size()!=0){ 00315 00316 int i,size=vecZ->size(); 00317 int actualSlice = instants[1]; 00318 for ( i=0 ; i<size ; i++ ) 00319 { 00320 (*vecZ)[i] = actualSlice; 00321 } // for 00322 00323 _contourPropagation->appendContour(vecX , vecY , vecZ); 00324 return intToString(actualSlice); 00325 } 00326 return ""; 00327 }
bool KernelManagerContour::onUndo | ( | std::string & | filename | ) |
Definition at line 251 of file KernelManagerContour.cxx.
References inredo, intToString(), inundo, and stundoredo.
Referenced by wxContourMainFrame::onUndo().
00251 { 00252 if(inundo>0){ 00253 inredo++; 00254 inundo--; 00255 00256 //char str[9000]; 00257 //itoa(inundo, str, 10); 00258 std::string str = intToString(inundo); 00259 00260 00261 filename = stundoredo + str + ".roi"; 00262 00263 return true;//loadState(temp); 00264 } 00265 return false; 00266 }
bool KernelManagerContour::onUndoSaveFile | ( | std::string & | filename | ) |
Definition at line 276 of file KernelManagerContour.cxx.
References inredo, intToString(), inundo, and stundoredo.
Referenced by wxContourMainFrame::onUndo().
00276 { 00277 if(inundo>0){ 00278 if(inredo==0){ 00279 00280 //char str[9000]; 00281 //itoa(inundo, str, 10); 00282 std::string str = intToString(inundo); 00283 00284 filename = stundoredo + str + ".roi"; 00285 return true; 00286 //saveFileWithContours(temp); 00287 00288 } 00289 } 00290 return false; 00291 }
std::string KernelManagerContour::parseOsirixFile | ( | std::string | filename | ) |
Definition at line 495 of file KernelManagerContour.cxx.
References _datadir, and getSourceImage().
Referenced by wxContourMainFrame::onImport().
00495 { 00496 00497 00498 #ifdef ParserOsirix_BUILD 00499 vtkImageData* sourceimage; 00500 std::string xsdfile; 00501 00502 xsdfile = _datadir; 00503 00504 xsdfile.append("\\XML\\osirixschema.xsd"); 00505 00506 sourceimage = getSourceImage(); 00507 OsirixParser p(xsdfile.c_str(), sourceimage->GetSpacing(), sourceimage->GetExtent()); 00508 00509 if(p.ParseFile(filename.c_str())!= 0){ 00510 00511 } 00512 00513 return p.getContoursFileName(); 00514 #else 00515 return ""; 00516 #endif 00517 00518 00519 }
void KernelManagerContour::removeAllOutlines | ( | ) |
Definition at line 200 of file KernelManagerContour.cxx.
References modelManager, and OutlineModelManager::removeAllOutlines().
Referenced by wxContourMainFrame::deleteAllContours().
00200 { 00201 modelManager->removeAllOutlines(); 00202 }
void KernelManagerContour::resetAppend | ( | ) |
Definition at line 298 of file KernelManagerContour.cxx.
References _contourPropagation.
Referenced by wxContourMainFrame::resetAppend().
00299 { 00300 if (_contourPropagation!=NULL) 00301 { 00302 _contourPropagation->resetAppend(); 00303 } 00304 }
std::string KernelManagerContour::saveState | ( | ) |
Definition at line 268 of file KernelManagerContour.cxx.
References inredo, intToString(), inundo, and stundoredo.
Referenced by wxContourMainFrame::saveState().
00268 { 00269 inredo=0; 00270 std::string str = intToString(inundo); 00271 std::string temp = stundoredo + str + ".roi"; 00272 inundo++; 00273 return temp; 00274 }
void KernelManagerContour::SaveThingName | ( | FILE * | pFile, | |
FILE * | pFileData, | |||
std::string | name | |||
) |
Definition at line 179 of file KernelManagerContour.cxx.
References modelManager, and OutlineModelManager::SaveThingName().
Referenced by wxContourMainFrame::saveFileWithContours().
00179 { 00180 modelManager->SaveThingName(pFile, pFileData, name); 00181 }
void KernelManagerContour::setCurrentFileName | ( | std::string | filenam | ) |
Definition at line 491 of file KernelManagerContour.cxx.
References filename.
Referenced by wxContourMainFrame::onSave().
00491 { 00492 this->filename = filenam; 00493 }
void KernelManagerContour::setInstant | ( | std::vector< int > | vectInstant | ) |
Definition at line 224 of file KernelManagerContour.cxx.
References modelManager, and OutlineModelManager::setInstant().
00224 { 00225 Instant* act = new Instant ( &vectInstant ); 00226 modelManager->setInstant(act); 00227 }
void KernelManagerContour::setInstant | ( | Instant * | theInstant | ) |
Definition at line 216 of file KernelManagerContour.cxx.
References modelManager, and OutlineModelManager::setInstant().
Referenced by wxContourMainFrame::changeInstant().
00216 { 00217 modelManager->setInstant(theInstant); 00218 //_actualInstant = theInstant; 00219 }
void KernelManagerContour::setVectImages | ( | std::vector< vtkImageData * > | vectimg | ) |
Definition at line 82 of file KernelManagerContour.cxx.
References vectimages, and vectimagesSpacing.
Referenced by KernelManagerContour().
00083 { 00084 double spc[3]; 00085 std::vector<double> vectspc; 00086 00087 for(int i = 0; i < (int)(vectimg.size()); i++){ 00088 vtkImageData* img = vectimg[i]; 00089 vtkImageChangeInformation* change = vtkImageChangeInformation::New(); 00090 change->SetInformationInput(img); 00091 change->SetInputConnection(img->GetProducerPort()); 00092 00093 img->GetSpacing(spc); 00094 change->SetOutputSpacing(1,1,1); 00095 change->Update(); 00096 00097 vectspc.clear(); 00098 vectspc.push_back(spc[0]); 00099 vectspc.push_back(spc[1]); 00100 vectspc.push_back(spc[2]); 00101 vectimagesSpacing.push_back(vectspc); 00102 vectimg[i] = change->GetOutput(); 00103 } 00104 00105 vectimages = vectimg; 00106 }
ContourPropagation* KernelManagerContour::_contourPropagation [private] |
Definition at line 175 of file KernelManagerContour.h.
Referenced by CalculeSplinePropagation(), getMaxMinZ(), GetPoints(), KernelManagerContour(), onSpreadAdd(), and resetAppend().
int KernelManagerContour::_currentIndex [private] |
Definition at line 171 of file KernelManagerContour.h.
Referenced by getImageAtInstant(), and KernelManagerContour().
std::string KernelManagerContour::_datadir [private] |
Definition at line 173 of file KernelManagerContour.h.
Referenced by initializeEnvironment(), and parseOsirixFile().
std::string KernelManagerContour::filename [private] |
Definition at line 167 of file KernelManagerContour.h.
Referenced by getCurrentFileName(), and setCurrentFileName().
Definition at line 161 of file KernelManagerContour.h.
Referenced by getSourceImage(), and initializeEnvironment().
int KernelManagerContour::inredo [private] |
Definition at line 169 of file KernelManagerContour.h.
Referenced by KernelManagerContour(), onRedo(), onUndo(), onUndoSaveFile(), and saveState().
int KernelManagerContour::inundo [private] |
Definition at line 170 of file KernelManagerContour.h.
Referenced by KernelManagerContour(), onRedo(), onUndo(), onUndoSaveFile(), and saveState().
Definition at line 165 of file KernelManagerContour.h.
Referenced by changeContourOfManager(), createCopyContourOf(), createOutline(), deleteCModel(), getActualInstantOutlines(), getConceptsInformation(), getCurrentInstant(), GetLstNameThings(), GetLstNameThingsStatic(), getOutlineByKeyName(), getOutlineModelManager(), getOutlinesAtInstant(), getOutlinesNameAtInstant(), GetPoints(), initializeEnvironment(), IsPartOfStaticList(), removeAllOutlines(), SaveThingName(), and setInstant().
std::string KernelManagerContour::stundoredo [private] |
Definition at line 172 of file KernelManagerContour.h.
Referenced by KernelManagerContour(), onRedo(), onUndo(), onUndoSaveFile(), and saveState().
std::vector<vtkImageData*> KernelManagerContour::vectimages [private] |
Definition at line 158 of file KernelManagerContour.h.
Referenced by getImageAtInstant(), getVectImages(), initializeEnvironment(), and setVectImages().
std::vector<std::vector<double> > KernelManagerContour::vectimagesSpacing [private] |
Definition at line 159 of file KernelManagerContour.h.
Referenced by GetSpacing(), and setVectImages().