#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( ) { } // ------------------------------------------------------------------------- void fpaPlugins::RegionGrowThresholdFunction:: _GenerateData( ) { auto image = this->GetInputData< itk::DataObject >( "ReferenceImage" ); cpPlugins_Image_Demangle_Pixel_AllScalars ( _GD0, image, 2 ); else cpPlugins_Image_Demangle_Pixel_AllScalars( _GD0, image, 3 ); else this->_Error( "No valid input image." ); } // ------------------------------------------------------------------------- template< class _TImage > void fpaPlugins::RegionGrowThresholdFunction:: _GD0( _TImage* image ) { typedef fpa::Image::Functors::RegionGrowThresholdFunction< _TImage > _TFunctor; auto out = this->GetOutput( "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" ) ); } // eof - $RCSfile$