From 1d7dc1ec3317d7e075251e2f6e61e353adbb20a9 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Fri, 21 Mar 2014 15:28:20 +0100 Subject: [PATCH] 2344 BBTK Bug New Normal Conflict between Update and Modfied vtk filters --- packages/vtk/src/bbvtkBinaryOperations.cxx | 1 + packages/vtk/src/bbvtkExtractVtkImageFilter.cxx | 1 + packages/vtk/src/bbvtkImageCastToUShort.cxx | 1 + packages/vtk/src/bbvtkImageContinuousDilate3D.xml | 1 + packages/vtk/src/bbvtkImageContinuousErode3D.xml | 1 + packages/vtk/src/bbvtkImageDilateErode3D.xml | 1 + packages/vtk/src/bbvtkImageGaussianSmooth.xml | 3 ++- packages/vtk/src/bbvtkSegmentationConnectivity.cxx | 3 +++ packages/vtk/src/bbvtkUnaryOperations.cxx | 1 + packages/vtk/src/bbvtkVecImageGaussianSmooth.cxx | 1 + 10 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/vtk/src/bbvtkBinaryOperations.cxx b/packages/vtk/src/bbvtkBinaryOperations.cxx index 4689f75..774cd19 100644 --- a/packages/vtk/src/bbvtkBinaryOperations.cxx +++ b/packages/vtk/src/bbvtkBinaryOperations.cxx @@ -90,6 +90,7 @@ void BinaryOperations::Process() break; } + ope->Modified(); ope->Update(); vtkImageData* salida = ope->GetOutput(); diff --git a/packages/vtk/src/bbvtkExtractVtkImageFilter.cxx b/packages/vtk/src/bbvtkExtractVtkImageFilter.cxx index 50f8618..efbbe22 100644 --- a/packages/vtk/src/bbvtkExtractVtkImageFilter.cxx +++ b/packages/vtk/src/bbvtkExtractVtkImageFilter.cxx @@ -52,6 +52,7 @@ void ExtractVtkImageFilter::Process() _extract->SetInput( bbGetInputIn() ); _extract->SetVOI(voi); _extract->UpdateWholeExtent(); + _extract->Modified(); _extract->Update(); bbSetOutputOut(_extract->GetOutput()); } diff --git a/packages/vtk/src/bbvtkImageCastToUShort.cxx b/packages/vtk/src/bbvtkImageCastToUShort.cxx index 8e60e7e..6543e06 100644 --- a/packages/vtk/src/bbvtkImageCastToUShort.cxx +++ b/packages/vtk/src/bbvtkImageCastToUShort.cxx @@ -50,6 +50,7 @@ void ImageCastToUShort::Process() vtkImageData* img = bbGetInputIn(); cast->SetInput(img); cast->SetOutputScalarTypeToUnsignedShort(); + cast->Modified(); cast->Update(); bbSetOutputOut(cast->GetOutput() ); } diff --git a/packages/vtk/src/bbvtkImageContinuousDilate3D.xml b/packages/vtk/src/bbvtkImageContinuousDilate3D.xml index a076486..31a11c3 100644 --- a/packages/vtk/src/bbvtkImageContinuousDilate3D.xml +++ b/packages/vtk/src/bbvtkImageContinuousDilate3D.xml @@ -22,6 +22,7 @@ bbGetVtkObject()->SetKernelSize(bbGetInputKernelSizeX(), bbGetInputKernelSizeY(), bbGetInputKernelSizeZ()); +bbGetVtkObject()->Modified(); bbGetVtkObject()->Update(); diff --git a/packages/vtk/src/bbvtkImageContinuousErode3D.xml b/packages/vtk/src/bbvtkImageContinuousErode3D.xml index 07a98d0..f132606 100644 --- a/packages/vtk/src/bbvtkImageContinuousErode3D.xml +++ b/packages/vtk/src/bbvtkImageContinuousErode3D.xml @@ -22,6 +22,7 @@ bbGetVtkObject()->SetKernelSize(bbGetInputKernelSizeX(), bbGetInputKernelSizeY(), bbGetInputKernelSizeZ()); +bbGetVtkObject()->Modified(); bbGetVtkObject()->Update(); diff --git a/packages/vtk/src/bbvtkImageDilateErode3D.xml b/packages/vtk/src/bbvtkImageDilateErode3D.xml index 352d436..2f7c2e2 100644 --- a/packages/vtk/src/bbvtkImageDilateErode3D.xml +++ b/packages/vtk/src/bbvtkImageDilateErode3D.xml @@ -24,6 +24,7 @@ bbGetVtkObject()->SetKernelSize(bbGetInputKernelSizeX(), bbGetInputKernelSizeY(), bbGetInputKernelSizeZ()); +bbGetVtkObject()->Modified(); bbGetVtkObject()->Update(); diff --git a/packages/vtk/src/bbvtkImageGaussianSmooth.xml b/packages/vtk/src/bbvtkImageGaussianSmooth.xml index b7450d2..3c3dd79 100644 --- a/packages/vtk/src/bbvtkImageGaussianSmooth.xml +++ b/packages/vtk/src/bbvtkImageGaussianSmooth.xml @@ -19,10 +19,11 @@
-    printf("EED ImageGaussianSmooth::Process start \n");
+    printf("EED ImageGaussianSmooth::Process start a\n");
     bbGetVtkObject()->SetStandardDeviation(bbGetInputStdDevX(), 
                      			bbGetInputStdDevY(), 
                      			bbGetInputStdDevZ());
+    bbGetVtkObject()->Modified();
     bbGetVtkObject()->Update();
     printf("EED ImageGaussianSmooth::Process end \n");
 
diff --git a/packages/vtk/src/bbvtkSegmentationConnectivity.cxx b/packages/vtk/src/bbvtkSegmentationConnectivity.cxx index 6ec480d..679e070 100644 --- a/packages/vtk/src/bbvtkSegmentationConnectivity.cxx +++ b/packages/vtk/src/bbvtkSegmentationConnectivity.cxx @@ -129,7 +129,9 @@ namespace bbvtk thresh2->ThresholdBetween(3000, 3001); thresh2->SetInput(imagedata); thresh2->ThresholdBetween(bbGetInputThresholdMinMax()[0], bbGetInputThresholdMinMax()[1]); + thresh2->Modified(); thresh2->Update(); + cast2->Modified(); cast2->Update(); connect2->RemoveAllSeeds (); @@ -151,6 +153,7 @@ namespace bbvtk if ( z>=maxz ) { printf("Warnnig bbtk::vtk::SegmentationConnectivity::DoProcess limites of the image out of range z: %d -> %d \n",y, maxz-1 ); z=maxz-1; } connect2->AddSeed( x,y,z ); + connect2->Modified(); connect2->Update(); cast4->Update(); bbSetOutputOut(cast4->GetOutput() ); diff --git a/packages/vtk/src/bbvtkUnaryOperations.cxx b/packages/vtk/src/bbvtkUnaryOperations.cxx index d6e9601..dfc3cc9 100644 --- a/packages/vtk/src/bbvtkUnaryOperations.cxx +++ b/packages/vtk/src/bbvtkUnaryOperations.cxx @@ -124,6 +124,7 @@ printf("EED UnaryOperations::Process() 3 \n"); break; } + ope->Modified(); ope->Update(); vtkImageData* salida = ope->GetOutput(); diff --git a/packages/vtk/src/bbvtkVecImageGaussianSmooth.cxx b/packages/vtk/src/bbvtkVecImageGaussianSmooth.cxx index a2ccc9a..33af404 100644 --- a/packages/vtk/src/bbvtkVecImageGaussianSmooth.cxx +++ b/packages/vtk/src/bbvtkVecImageGaussianSmooth.cxx @@ -84,6 +84,7 @@ BBTK_BLACK_BOX_IMPLEMENTATION(VecImageGaussianSmooth,bbtk::AtomicBlackBox); vtkimagegaussiansmooth = vtkImageGaussianSmooth::New(); vtkimagegaussiansmooth->SetInput( bbGetInputIn()[i] ); vtkimagegaussiansmooth->SetStandardDeviation( stdvX,stdvY, stdvZ ); + vtkimagegaussiansmooth->Modified(); vtkimagegaussiansmooth->Update(); VecResult.push_back( vtkimagegaussiansmooth->GetOutput() ); VecVtkimagegaussiansmooth.push_back(vtkimagegaussiansmooth); -- 2.47.1