]> Creatis software - creaVtk.git/commitdiff
Clean code
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Wed, 19 Jan 2022 07:34:38 +0000 (08:34 +0100)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Wed, 19 Jan 2022 07:34:38 +0000 (08:34 +0100)
bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.cxx

index debccc0b0f0cbe37c6732d0567e4430eee67ecd4..808f52677d01c75c36ef402ef8aaf8423f79d4e7 100644 (file)
@@ -13,12 +13,18 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ImageContinuousErode3D,bbtk::AtomicBlackBox);
 
 void ImageContinuousErode3D::Process()
 {
+    if (bbGetInputImage()!=NULL)
+    {
                vtkImageData* result = erodeFilterRecursive(bbGetInputImage(), bbGetInputRepetitions(), bbGetInputX(),bbGetInputY(),bbGetInputZ());
                bbSetOutputOut(result);
+    } else {
+        bbSetOutputOut(NULL);
+    } // if Image
 }
 
 vtkImageData* ImageContinuousErode3D::erodeFilterRecursive(vtkImageData* image, int repetitions, double x, double y, double z)
 {
+    printf("EED ImageContinuousErode3D::erodeFilterRecursive 1\n");
                vtkImageContinuousErode3D *erodeFilter = vtkImageContinuousErode3D ::New();
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
@@ -27,15 +33,16 @@ vtkImageData* ImageContinuousErode3D::erodeFilterRecursive(vtkImageData* image,
     erodeFilter->SetInputData(image);
 #endif
     erodeFilter->SetKernelSize(x, y, z);
-               erodeFilter->Modified();                
+               erodeFilter->Modified();
+    printf("EED ImageContinuousErode3D::erodeFilterRecursive 2\n");
                erodeFilter->Update();
-               vtkImageData* resultRec;
+    printf("EED ImageContinuousErode3D::erodeFilterRecursive 3\n");
                if(repetitions == 0)
                {
-                       resultRec = erodeFilter->GetOutput();
-                       return resultRec;
+            printf("EED ImageContinuousErode3D::erodeFilterRecursive 4\n");
+                       return erodeFilter->GetOutput();
                }else{
-                       erodeFilterRecursive(erodeFilter->GetOutput(), (repetitions-1), x, y, z);
+                       erodeFilterRecursive(erodeFilter->GetOutput(), repetitions-1, x, y, z);
                } // if repetitions
 }