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->_AddOutput< GrowFunction >( "Output" );
17 // -------------------------------------------------------------------------
18 fpaPlugins::AllPixelsImageGrowFunctionSource::
19 ~AllPixelsImageGrowFunctionSource( )
23 // -------------------------------------------------------------------------
24 std::string fpaPlugins::AllPixelsImageGrowFunctionSource::
27 auto image = this->GetInputData( "ReferenceImage" );
28 itk::DataObject* itk_image = NULL;
30 cpPlugins_Image_Demangle_AllScalarTypes( 2, image, itk_image, r, _GD0 );
31 else cpPlugins_Image_Demangle_AllScalarTypes( 3, image, itk_image, r, _GD0 );
32 else r = "fpaPlugins::AllPixelsImageGrowFunctionSource: no valid reference image.";
36 // -------------------------------------------------------------------------
38 std::string fpaPlugins::AllPixelsImageGrowFunctionSource::
39 _GD0( itk::DataObject* data )
41 typedef fpa::Image::Functors::RegionGrowAllBelongsFunction< I > _F;
42 auto out = this->GetOutputData( "Output" );
43 auto f = out->GetITK< _F >( );
46 typename _F::Pointer ptr_f = _F::New( );
47 f = ptr_f.GetPointer( );