1 #include <Plugins/RegionGrowBinaryThreshold.h>
2 #include <cpPlugins/DataObjects/Image.h>
3 #include <cpPlugins/DataObjects/Image_Demanglers.h>
6 #include <fpa/Image/Functors/RegionGrowBinaryThreshold.h>
8 // -------------------------------------------------------------------------
9 fpaPlugins::RegionGrowBinaryThreshold::
10 RegionGrowBinaryThreshold( )
13 typedef cpPlugins::BaseObjects::DataObject _TData;
14 typedef cpPlugins::DataObjects::Image _TImage;
16 this->_ConfigureInput< _TImage >( "Input", true, false );
17 this->_ConfigureOutput< _TData >( "Output" );
19 this->m_Parameters.ConfigureAsReal( "LowerThreshold", 0 );
20 this->m_Parameters.ConfigureAsReal( "UpperThreshold", 0 );
23 // -------------------------------------------------------------------------
24 fpaPlugins::RegionGrowBinaryThreshold::
25 ~RegionGrowBinaryThreshold( )
29 // -------------------------------------------------------------------------
30 void fpaPlugins::RegionGrowBinaryThreshold::
33 auto o = this->GetInputData( "Input" );
34 cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 )
35 this->_Error( "Invalid input image." );
38 // -------------------------------------------------------------------------
39 template< class _TImage >
40 void fpaPlugins::RegionGrowBinaryThreshold::
41 _GD0( _TImage* image )
44 fpa::Image::Functors::RegionGrowBinaryThreshold< _TImage >
46 auto out = this->GetOutput( "Output" );
47 auto f = out->GetITK< _TFunctor >( );
50 typename _TFunctor::Pointer ptr_f = _TFunctor::New( );
51 f = ptr_f.GetPointer( );
55 f->SetLowerThreshold( this->m_Parameters.GetReal( "LowerThreshold" ) );
56 f->SetUpperThreshold( this->m_Parameters.GetReal( "UpperThreshold" ) );