X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=bbtk%2Fsrc%2FbbmaracasvisuContourToControlPoints.cxx;h=fabcee39a1fa987b90ee9b1649aebb0555d18cd3;hb=1e114d2e85dfcbb93b774b5aa43bc96a2293c4e7;hp=469155835e3e35154f636a10d1bafe9173e5a851;hpb=44e4be7013ea566bd2bdefb9d48e1da0071c3d91;p=creaMaracasVisu.git diff --git a/bbtk/src/bbmaracasvisuContourToControlPoints.cxx b/bbtk/src/bbmaracasvisuContourToControlPoints.cxx index 4691558..fabcee3 100644 --- a/bbtk/src/bbmaracasvisuContourToControlPoints.cxx +++ b/bbtk/src/bbmaracasvisuContourToControlPoints.cxx @@ -2,11 +2,11 @@ #ifdef _USE_ITK_ #include "bbmaracasvisuContourToControlPoints.h" -#include "bbmaracasvisuPackage.h" -namespace bbmaracasvisu +#include "bbcreaMaracasVisuPackage.h" +namespace bbcreaMaracasVisu { -BBTK_ADD_BLACK_BOX_TO_PACKAGE(maracasvisu,ContourToControlPoints) +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ContourToControlPoints) //BBTK_USER_BLACK_BOX_IMPLEMENTATION(ContourToControlPoints,bbtk::AtomicBlackBox); BBTK_BLACK_BOX_IMPLEMENTATION(ContourToControlPoints,bbtk::AtomicBlackBox); @@ -104,7 +104,7 @@ void ContourToControlPoints::Process() _contprop->appendContour(&KeyContourX,&KeyContourY,&KeyContourZ); //_contprop->GetContour(bbGetInputSlice(),&OutContourX,&OutContourY,&OutContourZ); _contprop->GetControlPoints(bbGetInputSlice(),&OutContourX,&OutContourY,&OutContourZ); - printf("\n Size OutContourX = %d",OutContourX.size()); + printf("\n Size OutContourX = %d",(int)(OutContourX.size())); } } @@ -113,8 +113,10 @@ void ContourToControlPoints::Process() bbSetOutputControlPointZ( &OutContourZ ); bbSetOutputImagePropg( _imagedata ); } + + //------------------------------------------------------------ -void ContourToControlPoints::bbUserConstructor() +void ContourToControlPoints::bbUserSetDefaultValues() { bbSetInputSampling(5.0); bbSetInputSlice(0); @@ -125,26 +127,45 @@ void ContourToControlPoints::bbUserConstructor() bbSetInputOption(1); bbSetInputLoadContour(0); + _contprop = NULL; + _propgdata = NULL; + _imagedata = NULL; + _ext2D = NULL; + + _fd = NULL; + pos = 0; +} + + + //----------------------------------------------------------------- + void ContourToControlPoints::bbUserInitializeProcessing() + { _contprop = new ContourPropagation(); _propgdata = new PropContour(); _imagedata = vtkImageData::New(); _ext2D = new ExtractControlPoints2D(); - _fd = NULL; - pos = 0; - it = NULL; - bool inic = false; -} -//------------------------------------------------------------ -void ContourToControlPoints::bbUserCopyConstructor() -{ -} -//------------------------------------------------------------ -void ContourToControlPoints::bbUserDestructor() -{ -} + } + + //----------------------------------------------------------------- + void ContourToControlPoints::bbUserFinalizeProcessing() + { + if (_contprop!=NULL) delete _contprop; + if (_propgdata!=NULL) delete _propgdata; + if (_imagedata!=NULL) _imagedata->Delete(); + if (_ext2D!=NULL) delete _ext2D; + + _contprop = NULL; + _propgdata = NULL; + _imagedata = NULL; + _ext2D = NULL; + } + + //----------------------------------------------------------------- + + } -// EO namespace bbmaracasvisu +// EO namespace bbcreaMaracasVisu #endif //_USE_ITK_ #endif //_USE_VTK_