]> Creatis software - creaMaracasVisu.git/blobdiff - bbtk/src/bbmaracasvisuContourToControlPoints.cxx
#3012 creaMaracasVisu Bug New Normal - Update Image in ViewerNV #3065 creaMara...
[creaMaracasVisu.git] / bbtk / src / bbmaracasvisuContourToControlPoints.cxx
index f17182d16d420bdd1632d27555f1bbb20887d16c..223a0337cd608c77f4e28258a50ca9b8f9c6fb19 100644 (file)
@@ -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