#include #include #include #include #include // ------------------------------------------------------------------------- fpaPlugins::RegionGrowBinaryThreshold:: RegionGrowBinaryThreshold( ) : Superclass( ) { typedef cpPlugins::BaseObjects::DataObject _TData; typedef cpInstances::Image _TImage; this->_ConfigureInput< _TImage >( "Input", true, false ); this->_ConfigureOutput< _TData >( "Output" ); this->m_Parameters.ConfigureAsReal( "LowerThreshold", 0 ); this->m_Parameters.ConfigureAsReal( "UpperThreshold", 0 ); } // ------------------------------------------------------------------------- fpaPlugins::RegionGrowBinaryThreshold:: ~RegionGrowBinaryThreshold( ) { } // ------------------------------------------------------------------------- void fpaPlugins::RegionGrowBinaryThreshold:: _GenerateData( ) { auto o = this->GetInputData( "Input" ); cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 ) this->_Error( "Invalid input image." ); } // ------------------------------------------------------------------------- template< class _TImage > void fpaPlugins::RegionGrowBinaryThreshold:: _GD0( _TImage* image ) { typedef fpa::Image::Functors::RegionGrowBinaryThreshold< _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$