X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=bbtk%2Fsrc%2FbbCreaContournDimensions.cxx;h=336a7637b53964296a4f5c239c662f6fe72dc369;hb=50ec6e619f4affc65949b22b79662ba283818bc3;hp=c53e63787fbe754b63256fd65eda03cc327366d1;hpb=696cdf7e15e3a90613c358774bab4525987571f9;p=creaContours.git diff --git a/bbtk/src/bbCreaContournDimensions.cxx b/bbtk/src/bbCreaContournDimensions.cxx index c53e637..336a763 100644 --- a/bbtk/src/bbCreaContournDimensions.cxx +++ b/bbtk/src/bbCreaContournDimensions.cxx @@ -35,26 +35,35 @@ BBTK_BLACK_BOX_IMPLEMENTATION(nDimensions,bbtk::WxBlackBox); void nDimensions::Process() { - double **vectx = 0, **vecty = 0, **vectz = 0; - std::vector< void * > vectortemp; - std::vector size; - vtkImageData **mask = 0, **value = 0; - vtkImageData* img = bbGetInputIn(); - std::vector selectedimages; - if(img!=NULL && currentimg!=img) - { - wxContourMainFrame::getInstance()->ShowToolsPanel(true); - currentimg=img; - selectedimages.push_back(img); - wxContourMainFrame::getInstance()->configure(selectedimages); - } // if img - - if(currentimg != NULL) - { - int contourtype = bbGetInputContourType(); - //wxContourMainFrame::getInstance()->getValuesXYZ(vectx, vecty, vectz, &size); - //wxContourMainFrame::getInstance()->getMaskValue(mask, value, contourtype); - } // if currentimg +// double **vectx = 0, **vecty = 0, **vectz = 0; +// std::vector< void * > vectortemp; +// std::vector size; +// vtkImageData **mask = 0, **value = 0; + + if (firsttime==true) + { + firsttime=false; + std::vector selectedimages; + if(bbGetInputIn()!=NULL) + { + currentimg = bbGetInputIn(); + selectedimages.push_back( bbGetInputIn() ); + wxContourMainFrame::getInstance()->ShowToolsPanel(true); + wxContourMainFrame::getInstance()->configure(selectedimages); + } // if In + } else{ + + //wxContourMainFrame::getInstance()->getValuesXYZ(vectx, vecty, vectz, &size); + //wxContourMainFrame::getInstance()->getMaskValue(mask, value, contourtype); + + if ( currentimg!=bbGetInputIn() ) + { + wxContourMainFrame::getInstance()->changeImage(0, bbGetInputIn() ); + currentimg=bbGetInputIn(); + } // if currentimg!=In + + + } // if firsttime wxContourMainFrame::getInstance()->RefreshInterface(); bbSetOutputwxContourMainFrame( wxContourMainFrame::getInstance() ); // bbSetOutputX(vectx); @@ -108,7 +117,8 @@ printf("EED WARNING Verify that GetDllAppPath in nDimensions::CreateWidget bbCr //----------------------------------------------------------------- void nDimensions::bbUserSetDefaultValues() { - currentimg=NULL; + firsttime = true; + currentimg = NULL; bbSetInputContourType(0); bbSetInputIn(NULL); }