]> Creatis software - creaVtk.git/commitdiff
#3499 boxes ImageGaussianSmooth2 MarchingCubes2
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Tue, 3 Jan 2023 10:00:23 +0000 (11:00 +0100)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Tue, 3 Jan 2023 10:00:23 +0000 (11:00 +0100)
bbtk_creaVtk_PKG/src/bbcreaVtkImageGaussianSmooth2.cxx
bbtk_creaVtk_PKG/src/bbcreaVtkMarchingCubes2.cxx

index 0d9040b84c9dbcd479175a8f5bef3584288a5485..4998bf90b5a673b7d1484c7b78142754aaf23720 100644 (file)
@@ -30,7 +30,12 @@ void ImageGaussianSmooth2::Process()
     
     if (bbGetInputIn()!=NULL)
     {
-        if (gaussiansmooth==NULL) { gaussiansmooth=vtkImageGaussianSmooth::New(); }
+        if (gaussiansmooth!=NULL)
+        {
+            gaussiansmooth->Delete();
+            gaussiansmooth = NULL;
+        }
+        gaussiansmooth=vtkImageGaussianSmooth::New();
         gaussiansmooth->SetInputData( bbGetInputIn() );
         gaussiansmooth->SetStandardDeviation( bbGetInputStdDevX() , bbGetInputStdDevY() , bbGetInputStdDevZ() );
         gaussiansmooth->Modified();
index e2d3b8e47e2cf2307f31c882d4af68920a5b68a4..7ad5b0eddc171fbc74d6b6f9dd13901d6d511ed0 100644 (file)
@@ -30,7 +30,12 @@ void MarchingCubes2::Process()
   
     if ( (bbGetInputActive()==true) && (bbGetInputIn()!=NULL) )
     {
-        if (marchingcubes==NULL) { marchingcubes=vtkMarchingCubes::New(); }
+        if (marchingcubes!=NULL)
+        {
+            marchingcubes->Delete();
+            marchingcubes = NULL;
+        }
+        marchingcubes=vtkMarchingCubes::New();
         marchingcubes->SetInputData( bbGetInputIn() );
         marchingcubes->SetValue(0, bbGetInputValue() );