this->Modified( );
}
+// -------------------------------------------------------------------------
+void cpPlugins::BaseObjects::Parameters::
+ConfigureAsRealTypesChoices( const std::string& name )
+{
+ std::vector< std::string > choices;
+#ifdef cpPlugins_CONFIG_REAL_TYPES_float
+ choices.push_back( "float" );
+#endif // cpPlugins_CONFIG_REAL_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_double
+ choices.push_back( "double" );
+#endif // cpPlugins_CONFIG_REAL_TYPES_double
+ this->ConfigureAsChoices( name, choices );
+}
+
// -------------------------------------------------------------------------
std::vector< std::string > cpPlugins::BaseObjects::Parameters::
GetChoices( const std::string& name ) const
--- /dev/null
+#include <ImageGenericFilters/GaussianBlurImageFilter.h>
+#include <cpPlugins/DataObjects/Image.h>
+#include <cpPlugins/DataObjects/Image_Demanglers.h>
+
+#include <itkImage.h>
+#include <itkGaussianBlurImageFunction.h>
+
+// -------------------------------------------------------------------------
+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$
--- /dev/null
+#ifndef __cpPluginsImageGenericFilters__GaussianBlurImageFilter__h__
+#define __cpPluginsImageGenericFilters__GaussianBlurImageFilter__h__
+
+#include <cpPluginsImageGenericFilters_Export.h>
+#include <cpPlugins/BaseObjects/ProcessObject.h>
+
+namespace cpPluginsImageGenericFilters
+{
+ /**
+ */
+ class cpPluginsImageGenericFilters_EXPORT GaussianBlurImageFilter
+ : public cpPlugins::BaseObjects::ProcessObject
+ {
+ cpPluginsObject(
+ GaussianBlurImageFilter,
+ cpPlugins::BaseObjects::ProcessObject,
+ ImageFilters
+ );
+
+ protected:
+ template< class _TInput >
+ inline void _GD0( _TInput* input );
+
+ template< class _TInput, class _TOutputPixel >
+ inline void _GD1( _TInput* input );
+ };
+
+} // ecapseman
+
+#endif // __cpPluginsImageGenericFilters__GaussianBlurImageFilter__h__
+
+// eof - $RCSfile$
header #define ITK_MANUAL_INSTANTIATION
+define functions=NeighborhoodOperatorImageFunction;GaussianBlurImageFunction
+
tinclude itkRegionOfInterestImageFilter:h|hxx
tinclude itkRescaleIntensityImageFilter:h|hxx
tinclude itkMinimumMaximumImageCalculator:h|hxx
tinclude itkExtractImageFilter:h|hxx
+* tinclude itk#functions#:h|hxx
cinclude itk#color_pixels#.h
cinclude itkImageAlgorithm.hxx
instances itk::MinimumMaximumImageCalculator< itk::Image< #scalar_pixels#, #process_dims# > >
+* instances itk::#functions#< itk::Image< #scalar_pixels#, #process_dims# >, #real_types# >
+
** eof - $RCSfile$