#include #include #include #include #include // ------------------------------------------------------------------------- cpPluginsImageGenericFilters::GaussianBlurImageFilter:: GaussianBlurImageFilter( ) : Superclass( ) { typedef cpPlugins::DataObjects::Image _TImage; this->_ConfigureInput< _TImage >( "Input", true, false ); this->_ConfigureOutput< _TImage >( "Output" ); this->m_Parameters.ConfigureAsReal( "MaximumError", 1e-3 ); this->m_Parameters.ConfigureAsReal( "Sigma", 1 ); this->m_Parameters.ConfigureAsUint( "MaximumKernelWidth", 32 ); this->m_Parameters.ConfigureAsRealTypesChoices( "OutputResolution" ); } // ------------------------------------------------------------------------- cpPluginsImageGenericFilters::GaussianBlurImageFilter:: ~GaussianBlurImageFilter( ) { } // ------------------------------------------------------------------------- void cpPluginsImageGenericFilters::GaussianBlurImageFilter:: _GenerateData( ) { auto o = this->GetInputData( "Input" ); cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 ) this->_Error( "Invalid input image." ); } // ------------------------------------------------------------------------- template< class _TInput > void cpPluginsImageGenericFilters::GaussianBlurImageFilter:: _GD0( _TInput* input ) { std::string t = this->m_Parameters.GetSelectedChoice( "OutputResolution" ); #ifdef cpPlugins_CONFIG_REAL_TYPES_float if( t == "float" ) this->_GD1< _TInput, float >( input ); #endif // cpPlugins_CONFIG_REAL_TYPES_float #ifdef cpPlugins_CONFIG_REAL_TYPES_double if( t == "double" ) this->_GD1< _TInput, double >( input ); #endif // cpPlugins_CONFIG_REAL_TYPES_double } // ------------------------------------------------------------------------- template< class _TInput, class _TOutputPixel > void cpPluginsImageGenericFilters::GaussianBlurImageFilter:: _GD1( _TInput* input ) { /* TODO typedef itk::GaussianBlurImageFunction< _TInput, _TOutputPixel > _TFunction; typedef itk::Image< _TOutputPixel, _TInput::ImageDimension > _TOutput; typedef itk::UnaryFunctorImageFilter< _TInput, _TOutput, _TFunction > _TFilter; auto filter = this->_CreateITK< _TFilter >( ); filter->SetInput( input ); typename _TFunction::ErrorArrayType e; e.Fill( this->m_Parameters.GetReal( "MaximumError" ) ); filter->GetFunctor( ).SetMaximumError( e ); filter->GetFunctor( ).SetSigma( this->m_Parameters.GetReal( "Sigma" ) ); filter->GetFunctor( ).SetMaximumKernelWidth( this->m_Parameters.GetUint( "MaximumKernelWidth" ) ); filter->Update( ); this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); */ } // eof - $RCSfile$