]> Creatis software - bbtk.git/commitdiff
#3538 Box CleanExternalPlane define GayValuue for backgroud vtk9itk5wx3-macos
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Sun, 3 Aug 2025 13:33:09 +0000 (15:33 +0200)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Sun, 3 Aug 2025 13:33:09 +0000 (15:33 +0200)
packages/vtk/src/bbvtkCleanExternalPlane.cxx
packages/vtk/src/bbvtkCleanExternalPlane.h

index 80caf30829cf4c1e742028bb48cf54ee7f9ddb0d..bda78d239f6f4b67bc173de07369af825a92255a 100644 (file)
@@ -62,8 +62,8 @@ void CleanExternalPlane::CleanTypeA(vtkImageData* image)
                {
                        for (j=0 ; j<dim[1] ; j++)
                        {
-                               image->SetScalarComponentFromDouble (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 ; j<dim[2] ; j++)
                        {
-                               image->SetScalarComponentFromDouble (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 ; j<dim[2] ; j++)
                        {
-                               image->SetScalarComponentFromDouble (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 
index 7791980fe1d4314640a45c2936bf8329d939abbe..534dea7ca5d058af7f9e82ba3b669ca278091fde 100644 (file)
@@ -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);
 //=====