From c202d6311cae6bdf05ece6a3f95bed1e40e5a444 Mon Sep 17 00:00:00 2001 From: "eduardo.davila@creatis.insa-lyon.fr" Date: Sun, 3 Aug 2025 15:33:09 +0200 Subject: [PATCH] #3538 Box CleanExternalPlane define GayValuue for backgroud --- packages/vtk/src/bbvtkCleanExternalPlane.cxx | 34 ++++++++------------ packages/vtk/src/bbvtkCleanExternalPlane.h | 2 ++ 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/packages/vtk/src/bbvtkCleanExternalPlane.cxx b/packages/vtk/src/bbvtkCleanExternalPlane.cxx index 80caf30..bda78d2 100644 --- a/packages/vtk/src/bbvtkCleanExternalPlane.cxx +++ b/packages/vtk/src/bbvtkCleanExternalPlane.cxx @@ -62,8 +62,8 @@ void CleanExternalPlane::CleanTypeA(vtkImageData* image) { for (j=0 ; jSetScalarComponentFromDouble (ext[0]+i, ext[2]+j, ext[4]+0 , 0, 0.0); - image->SetScalarComponentFromDouble (ext[0]+i, ext[2]+j, ext[4]+dim[2]-1, 0, 0.0); + image->SetScalarComponentFromDouble (ext[0]+i, ext[2]+j, ext[4]+0 , 0, bbGetInputGrayLevel() ); + image->SetScalarComponentFromDouble (ext[0]+i, ext[2]+j, ext[4]+dim[2]-1, 0, bbGetInputGrayLevel() ); } // for j }// for i @@ -72,8 +72,8 @@ void CleanExternalPlane::CleanTypeA(vtkImageData* image) { for (j=0 ; jSetScalarComponentFromDouble (ext[0]+0 , ext[2]+i, ext[4]+j, 0, 0.0); - image->SetScalarComponentFromDouble (ext[0]+dim[0]-1 , ext[2]+i, ext[4]+j, 0, 0.0); + image->SetScalarComponentFromDouble (ext[0]+0 , ext[2]+i, ext[4]+j, 0, bbGetInputGrayLevel() ); + image->SetScalarComponentFromDouble (ext[0]+dim[0]-1 , ext[2]+i, ext[4]+j, 0, bbGetInputGrayLevel() ); } // for j } // for i @@ -82,8 +82,8 @@ void CleanExternalPlane::CleanTypeA(vtkImageData* image) { for (j=0 ; jSetScalarComponentFromDouble (ext[0]+i, ext[2]+0 , ext[4]+j, 0, 0.0); - image->SetScalarComponentFromDouble (ext[0]+i, ext[2]+dim[1]-1 , ext[4]+j, 0, 0.0); + image->SetScalarComponentFromDouble (ext[0]+i, ext[2]+0 , ext[4]+j, 0, bbGetInputGrayLevel() ); + image->SetScalarComponentFromDouble (ext[0]+i, ext[2]+dim[1]-1 , ext[4]+j, 0, bbGetInputGrayLevel() ); } // for j }// for i } // if In @@ -189,43 +189,37 @@ void CleanExternalPlane::Process() CleanTypeA(imageoutput); bbSetOutputOut( imageoutput ); } - - - - } -//===== + +//===== // 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 CleanExternalPlane::bbUserSetDefaultValues() { - // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 bbSetInputIn(NULL); bbSetInputType(0); - + bbSetInputGrayLevel(0.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 CleanExternalPlane::bbUserInitializeProcessing() { - // THE INITIALIZATION METHOD BODY : // Here does nothing // but this is where you should allocate the internal/output pointers -// if any - +// if any imageoutput = vtkImageData::New(); - } -//===== + +//===== // 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 CleanExternalPlane::bbUserFinalizeProcessing() { - // THE FINALIZATION METHOD BODY : // Here does nothing // but this is where you should desallocate the internal/output pointers diff --git a/packages/vtk/src/bbvtkCleanExternalPlane.h b/packages/vtk/src/bbvtkCleanExternalPlane.h index 7791980..534dea7 100644 --- a/packages/vtk/src/bbvtkCleanExternalPlane.h +++ b/packages/vtk/src/bbvtkCleanExternalPlane.h @@ -50,6 +50,7 @@ class bbvtk_EXPORT CleanExternalPlane //===== BBTK_DECLARE_INPUT(In,vtkImageData*); BBTK_DECLARE_INPUT(Type,int); + BBTK_DECLARE_INPUT(GrayLevel,double); BBTK_DECLARE_OUTPUT(Out,vtkImageData*); BBTK_PROCESS(Process); @@ -70,6 +71,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(CleanExternalPlane,bbtk::AtomicBlackBox); BBTK_CATEGORY("filter"); BBTK_INPUT(CleanExternalPlane,In,"Input image",vtkImageData*,""); BBTK_INPUT(CleanExternalPlane,Type,"-1= nothing to do, 0 = (default) not modifie Dimention. 1 = Add outside plane (Dimension of image change)",int,""); + BBTK_INPUT(CleanExternalPlane,GrayLevel,"Gray level to fill clean plane",double,""); BBTK_OUTPUT(CleanExternalPlane,Out,"Output image",vtkImageData*,""); BBTK_END_DESCRIBE_BLACK_BOX(CleanExternalPlane); //===== -- 2.51.0