#include "GaussianCostFunctor.h" #include #include // ------------------------------------------------------------------------- fpaPlugins::GaussianCostFunctor:: GaussianCostFunctor( ) : Superclass( ) { this->_ConfigureOutput< cpPlugins::BaseObjects::DataObject >( "Output" ); this->_ConfigureOutput< cpPlugins::BaseObjects::DataObject >( "Estimator" ); std::vector< std::string > choices; choices.push_back( "float" ); choices.push_back( "double" ); this->m_Parameters.ConfigureAsChoices( "ResultType", choices ); this->m_Parameters.SetSelectedChoice( "ResultType", "float" ); this->m_Parameters.ConfigureAsUint( "SupportSize" ); this->m_Parameters.ConfigureAsReal( "MinimumCost" ); this->m_Parameters.SetUint( "SupportSize", 30 ); this->m_Parameters.SetReal( "MinimumCost", 1e-5 ); } // ------------------------------------------------------------------------- fpaPlugins::GaussianCostFunctor:: ~GaussianCostFunctor( ) { } // ------------------------------------------------------------------------- void fpaPlugins::GaussianCostFunctor:: _GenerateData( ) { auto rtype = this->m_Parameters.GetSelectedChoice( "ResultType" ); if ( rtype == "float" ) this->_GD0< float >( ); else if( rtype == "double" ) this->_GD0< double >( ); } // ------------------------------------------------------------------------- template< class _TResult > void fpaPlugins::GaussianCostFunctor:: _GD0( ) { typedef fpa::Base::Functors::GaussianCost< _TResult > _TFunctor; auto out = this->GetOutput( "Output" ); auto f = out->GetITK< _TFunctor >( ); if( f == NULL ) { typename _TFunctor::Pointer ptr_f = _TFunctor::New( ); f = ptr_f.GetPointer( ); out->SetITK( f ); } // fi f->SetSupportSize( this->m_Parameters.GetUint( "SupportSize" ) ); f->SetMinimumCost( this->m_Parameters.GetReal( "MinimumCost" ) ); this->GetOutput( "Estimator" )->SetITK( f->GetModel( ) ); } // eof - $RCSfile$