]> Creatis software - bbtk.git/commitdiff
Future random option in MasPoint box
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Fri, 27 Nov 2020 11:22:45 +0000 (12:22 +0100)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Fri, 27 Nov 2020 11:22:45 +0000 (12:22 +0100)
packages/vtk/src/bbvtkMaskPoint.cxx
packages/vtk/src/bbvtkMaskPoint.h

index 2d0bbb9ef1ed70c87a1ab0b1aebefd4f48f70b25..eb1457c3b297f57613db29894ed08f6e89a71b7c 100644 (file)
@@ -39,12 +39,14 @@ void MaskPoint::Process()
 
                maskpoints->SetOnRatio( bbGetInputRatio() );
 
-// option 1
-               maskpoints->RandomModeOff();    
-// option 2            
-//             maskpoints->RandomModeOn();     
-//             maskpoints->SetRandomModeType(0);
-               
+               if (bbGetInputRandomType()==-1)
+               {
+                       maskpoints->RandomModeOff();    
+               } else if(bbGetInputRandomType()==0) {
+                       maskpoints->RandomModeOn();     
+                       maskpoints->SetRandomModeType(0);
+               }
+
        //      maskpoints->SetMaximumNumberOfPoints(5000);     
                maskpoints->Update();
                bbSetOutputOut( maskpoints->GetOutput() );
@@ -61,6 +63,8 @@ void MaskPoint::bbUserSetDefaultValues()
    bbSetInputActive( true );
    bbSetInputIn(NULL);
    bbSetOutputOut(NULL);
+   bbSetInputRandomType(-1);
+   bbSetInputRatio(30);
   
 }
 //===== 
index a9732d55ead96619666069a3a113d25a66a81480..41ceac689e849e1dbb899860df4516fbe921141d 100644 (file)
@@ -26,6 +26,7 @@ class bbvtk_EXPORT MaskPoint
   BBTK_DECLARE_INPUT(Active,bool);
   BBTK_DECLARE_INPUT(In,vtkImageData*);
   BBTK_DECLARE_INPUT(Ratio,int);
+  BBTK_DECLARE_INPUT(RandomType,int);
   BBTK_DECLARE_OUTPUT(Out,vtkPolyData*);
   BBTK_PROCESS(Process);
   void Process();
@@ -46,7 +47,8 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(MaskPoint,bbtk::AtomicBlackBox);
 
   BBTK_INPUT(MaskPoint,Active,"(default true)  true/false",bool,"");
   BBTK_INPUT(MaskPoint,In,"vtkImageData",vtkImageData*,"");
-  BBTK_INPUT(MaskPoint,Ratio,"Ratio",int,"");
+  BBTK_INPUT(MaskPoint,Ratio,"(default 30) Ratio",int,"");
+  BBTK_INPUT(MaskPoint,RandomType,"(default -1)  -1:RandomOff  0:Random(0)  1:Random(1 not set)",int,"");
 
   BBTK_OUTPUT(MaskPoint,Out,"vtkPolyData",vtkPolyData*,"");