1 #include "GaussianCostFunctor.h"
3 #include <fpa/Base/Functors/GaussianCost.h>
4 #include <fpa/Base/Functors/GaussianCost.hxx>
6 // -------------------------------------------------------------------------
7 fpaPlugins::GaussianCostFunctor::
11 this->_ConfigureOutput< cpPlugins::BaseObjects::DataObject >( "Output" );
12 this->_ConfigureOutput< cpPlugins::BaseObjects::DataObject >( "Estimator" );
13 std::vector< std::string > choices;
14 choices.push_back( "float" );
15 choices.push_back( "double" );
16 this->m_Parameters.ConfigureAsChoices( "ResultType", choices );
17 this->m_Parameters.SetSelectedChoice( "ResultType", "float" );
18 this->m_Parameters.ConfigureAsUint( "SupportSize" );
19 this->m_Parameters.ConfigureAsReal( "MinimumCost" );
20 this->m_Parameters.SetUint( "SupportSize", 30 );
21 this->m_Parameters.SetReal( "MinimumCost", 1e-5 );
24 // -------------------------------------------------------------------------
25 fpaPlugins::GaussianCostFunctor::
26 ~GaussianCostFunctor( )
30 // -------------------------------------------------------------------------
31 void fpaPlugins::GaussianCostFunctor::
34 auto rtype = this->m_Parameters.GetSelectedChoice( "ResultType" );
35 if ( rtype == "float" ) this->_GD0< float >( );
36 else if( rtype == "double" ) this->_GD0< double >( );
39 // -------------------------------------------------------------------------
40 template< class _TResult >
41 void fpaPlugins::GaussianCostFunctor::
44 typedef fpa::Base::Functors::GaussianCost< _TResult > _TFunctor;
45 auto out = this->GetOutput( "Output" );
46 auto f = out->GetITK< _TFunctor >( );
49 typename _TFunctor::Pointer ptr_f = _TFunctor::New( );
50 f = ptr_f.GetPointer( );
54 f->SetSupportSize( this->m_Parameters.GetUint( "SupportSize" ) );
55 f->SetMinimumCost( this->m_Parameters.GetReal( "MinimumCost" ) );
56 this->GetOutput( "Estimator" )->SetITK( f->GetModel( ) );