1 #include "AllPixelsImageGrowFunctionSource.h"
3 #include <cpPlugins/Interface/BaseProcessObjects.h>
4 #include <cpPlugins/Interface/Image.h>
5 #include <fpaPlugins/GrowFunction.h>
6 #include <fpa/Image/Functors/RegionGrowAllBelongsFunction.h>
8 // -------------------------------------------------------------------------
9 fpaPlugins::AllPixelsImageGrowFunctionSource::
10 AllPixelsImageGrowFunctionSource( )
13 this->_AddInput( "ReferenceImage" );
14 this->_MakeOutput< GrowFunction >( "Output" );
17 // -------------------------------------------------------------------------
18 fpaPlugins::AllPixelsImageGrowFunctionSource::
19 ~AllPixelsImageGrowFunctionSource( )
23 // -------------------------------------------------------------------------
24 std::string fpaPlugins::AllPixelsImageGrowFunctionSource::
27 cpPlugins::Interface::Image* image =
28 this->GetInput< cpPlugins::Interface::Image >( "ReferenceImage" );
30 return( "fpaPlugins::AllPixelsImageGrowFunctionSource: No input reference image." );
32 itk::DataObject* itk_image = NULL;
34 cpPlugins_Image_Demangle_AllScalarTypes( 2, image, itk_image, r, _GD0 );
35 else cpPlugins_Image_Demangle_AllScalarTypes( 3, image, itk_image, r, _GD0 );
36 else r = "fpaPlugins::AllPixelsImageGrowFunctionSource: no valid reference image.";
41 // -------------------------------------------------------------------------
43 std::string fpaPlugins::AllPixelsImageGrowFunctionSource::
44 _GD0( itk::DataObject* data )
46 typedef fpa::Image::Functors::RegionGrowAllBelongsFunction< I > _F;
47 typename _F::Pointer functor = _F::New( );
50 GrowFunction* out = this->GetOutput< GrowFunction >( "Output" );
53 out->SetITK< _F >( functor );
57 return( "fpaPlugins::AllPixelsImageGrowFunctionSource: output not correctly created." );