From 46c5664241157c3d47b97d01b39a1817b84d5e31 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Tue, 3 Jan 2023 11:00:23 +0100 Subject: [PATCH] #3499 boxes ImageGaussianSmooth2 MarchingCubes2 --- bbtk_creaVtk_PKG/src/bbcreaVtkImageGaussianSmooth2.cxx | 7 ++++++- bbtk_creaVtk_PKG/src/bbcreaVtkMarchingCubes2.cxx | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageGaussianSmooth2.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkImageGaussianSmooth2.cxx index 0d9040b..4998bf9 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkImageGaussianSmooth2.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageGaussianSmooth2.cxx @@ -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(); diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkMarchingCubes2.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkMarchingCubes2.cxx index e2d3b8e..7ad5b0e 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkMarchingCubes2.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkMarchingCubes2.cxx @@ -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() ); -- 2.47.1