X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=bbtk_creaVtk_PKG%2Fsrc%2FbbcreaVtkImageContinuousErode3D.cxx;h=a123ae6f13e646397f6d28839d8568ba565bf06e;hb=4dfb73fa777e2a3d0728e0987e7d7bea5817bbc1;hp=95fd998886d33a2b18c3cef2813331fd64f1db73;hpb=5cb2a22b34194409fb4cf97fd06a371d3c391acb;p=creaVtk.git diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.cxx index 95fd998..a123ae6 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,38 +13,47 @@ 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) { vtkImageContinuousErode3D *erodeFilter = vtkImageContinuousErode3D ::New(); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 erodeFilter->SetInput (image); +#else + erodeFilter->SetInputData(image); +#endif erodeFilter->SetKernelSize(x, y, z); - erodeFilter->Modified(); + erodeFilter->Modified(); erodeFilter->Update(); - vtkImageData* resultRec; if(repetitions == 0) { - resultRec = erodeFilter->GetOutput(); - return resultRec; - } - else { - vtkImageData* resultRec = erodeFilterRecursive(erodeFilter->GetOutput(), (repetitions-1), x, y, z); - } + return erodeFilter->GetOutput(); + }else{ + return erodeFilterRecursive(erodeFilter->GetOutput(), repetitions-1, x, y, z); + } // if repetitions } 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() { - } //===== // 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)