#include "RegionGrowThresholdFunction.h" #include #include // ------------------------------------------------------------------------- fpaPlugins::RegionGrowThresholdFunction:: RegionGrowThresholdFunction( ) : Superclass( ) { this->_AddInput( "ReferenceImage" ); this->_AddOutput< cpPlugins::DataObject >( "Output" ); this->m_Parameters.ConfigureAsReal( "LowerThreshold" ); this->m_Parameters.ConfigureAsReal( "UpperThreshold" ); this->m_Parameters.SetReal( "LowerThreshold", 0 ); this->m_Parameters.SetReal( "UpperThreshold", 1 ); } // ------------------------------------------------------------------------- fpaPlugins::RegionGrowThresholdFunction:: ~RegionGrowThresholdFunction( ) { } // ------------------------------------------------------------------------- std::string fpaPlugins::RegionGrowThresholdFunction:: _GenerateData( ) { auto image = this->GetInputData( "ReferenceImage" )->GetITK< itk::DataObject >( ); std::string cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 2 ); if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 ); return( r ); } // ------------------------------------------------------------------------- template< class _TImage > std::string fpaPlugins::RegionGrowThresholdFunction:: _GD0( _TImage* image ) { typedef fpa::Image::Functors::RegionGrowThresholdFunction< _TImage > _TFunctor; if( image == NULL ) return( "fpaPlugins::RegionGrowThresholdFunction: invalid image type." ); auto out = this->GetOutputData( "Output" ); auto f = out->GetITK< _TFunctor >( ); if( f == NULL ) { typename _TFunctor::Pointer ptr_f = _TFunctor::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$