From: Eduardo DAVILA Date: Fri, 27 Nov 2020 11:22:45 +0000 (+0100) Subject: Future random option in MasPoint box X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=a9bb08f42d4914fef4a5e86b583e0eb406137cf0;p=bbtk.git Future random option in MasPoint box --- diff --git a/packages/vtk/src/bbvtkMaskPoint.cxx b/packages/vtk/src/bbvtkMaskPoint.cxx index 2d0bbb9..eb1457c 100644 --- a/packages/vtk/src/bbvtkMaskPoint.cxx +++ b/packages/vtk/src/bbvtkMaskPoint.cxx @@ -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); } //===== diff --git a/packages/vtk/src/bbvtkMaskPoint.h b/packages/vtk/src/bbvtkMaskPoint.h index a9732d5..41ceac6 100644 --- a/packages/vtk/src/bbvtkMaskPoint.h +++ b/packages/vtk/src/bbvtkMaskPoint.h @@ -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*,"");