]> Creatis software - creaVtk.git/commitdiff
#3279 creaVtk Bug New Normal - ImageContinuousErode3D box
authorEduardo DAVILA <davila@ei-ed-606.creatis.insa-lyon.fr>
Wed, 17 Jul 2019 09:06:57 +0000 (11:06 +0200)
committerEduardo DAVILA <davila@ei-ed-606.creatis.insa-lyon.fr>
Wed, 17 Jul 2019 09:06:57 +0000 (11:06 +0200)
bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousDilate3D.h
bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.cxx
bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.h
bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.cxx
bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.h

index 738e9f3748f54353c51c52e1b89eceac7a29c2d1..687e01e8db982613363eed8b5c71e9f4c40b64f0 100644 (file)
@@ -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)
index 4784991cf9ed9f611ffcd211d7289875e704b66f..5836b62e5d1af5babe4bd0ddb595865811658a40 100644 (file)
@@ -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)
index efe2127ecd4085413930da29b9a2662f390d1e41..c87a328ac975a42d7c3343585ea910061af9cc4c 100644 (file)
@@ -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)
index 7286c24a185d12bbd4e8943d0d9e36cd73ef075e..2e80837c8b0050c437d8e8262755ee3be7a1a5d1 100644 (file)
@@ -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);
  
 }
 //===== 
index 5dd6602be26fb83896585c8eec5874cf828be5e6..91e73cd784fd1dba8a2fcfce283f03a547f2d97b 100644 (file)
@@ -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)