1 #include <plugins/Plugins/InvertCost.h>
2 #include <cpPlugins/DataObjects/Image.h>
4 #include <fpa/Base/Functors/Inverse.h>
5 #include <fpa/Base/Functors/Inverse.hxx>
7 // -------------------------------------------------------------------------
8 fpaPlugins::InvertCost::
12 typedef cpPlugins::BaseObjects::DataObject _TData;
13 this->_ConfigureOutput< _TData >( "Output" );
15 std::vector< std::string > choices;
16 choices.push_back( "float" );
17 choices.push_back( "double" );
18 this->m_Parameters.ConfigureAsChoices( "ResultType", choices );
19 this->m_Parameters.SetSelectedChoice( "ResultType", "float" );
22 // -------------------------------------------------------------------------
23 fpaPlugins::InvertCost::
28 // -------------------------------------------------------------------------
29 void fpaPlugins::InvertCost::
32 auto rtype = this->m_Parameters.GetSelectedChoice( "ResultType" );
33 if ( rtype == "float" ) this->_GD0< float >( );
34 else if( rtype == "double" ) this->_GD0< double >( );
37 // -------------------------------------------------------------------------
38 template< class _TOutput >
39 void fpaPlugins::InvertCost::
42 typedef fpa::Base::Functors::Inverse< _TOutput, _TOutput > _TFunctor;
44 auto out = this->GetOutput( "Output" );
45 auto f = out->GetITK< _TFunctor >( );
48 typename _TFunctor::Pointer ptr_f = _TFunctor::New( );
49 f = ptr_f.GetPointer( );