1 #include <Plugins/InvertCost.h>
2 #include <cpPlugins/DataObjects/Image.h>
4 #include <fpa/Base/Functors/Inverse.h>
6 // -------------------------------------------------------------------------
7 fpaPlugins::InvertCost::
11 typedef cpPlugins::BaseObjects::DataObject _TData;
12 this->_ConfigureOutput< _TData >( "Output" );
14 std::vector< std::string > choices;
15 choices.push_back( "float" );
16 choices.push_back( "double" );
17 this->m_Parameters.ConfigureAsChoices( "ResultType", choices );
18 this->m_Parameters.SetSelectedChoice( "ResultType", "float" );
21 // -------------------------------------------------------------------------
22 fpaPlugins::InvertCost::
27 // -------------------------------------------------------------------------
28 void fpaPlugins::InvertCost::
31 auto rtype = this->m_Parameters.GetSelectedChoice( "ResultType" );
32 if ( rtype == "float" ) this->_GD0< float >( );
33 else if( rtype == "double" ) this->_GD0< double >( );
36 // -------------------------------------------------------------------------
37 template< class _TOutput >
38 void fpaPlugins::InvertCost::
41 typedef fpa::Base::Functors::Inverse< _TOutput, _TOutput > _TFunctor;
43 auto out = this->GetOutput( "Output" );
44 auto f = out->GetITK< _TFunctor >( );
47 typename _TFunctor::Pointer ptr_f = _TFunctor::New( );
48 f = ptr_f.GetPointer( );