--- /dev/null
+#ifndef __cpExtensions__Algorithms__CPRImageFilter__h__
+#define __cpExtensions__Algorithms__CPRImageFilter__h__
+
+#include <itkImageToImageFilter.h>
+#include <cpExtensions/Algorithms/IsoImageSlicer.h>
+
+namespace cpExtensions
+{
+ namespace Algorithms
+ {
+ /**
+ */
+ template< class _TImage, class _TCurve >
+ class CPRImageFilter
+ : public itk::ImageToImageFilter< _TImage, _TImage >
+ {
+ public:
+ typedef CPRImageFilter Self;
+ typedef itk::ImageToImageFilter< _TImage, _TImage > Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
+
+ typedef _TImage TImage;
+ typedef _TCurve TCurve;
+ typedef typename TCurve::TScalar TScalar;
+
+ typedef IsoImageSlicer< TImage, TScalar > TSlicer;
+ typedef typename TSlicer::TInterpolateFunction TInterpolateFunction;
+
+ public:
+ itkNewMacro( Self );
+ itkTypeMacro( CPRImageFilter, itk::ImageToImageFilter );
+
+ itkGetConstMacro( SliceRadius, double );
+ itkGetObjectMacro( Interpolator, TInterpolateFunction );
+
+ itkSetMacro( SliceRadius, double );
+ itkSetObjectMacro( Interpolator, TInterpolateFunction );
+
+ public:
+ _TCurve* GetCurve( );
+ const _TCurve* GetCurve( ) const;
+ void SetCurve( _TCurve* curve );
+
+ protected:
+ CPRImageFilter( );
+ virtual ~CPRImageFilter( );
+
+ virtual void GenerateOutputInformation( ) cpExtensions_OVERRIDE;
+ virtual void GenerateInputRequestedRegion( ) cpExtensions_OVERRIDE;
+ virtual void GenerateData( ) cpExtensions_OVERRIDE;
+
+ protected:
+ double m_SliceRadius;
+ typename TInterpolateFunction::Pointer m_Interpolator;
+ };
+
+ } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+# include <cpExtensions/Algorithms/CPRImageFilter.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __cpExtensions__Algorithms__CPRImageFilter__h__
+
+// eof - $RCSfile$
--- /dev/null
+#ifndef __cpExtensions__Algorithms__CPRImageFilter__hxx__
+#define __cpExtensions__Algorithms__CPRImageFilter__hxx__
+
+// -------------------------------------------------------------------------
+template< class _TImage, class _TCurve >
+_TCurve* cpExtensions::Algorithms::CPRImageFilter< _TImage, _TCurve >::
+GetCurve( )
+{
+ return(
+ dynamic_cast< _TCurve* >( this->itk::ProcessObject::GetInput( 1 ) )
+ );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage, class _TCurve >
+const _TCurve* cpExtensions::Algorithms::CPRImageFilter< _TImage, _TCurve >::
+GetCurve( ) const
+{
+ return(
+ dynamic_cast< const _TCurve* >( this->itk::ProcessObject::GetInput( 1 ) )
+ );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage, class _TCurve >
+void cpExtensions::Algorithms::CPRImageFilter< _TImage, _TCurve >::
+SetCurve( _TCurve* curve )
+{
+ this->itk::ProcessObject::SetInput( 1, curve );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage, class _TCurve >
+cpExtensions::Algorithms::CPRImageFilter< _TImage, _TCurve >::
+CPRImageFilter( )
+ : Superclass( ),
+ m_SliceRadius( 0 )
+{
+ this->Superclass::SetNumberOfRequiredInputs( 2 );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage, class _TCurve >
+cpExtensions::Algorithms::CPRImageFilter< _TImage, _TCurve >::
+~CPRImageFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage, class _TCurve >
+void cpExtensions::Algorithms::CPRImageFilter< _TImage, _TCurve >::
+GenerateOutputInformation( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage, class _TCurve >
+void cpExtensions::Algorithms::CPRImageFilter< _TImage, _TCurve >::
+GenerateInputRequestedRegion( )
+{
+ TImage* input = const_cast< TImage* >( this->GetInput( ) );
+ if( input != NULL )
+ input->SetRequestedRegionToLargestPossibleRegion( );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage, class _TCurve >
+void cpExtensions::Algorithms::CPRImageFilter< _TImage, _TCurve >::
+GenerateData( )
+{
+ /* TODO
+ double m_SliceRadius
+ typename TInterpolateFunction::Pointer m_Interpolator
+ */
+}
+
+#endif // __cpExtensions__Algorithms__CPRImageFilter__hxx__
+
+// eof - $RCSfile$
} // ecapseman
#ifndef ITK_MANUAL_INSTANTIATION
-#include <cpExtensions/Algorithms/IsoImageSlicer.hxx>
+# include <cpExtensions/Algorithms/IsoImageSlicer.hxx>
#endif // ITK_MANUAL_INSTANTIATION
#endif // __CPEXTENSIONS__ALGORITHMS__ISOIMAGESLICER__H__
--- /dev/null
+
+tinclude itkAnisotropicDiffusionImageFilter:h|hxx
+tinclude itkCurvatureNDAnisotropicDiffusionFunction:h|hxx
+
+instances itk::AnisotropicDiffusionImageFilter< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #real_types#, #process_dims# > >
+instances itk::CurvatureNDAnisotropicDiffusionFunction< itk::Image< #real_types#, #process_dims# > >
+
+** eof - $RCSfile$
#include <cpPlugins/DataObjects/Image_Demanglers.h>
#include <itkCurvatureAnisotropicDiffusionImageFilter.h>
-/* TODO
- #include <itkCurvatureNDAnisotropicDiffusionFunction.hxx>
- #include <itkFiniteDifferenceFunction.hxx>
- #include <itkNeighborhoodInnerProduct.hxx>
- #include <itkNeighborhoodOperator.hxx>
- #include <itkFiniteDifferenceImageFilter.hxx>
- #include <itkAnisotropicDiffusionImageFilter.hxx>
- #include <itkDenseFiniteDifferenceImageFilter.hxx>
- #include <itkNeighborhoodAlgorithm.hxx>
- #include <itkDerivativeOperator.hxx>
- #include <itkScalarAnisotropicDiffusionFunction.hxx>
-*/
// -------------------------------------------------------------------------
cpPluginsAnisotropicDiffusion::CurvatureAnisotropicDiffusionImageFilter::
CurvatureAnisotropicDiffusionImageFilter( )
: Superclass( )
{
- this->_ConfigureInput< cpPlugins::DataObjects::Image >( "Input", true, false );
- this->_ConfigureOutput< cpPlugins::DataObjects::Image >( "Output" );
+ typedef cpPlugins::DataObjects::Image _TImage;
+ this->_ConfigureInput< _TImage >( "Input", true, false );
+ this->_ConfigureOutput< _TImage >( "Output" );
this->m_Parameters.ConfigureAsUint( "NumberOfIterations" );
this->m_Parameters.ConfigureAsBool( "UseImageSpacing" );
this->m_Parameters.ConfigureAsReal( "ConductanceParameter" );
this->m_Parameters.ConfigureAsReal( "TimeStep" );
+ 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->m_Parameters.ConfigureAsChoices( "OutputResolution", choices );
this->m_Parameters.SetUint( "NumberOfIterations", 5 );
this->m_Parameters.SetBool( "UseImageSpacing", false );
_GenerateData( )
{
auto o = this->GetInputData( "Input" );
- cpPlugins_Demangle_Image_ScalarPixels_VisualDims_1( o, _GD0 )
+ cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 )
this->_Error( "No valid input image." );
}
void cpPluginsAnisotropicDiffusion::CurvatureAnisotropicDiffusionImageFilter::
_GD0( _TImage* image )
{
- typedef itk::CurvatureAnisotropicDiffusionImageFilter< _TImage, _TImage > _TFilter;
+ std::string out_res =
+ this->m_Parameters.GetSelectedChoice( "OutputResolution" );
+#ifdef cpPlugins_CONFIG_REAL_TYPES_float
+ if( out_res == "float" ) this->_GD1< _TImage, float >( image );
+#endif // cpPlugins_CONFIG_REAL_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_double
+ if( out_res == "double" ) this->_GD1< _TImage, double >( image );
+#endif // cpPlugins_CONFIG_REAL_TYPES_double
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage, class _TScalar >
+void cpPluginsAnisotropicDiffusion::CurvatureAnisotropicDiffusionImageFilter::
+_GD1( _TImage* image )
+{
+ typedef itk::Image< _TScalar, _TImage::ImageDimension > _TOutImage;
+ typedef
+ itk::CurvatureAnisotropicDiffusionImageFilter< _TImage, _TOutImage >
+ _TFilter;
// Configure filter
_TFilter* filter = this->_CreateITK< _TFilter >( );
protected:
template< class _TImage >
inline void _GD0( _TImage* image );
+
+ template< class _TImage, class _TScalar >
+ inline void _GD1( _TImage* image );
};
} // ecapseman
ImageGenericFilters
ImageGradientFilters
ImageMeshFilters
+ ImageSliceFilters
ImageSources
ImageThresholdFilters
IO
header #define ITK_MANUAL_INSTANTIATION
-define filters=And;Or;Xor
+define filters=And;Or;Xor;Not
define functors=AND;OR;XOR
define all_ints=#int_types#;unsigned #int_types#
tinclude itkBinaryFunctorImageFilter:h|hxx
+tinclude itkUnaryFunctorImageFilter:h|hxx
cinclude itk#filters#ImageFilter.h
instances itk::BinaryFunctorImageFilter< itk::Image< #all_ints#, #process_dims# >, itk::Image< #all_ints#, #process_dims# >, itk::Image< #all_ints#, #process_dims# >, itk::Functor::#functors#< #all_ints#, #all_ints#, #all_ints# > >
+instances itk::UnaryFunctorImageFilter< itk::Image< #all_ints#, #process_dims# >, itk::Image< #all_ints#, #process_dims# >, itk::Functor::NOT< #all_ints#, #all_ints# > >
+
** eof - $RCSfile$
--- /dev/null
+#include <ImageBooleanFilters/NotImageFilter.h>
+#include <cpPlugins/DataObjects/Image.h>
+#include <cpPlugins/DataObjects/Image_Demanglers.h>
+
+#include <itkNotImageFilter.h>
+
+// -------------------------------------------------------------------------
+cpPluginsImageBooleanFilters::NotImageFilter::
+NotImageFilter( )
+ : Superclass( )
+{
+ typedef cpPlugins::DataObjects::Image _TImage;
+
+ this->_ConfigureInput< _TImage >( "Input", true, false );
+ this->_ConfigureOutput< _TImage >( "Output" );
+}
+
+// -------------------------------------------------------------------------
+cpPluginsImageBooleanFilters::NotImageFilter::
+~NotImageFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPluginsImageBooleanFilters::NotImageFilter::
+_GenerateData( )
+{
+ auto o = this->GetInputData( "Input" );
+ cpPlugins_Demangle_Image_IntPixels_AllDims_1( o, _GD0 )
+ this->_Error( "Invalid input image." );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage >
+void cpPluginsImageBooleanFilters::NotImageFilter::
+_GD0( _TImage* image )
+{
+ typedef itk::NotImageFilter< _TImage, _TImage > _TFilter;
+
+ // Configure filter
+ auto filter = this->_CreateITK< _TFilter >( );
+ filter->SetInput( image );
+ filter->Update( );
+
+ // Connect output
+ this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
+}
+
+// eof - $RCSfile$
--- /dev/null
+#ifndef __cpPluginsImageBooleanFilters__NotImageFilter__h__
+#define __cpPluginsImageBooleanFilters__NotImageFilter__h__
+
+#include <cpPluginsImageBooleanFilters_Export.h>
+#include <cpPlugins/BaseObjects/ProcessObject.h>
+
+namespace cpPluginsImageBooleanFilters
+{
+ /**
+ */
+ class cpPluginsImageBooleanFilters_EXPORT NotImageFilter
+ : public cpPlugins::BaseObjects::ProcessObject
+ {
+ cpPluginsObject(
+ NotImageFilter,
+ cpPlugins::BaseObjects::ProcessObject,
+ ImageBooleanFilters
+ );
+
+ protected:
+ template< class _TImage >
+ inline void _GD0( _TImage* image1 );
+ };
+
+} // ecapseman
+
+#endif // __cpPluginsImageBooleanFilters__NotImageFilter__h__
+
+// eof - $RCSfile$
_GenerateData( )
{
auto o = this->GetInputData( "Input" );
- cpPlugins_Demangle_Image_VisualDims_1( o, _GD0 )
+ cpPlugins_Demangle_Image_ScalarPixels_VisualDims_1( o, _GD0 )
this->_Error( "Invalid input image dimension." );
}
template< class _TImage >
void cpPluginsImageDistanceMaps::SignedMaurerDistanceMapImageFilter::
_GD0( _TImage* image )
-{
- cpPlugins_Demangle_Image_ScalarPixels_1( image, _GD1, _TImage::ImageDimension )
- this->_Error( "Invalid input image pixel type." );
-}
-
-// -------------------------------------------------------------------------
-template< class _TImage >
-void cpPluginsImageDistanceMaps::SignedMaurerDistanceMapImageFilter::
-_GD1( _TImage* image )
{
std::string out_res =
this->m_Parameters.GetSelectedChoice( "OutputResolution" );
#ifdef cpPlugins_CONFIG_REAL_TYPES_float
- if( out_res == "float" ) this->_GD2< _TImage, float >( image );
+ if( out_res == "float" ) this->_GD1< _TImage, float >( image );
#endif // cpPlugins_CONFIG_REAL_TYPES_float
#ifdef cpPlugins_CONFIG_REAL_TYPES_double
- if( out_res == "double" ) this->_GD2< _TImage, double >( image );
+ if( out_res == "double" ) this->_GD1< _TImage, double >( image );
#endif // cpPlugins_CONFIG_REAL_TYPES_double
}
// -------------------------------------------------------------------------
template< class _TImage, class _TScalar >
void cpPluginsImageDistanceMaps::SignedMaurerDistanceMapImageFilter::
-_GD2( _TImage* image )
+_GD1( _TImage* image )
{
typedef itk::Image< _TScalar, _TImage::ImageDimension > _TDMap;
typedef
template< class _TImage >
inline void _GD0( _TImage* image );
- template< class _TImage >
- inline void _GD1( _TImage* image );
-
template< class _TImage, class _TScalar >
- inline void _GD2( _TImage* image );
+ inline void _GD1( _TImage* image );
};
} // ecapseman
--- /dev/null
+** eof - $RCSfile$