From 9425856446ebe42a86c40bec5b93367b7bcd1fd2 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Wed, 17 Jul 2019 11:06:57 +0200 Subject: [PATCH] #3279 creaVtk Bug New Normal - ImageContinuousErode3D box --- .../src/bbcreaVtkImageContinuousDilate3D.h | 23 +++++++++------- .../src/bbcreaVtkImageContinuousErode3D.cxx | 16 +++++++---- .../src/bbcreaVtkImageContinuousErode3D.h | 27 ++++++++++--------- .../src/bbcreaVtkPolyDataToImageData.cxx | 7 ++--- .../src/bbcreaVtkPolyDataToImageData.h | 6 +++++ 5 files changed, 49 insertions(+), 30 deletions(-) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousDilate3D.h b/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousDilate3D.h index 738e9f3..687e01e 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousDilate3D.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousDilate3D.h @@ -36,16 +36,19 @@ class bbcreaVtk_EXPORT ImageContinuousDilate3D }; BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageContinuousDilate3D,bbtk::AtomicBlackBox); -BBTK_NAME("ImageContinuousDilate3D"); -BBTK_AUTHOR("Carlos Torres"); -BBTK_DESCRIPTION("No Description."); -BBTK_CATEGORY("empty"); -BBTK_INPUT(ImageContinuousDilate3D,X,"X (default 3)",double,""); -BBTK_INPUT(ImageContinuousDilate3D,Y,"Y (default 3)",double,""); -BBTK_INPUT(ImageContinuousDilate3D,Z,"Z (default 3)",double,""); -BBTK_INPUT(ImageContinuousDilate3D,Repetitions,"Repetitions (default 0, it works minimum ones) ",int,""); -BBTK_INPUT(ImageContinuousDilate3D,Image,"Image input",vtkImageData*,""); -BBTK_OUTPUT(ImageContinuousDilate3D,Out,"Image output",vtkImageData*,""); + BBTK_NAME("ImageContinuousDilate3D"); + BBTK_AUTHOR("Carlos Torres"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(ImageContinuousDilate3D,X,"X (default 3)",double,""); + BBTK_INPUT(ImageContinuousDilate3D,Y,"Y (default 3)",double,""); + BBTK_INPUT(ImageContinuousDilate3D,Z,"Z (default 3)",double,""); + BBTK_INPUT(ImageContinuousDilate3D,Repetitions,"Repetitions (default 0, it works minimum ones) ",int,""); + BBTK_INPUT(ImageContinuousDilate3D,Image,"Image input",vtkImageData*,""); + + BBTK_OUTPUT(ImageContinuousDilate3D,Out,"Image output",vtkImageData*,""); + BBTK_END_DESCRIBE_BLACK_BOX(ImageContinuousDilate3D); //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.cxx index 4784991..5836b62 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.cxx @@ -1,6 +1,10 @@ #include "bbcreaVtkImageContinuousErode3D.h" #include "bbcreaVtkPackage.h" + +#include "vtkImageContinuousErode3D.h" + + namespace bbcreaVtk { @@ -9,6 +13,9 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ImageContinuousErode3D,bbtk::AtomicBlackBox); void ImageContinuousErode3D::Process() { +printf("EED ImageContinuousErode3D::Process Repetitions=%d\n", bbGetInputRepetitions() ); +printf("EED ImageContinuousErode3D::Process XYZ=%f %f %f\n", bbGetInputX(), bbGetInputY(), bbGetInputZ() ); + vtkImageData* result = erodeFilterRecursive(bbGetInputImage(), bbGetInputRepetitions(), bbGetInputX(),bbGetInputY(),bbGetInputZ()); bbSetOutputOut(result); } @@ -37,17 +44,16 @@ vtkImageData* ImageContinuousErode3D::erodeFilterRecursive(vtkImageData* image, void ImageContinuousErode3D::bbUserSetDefaultValues() { - + bbSetInputX(3); + bbSetInputY(3); + bbSetInputY(3); + bbSetInputRepetitions(0); } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== void ImageContinuousErode3D::bbUserInitializeProcessing() { - bbSetInputX(3); - bbSetInputY(3); - bbSetInputY(3); - bbSetInputRepetitions(0); } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.h b/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.h index efe2127..c87a328 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.h @@ -6,8 +6,8 @@ #include "bbcreaVtk_EXPORT.h" #include "bbtkAtomicBlackBox.h" #include "iostream" + #include "vtkImageData.h" -#include "vtkImageContinuousErode3D.h" namespace bbcreaVtk { @@ -20,10 +20,10 @@ class bbcreaVtk_EXPORT ImageContinuousErode3D //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== + BBTK_DECLARE_INPUT(Repetitions,int); BBTK_DECLARE_INPUT(X,double); BBTK_DECLARE_INPUT(Y,double); BBTK_DECLARE_INPUT(Z,double); - BBTK_DECLARE_INPUT(Repetitions,int); BBTK_DECLARE_INPUT(Image,vtkImageData*); BBTK_DECLARE_OUTPUT(Out,vtkImageData*); BBTK_PROCESS(Process); @@ -35,16 +35,19 @@ class bbcreaVtk_EXPORT ImageContinuousErode3D }; BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageContinuousErode3D,bbtk::AtomicBlackBox); -BBTK_NAME("ImageContinuousErode3D"); -BBTK_AUTHOR("Carlos Torres"); -BBTK_DESCRIPTION("No Description."); -BBTK_CATEGORY("empty"); -BBTK_INPUT(ImageContinuousErode3D,X,"X (default 3)",double,""); -BBTK_INPUT(ImageContinuousErode3D,Y,"Y (default 3)",double,""); -BBTK_INPUT(ImageContinuousErode3D,Z,"Z (default 3)",double,""); -BBTK_INPUT(ImageContinuousErode3D,Repetitions,"Repetitions (default 0, it works minimum ones)",int,""); -BBTK_INPUT(ImageContinuousErode3D,Image,"Image input",vtkImageData*,""); -BBTK_OUTPUT(ImageContinuousErode3D,Out,"Image output",vtkImageData*,""); + BBTK_NAME("ImageContinuousErode3D"); + BBTK_AUTHOR("Carlos Torres"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(ImageContinuousErode3D,X,"X (default 3)",double,""); + BBTK_INPUT(ImageContinuousErode3D,Y,"Y (default 3)",double,""); + BBTK_INPUT(ImageContinuousErode3D,Z,"Z (default 3)",double,""); + BBTK_INPUT(ImageContinuousErode3D,Repetitions,"Repetitions (default 0, it works minimum ones)",int,""); + BBTK_INPUT(ImageContinuousErode3D,Image,"Image input",vtkImageData*,""); + + BBTK_OUTPUT(ImageContinuousErode3D,Out,"Image output",vtkImageData*,""); + BBTK_END_DESCRIBE_BLACK_BOX(ImageContinuousErode3D); //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.cxx index 7286c24..2e80837 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.cxx @@ -88,7 +88,7 @@ printf("EED Warnning!! PolyDataToImageData::Process Clean this code ......... stencil->Update(); stencil->SetStencilData( dataToStencil->GetOutput() ); stencil->ReverseStencilOn(); - stencil->SetBackgroundValue(128); + stencil->SetBackgroundValue( bbGetInputBackgroundValue() ); stencil->Update(); bbSetOutputOut( stencil->GetOutput() ); @@ -105,8 +105,9 @@ void PolyDataToImageData::bbUserSetDefaultValues() // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 - bbSetInputInPolyData(NULL); - bbSetInputInImage(NULL); + bbSetInputInPolyData(NULL); + bbSetInputInImage(NULL); + bbSetInputBackgroundValue(255); } //===== diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.h b/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.h index 5dd6602..91e73cd 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.h @@ -23,6 +23,8 @@ class bbcreaVtk_EXPORT PolyDataToImageData // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== BBTK_DECLARE_INPUT(InImage,vtkImageData*); + BBTK_DECLARE_INPUT(BackgroundValue,double); + BBTK_DECLARE_INPUT(InPolyData,vtkPolyData*); BBTK_DECLARE_OUTPUT(Out,vtkImageData*); BBTK_PROCESS(Process); @@ -37,9 +39,13 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(PolyDataToImageData,bbtk::AtomicBlackBox); BBTK_AUTHOR("InfoDev"); BBTK_DESCRIPTION("No Description."); BBTK_CATEGORY("empty"); + BBTK_INPUT(PolyDataToImageData,InImage,"Image to put Result",vtkImageData*,""); + BBTK_INPUT(PolyDataToImageData,BackgroundValue,"(default 255) Background value",double,""); BBTK_INPUT(PolyDataToImageData,InPolyData,"Input vtkPolyData",vtkPolyData*,""); + BBTK_OUTPUT(PolyDataToImageData,Out,"Output vtkImageData",vtkImageData*,""); + BBTK_END_DESCRIBE_BLACK_BOX(PolyDataToImageData); //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) -- 2.47.1