1 #include <Plugins/SimpleImageNeighborhood.h>
2 #include <cpInstances/Image.h>
3 #include <cpInstances/Image_Demanglers.h>
6 #include <fpa/Image/Functors/SimpleNeighborhood.h>
8 // -------------------------------------------------------------------------
9 fpaPlugins::SimpleImageNeighborhood::
10 SimpleImageNeighborhood( )
13 typedef cpPlugins::BaseObjects::DataObject _TData;
14 typedef cpInstances::Image _TImage;
16 this->_ConfigureInput< _TImage >( "Input", true, false );
17 this->_ConfigureOutput< _TData >( "Output" );
19 this->m_Parameters.ConfigureAsUint( "Order", 1 );
22 // -------------------------------------------------------------------------
23 fpaPlugins::SimpleImageNeighborhood::
24 ~SimpleImageNeighborhood( )
28 // -------------------------------------------------------------------------
29 void fpaPlugins::SimpleImageNeighborhood::
32 auto o = this->GetInputData( "Input" );
33 cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 )
34 this->_Error( "Invalid input image." );
37 // -------------------------------------------------------------------------
38 template< class _TImage >
39 void fpaPlugins::SimpleImageNeighborhood::
40 _GD0( _TImage* image )
42 typedef fpa::Image::Functors::SimpleNeighborhood< _TImage > _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( );
52 f->SetOrder( this->m_Parameters.GetUint( "Order" ) );