cpPluginsImageSliceFilters
cpPluginsImageGenericFilters
)
+TARGET_LINK_LIBRARIES(
+ cpPluginsImageGradientFilters
+ cpPluginsImageGenericFilters
+ )
IF(ParabolicMorphology_LOADED)
TARGET_LINK_LIBRARIES(
cpPluginsImageParaMorphologyFilters
+++ /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
+define in_scalars=#scalar_pixels#
+define out_scalars=#scalar_pixels#
tinclude itkRegionOfInterestImageFilter:h|hxx
tinclude itkRescaleIntensityImageFilter:h|hxx
tinclude itkMinimumMaximumImageCalculator:h|hxx
tinclude itkExtractImageFilter:h|hxx
-* tinclude itk#functions#:h|hxx
+tinclude itkCastImageFilter: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# >
+instances itk::CastImageFilter< itk::Image< #in_scalars#, #process_dims# >, itk::Image< #out_scalars#, #process_dims# > >
** eof - $RCSfile$
define itk_filters=RecursiveGaussianImageFilter;GradientRecursiveGaussianImageFilter
tinclude itk#itk_filters#:h|hxx
+tinclude itkSmoothingRecursiveGaussianImageFilter:h|hxx
tinclude cpExtensions/Algorithms/#all_funcs#:h|hxx
tinclude cpExtensions/Algorithms/ImageFunctionFilter:h|hxx
tinclude cpExtensions/Algorithms/MultiScaleGaussianImageFilter:h|hxx
instances cpExtensions::Algorithms::MultiScaleGaussianImageFilter< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# > >
+instances itk::SmoothingRecursiveGaussianImageFilter< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #real_types#, #process_dims# > >
+
** eof - $RCSfile$
--- /dev/null
+#include <ImageGradientFilters/SmoothingRecursiveGaussianImageFilter.h>
+#include <cpPlugins/DataObjects/Image.h>
+#include <cpPlugins/DataObjects/Image_Demanglers.h>
+
+#include <itkSmoothingRecursiveGaussianImageFilter.h>
+
+// -------------------------------------------------------------------------
+cpPluginsImageGradientFilters::SmoothingRecursiveGaussianImageFilter::
+SmoothingRecursiveGaussianImageFilter( )
+ : Superclass( )
+{
+ typedef cpPlugins::DataObjects::Image _TImage;
+
+ this->_ConfigureInput< _TImage >( "Input", true, false );
+ this->_ConfigureOutput< _TImage >( "Output" );
+
+ this->m_Parameters.ConfigureAsRealList( "SigmaArray" );
+ this->m_Parameters.ConfigureAsRealTypesChoices( "OutputResolution" );
+}
+
+// -------------------------------------------------------------------------
+cpPluginsImageGradientFilters::SmoothingRecursiveGaussianImageFilter::
+~SmoothingRecursiveGaussianImageFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPluginsImageGradientFilters::SmoothingRecursiveGaussianImageFilter::
+_GenerateData( )
+{
+ auto o = this->GetInputData( "Input" );
+ cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 )
+ this->_Error( "Invalid input image." );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage >
+void cpPluginsImageGradientFilters::SmoothingRecursiveGaussianImageFilter::
+_GD0( _TImage* image )
+{
+ auto choice = this->m_Parameters.GetSelectedChoice( "OutputResolution" );
+#ifdef cpPlugins_CONFIG_REAL_TYPES_float
+ if( choice == "float" ) this->_GD1< _TImage, float >( image );
+#endif // cpPlugins_CONFIG_REAL_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_double
+ if( choice == "double" ) this->_GD1< _TImage, double >( image );
+#endif // cpPlugins_CONFIG_REAL_TYPES_double
+}
+
+// -------------------------------------------------------------------------
+template< class _TInput, class _TOutputPixel >
+void cpPluginsImageGradientFilters::SmoothingRecursiveGaussianImageFilter::
+_GD1( _TInput* image )
+{
+ typedef itk::Image< _TOutputPixel, _TInput::ImageDimension > _TOutput;
+ typedef
+ itk::SmoothingRecursiveGaussianImageFilter< _TInput, _TOutput >
+ _TFilter;
+ typedef typename _TFilter::SigmaArrayType _TSigmas;
+
+ auto param_sigmas = this->m_Parameters.GetRealList( "SigmaArray" );
+ unsigned int dim =
+ ( param_sigmas.size( ) < _TInput::ImageDimension )?
+ param_sigmas.size( ):
+ _TInput::ImageDimension;
+ _TSigmas sigmas;
+ sigmas.Fill( param_sigmas[ dim - 1 ] );
+ for( unsigned d = 0; d < dim; ++d )
+ sigmas[ d ] = param_sigmas[ d ];
+
+ // Configure filter
+ _TFilter* filter = this->_CreateITK< _TFilter >( );
+ filter->SetInput( image );
+ filter->SetSigmaArray( sigmas );
+ filter->Update( );
+
+ // Connect output
+ this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
+}
+
+// eof - $RCSfile$
--- /dev/null
+#ifndef __cpPluginsImageGradientFilters__SmoothingRecursiveGaussianImageFilter__h__
+#define __cpPluginsImageGradientFilters__SmoothingRecursiveGaussianImageFilter__h__
+
+#include <cpPluginsImageGradientFilters_Export.h>
+#include <cpPlugins/BaseObjects/ProcessObject.h>
+
+namespace cpPluginsImageGradientFilters
+{
+ /**
+ */
+ class cpPluginsImageGradientFilters_EXPORT SmoothingRecursiveGaussianImageFilter
+ : public cpPlugins::BaseObjects::ProcessObject
+ {
+ cpPluginsObject(
+ SmoothingRecursiveGaussianImageFilter,
+ cpPlugins::BaseObjects::ProcessObject,
+ ImageGradientFilters
+ );
+
+ protected:
+ template< class _TInput >
+ inline void _GD0( _TInput* image );
+
+ template< class _TInput, class _TOutputPixel >
+ inline void _GD1( _TInput* image );
+ };
+
+} // ecapseman
+
+#endif // __cpPluginsImageGradientFilters__SmoothingRecursiveGaussianImageFilter__h__
+
+// eof - $RCSfile$