1 // -------------------------------------------------------------------------
2 // @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
3 // -------------------------------------------------------------------------
5 #ifndef __CPEXTENSIONS__ALGORITHMS__CPRFILTER__H__
6 #define __CPEXTENSIONS__ALGORITHMS__CPRFILTER__H__
10 #include <itkImageToImageFilter.h>
11 #include <itkInterpolateImageFunction.h>
12 #include <itkJoinSeriesImageFilter.h>
13 #include <itkPolyLineParametricPath.h>
14 #include <cpExtensions/Algorithms/IsoImageSlicer.h>
16 namespace cpExtensions
22 template< class I, class S = float >
24 : public itk::ImageToImageFilter< I, I >
27 // Standard ITK typedefs.
28 typedef CPRFilter Self;
29 typedef itk::ImageToImageFilter< I, I > Superclass;
30 typedef itk::SmartPointer< Self > Pointer;
31 typedef itk::SmartPointer< const Self > ConstPointer;
32 itkStaticConstMacro( VDimension, unsigned int, I::ImageDimension );
37 typedef itk::InterpolateImageFunction< I, S > TInterpolator;
38 typedef itk::PolyLineParametricPath< VDimension > TAxis;
39 typedef cpExtensions::Algorithms::IsoImageSlicer< I, S > TSlicer;
40 typedef typename TSlicer::TSliceImage TSlice;
41 typedef itk::JoinSeriesImageFilter< TSlice, I > TJoin;
45 itkTypeMacro( CPRFilter, itk::ImageToImageFilter );
47 itkGetConstMacro( SliceRadius, double );
48 itkGetConstMacro( NumberOfSlices, unsigned int );
49 itkGetObjectMacro( Interpolator, TInterpolator );
51 itkSetMacro( SliceRadius, double );
52 itkSetMacro( NumberOfSlices, unsigned int );
53 itkSetObjectMacro( Interpolator, TInterpolator );
56 const TAxis* GetAxis( ) const;
57 void SetAxis( const TAxis* axis );
61 virtual ~CPRFilter( );
64 virtual void GenerateData( );
68 unsigned int m_NumberOfSlices;
70 typename TInterpolator::Pointer m_Interpolator;
71 typename TJoin::Pointer m_Join;
72 std::vector< typename TSlicer::Pointer > m_Slices;
79 #ifndef ITK_MANUAL_INSTANTIATION
80 #include <cpExtensions/Algorithms/CPRFilter.hxx>
81 #endif // ITK_MANUAL_INSTANTIATION
83 #endif // __CPEXTENSIONS__ALGORITHMS__CPRFILTER__H__