X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=bbtk%2Fsrc%2FbbmaracasvisuContourToControlPoints.cxx;h=223a0337cd608c77f4e28258a50ca9b8f9c6fb19;hb=3283472f764535492122c3b2ade020a749c1bd2a;hp=f17182d16d420bdd1632d27555f1bbb20887d16c;hpb=800f29fd7e4cc70d8706b3075454e63f0b1a5717;p=creaMaracasVisu.git diff --git a/bbtk/src/bbmaracasvisuContourToControlPoints.cxx b/bbtk/src/bbmaracasvisuContourToControlPoints.cxx index f17182d..223a033 100644 --- a/bbtk/src/bbmaracasvisuContourToControlPoints.cxx +++ b/bbtk/src/bbmaracasvisuContourToControlPoints.cxx @@ -1,3 +1,28 @@ +/*# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ */ + #ifdef _USE_VTK_ #ifdef _USE_ITK_ @@ -104,7 +129,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 +138,10 @@ void ContourToControlPoints::Process() bbSetOutputControlPointZ( &OutContourZ ); bbSetOutputImagePropg( _imagedata ); } + + //------------------------------------------------------------ -void ContourToControlPoints::bbUserConstructor() +void ContourToControlPoints::bbUserSetDefaultValues() { bbSetInputSampling(5.0); bbSetInputSlice(0); @@ -125,23 +152,42 @@ 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; // JPRx - //bool inic = false; // JPRx -} -//------------------------------------------------------------ -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 bbcreaMaracasVisu