: Superclass( )
{
this->_AddInput( "ReferenceImage" );
- this->_MakeOutput< GrowFunction >( "Output" );
+ this->_AddOutput< GrowFunction >( "Output" );
this->m_Parameters->ConfigureAsReal( "LowerThreshold" );
this->m_Parameters->ConfigureAsReal( "UpperThreshold" );
this->m_Parameters->SetReal( "LowerThreshold", 0 );
- this->m_Parameters->SetReal( "UpperThreshold", 0 );
+ this->m_Parameters->SetReal( "UpperThreshold", 1 );
}
// -------------------------------------------------------------------------
std::string fpaPlugins::ThresholdImageGrowFunctionSource::
_GenerateData( )
{
- cpPlugins::Interface::Image* image =
- this->GetInput< cpPlugins::Interface::Image >( "ReferenceImage" );
- if( image == NULL )
- return( "fpaPlugins::ThresholdImageGrowFunctionSource: No input reference image." );
-
+ auto image = this->GetInputData( "ReferenceImage" );
itk::DataObject* itk_image = NULL;
std::string r = "";
cpPlugins_Image_Demangle_AllScalarTypes( 2, image, itk_image, r, _GD0 );
else cpPlugins_Image_Demangle_AllScalarTypes( 3, image, itk_image, r, _GD0 );
else r = "fpaPlugins::ThresholdImageGrowFunctionSource: no valid reference image.";
-
return( r );
}
_GD0( itk::DataObject* data )
{
typedef fpa::Image::Functors::RegionGrowThresholdFunction< I > _F;
- typename _F::Pointer functor = _F::New( );
- // Connect output
- GrowFunction* out = this->GetOutput< GrowFunction >( "Output" );
- if( out != NULL )
+ auto out = this->GetOutputData( "Output" );
+ auto f = out->GetITK< _F >( );
+ if( f == NULL )
{
- out->SetITK< _F >( functor );
- return( "" );
- }
- else
- return( "fpaPlugins::ThresholdImageGrowFunctionSource: output not correctly created." );
+ typename _F::Pointer ptr_f = _F::New( );
+ f = ptr_f.GetPointer( );
+ out->SetITK( f );
+
+ } // fi
+ f->SetLowerThreshold( this->m_Parameters->GetReal( "LowerThreshold" ) );
+ f->SetUpperThreshold( this->m_Parameters->GetReal( "UpperThreshold" ) );
+ return( "" );
}
// eof - $RCSfile$