1 #include "RegionGrowThresholdFunction.h"
3 #include <cpPlugins/Image.h>
4 #include <fpa/Image/Functors/RegionGrowThresholdFunction.h>
6 // -------------------------------------------------------------------------
7 fpaPlugins::RegionGrowThresholdFunction::
8 RegionGrowThresholdFunction( )
11 this->_AddInput( "ReferenceImage" );
12 this->_AddOutput< cpPlugins::DataObject >( "Output" );
14 this->m_Parameters.ConfigureAsReal( "LowerThreshold" );
15 this->m_Parameters.ConfigureAsReal( "UpperThreshold" );
17 this->m_Parameters.SetReal( "LowerThreshold", 0 );
18 this->m_Parameters.SetReal( "UpperThreshold", 1 );
21 // -------------------------------------------------------------------------
22 fpaPlugins::RegionGrowThresholdFunction::
23 ~RegionGrowThresholdFunction( )
27 // -------------------------------------------------------------------------
28 std::string fpaPlugins::RegionGrowThresholdFunction::
32 this->GetInputData( "ReferenceImage" )->GetITK< itk::DataObject >( );
33 std::string cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 2 );
34 if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 );
38 // -------------------------------------------------------------------------
39 template< class _TImage >
40 std::string fpaPlugins::RegionGrowThresholdFunction::
41 _GD0( _TImage* image )
44 fpa::Image::Functors::RegionGrowThresholdFunction< _TImage >
48 return( "fpaPlugins::RegionGrowThresholdFunction: invalid image type." );
50 auto out = this->GetOutputData( "Output" );
51 auto f = out->GetITK< _TFunctor >( );
54 typename _TFunctor::Pointer ptr_f = _TFunctor::New( );
55 f = ptr_f.GetPointer( );
59 f->SetLowerThreshold( this->m_Parameters.GetReal( "LowerThreshold" ) );
60 f->SetUpperThreshold( this->m_Parameters.GetReal( "UpperThreshold" ) );