// ------------------------------------------------------------------------- // @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co) // ------------------------------------------------------------------------- #ifndef __CPEXTENSIONS__ALGORITHMS__CPRFILTER__H__ #define __CPEXTENSIONS__ALGORITHMS__CPRFILTER__H__ #include #include #include #include #include #include namespace cpExtensions { namespace Algorithms { /** */ template< class I, class S = float > class CPRFilter : public itk::ImageToImageFilter< I, I > { public: // Standard ITK typedefs. typedef CPRFilter Self; typedef itk::ImageToImageFilter< I, I > Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkStaticConstMacro( VDimension, unsigned int, I::ImageDimension ); typedef I TImage; typedef S TScalar; typedef itk::InterpolateImageFunction< I, S > TInterpolator; typedef itk::PolyLineParametricPath< VDimension > TAxis; typedef cpExtensions::Algorithms::IsoImageSlicer< I, S > TSlicer; typedef typename TSlicer::TSliceImage TSlice; typedef itk::JoinSeriesImageFilter< TSlice, I > TJoin; public: itkNewMacro( Self ); itkTypeMacro( CPRFilter, itk::ImageToImageFilter ); itkGetConstMacro( SliceRadius, double ); itkGetConstMacro( NumberOfSlices, unsigned int ); itkGetObjectMacro( Interpolator, TInterpolator ); itkSetMacro( SliceRadius, double ); itkSetMacro( NumberOfSlices, unsigned int ); itkSetObjectMacro( Interpolator, TInterpolator ); public: const TAxis* GetAxis( ) const; void SetAxis( const TAxis* axis ); protected: CPRFilter( ); virtual ~CPRFilter( ); virtual void GenerateOutputInformation( ); virtual void GenerateData( ); protected: double m_SliceRadius; unsigned int m_NumberOfSlices; typename TInterpolator::Pointer m_Interpolator; typename TJoin::Pointer m_Join; std::vector< typename TSlicer::Pointer > m_Slices; }; } // ecapseman } // ecapseman #ifndef ITK_MANUAL_INSTANTIATION #include #endif // ITK_MANUAL_INSTANTIATION #endif // __CPEXTENSIONS__ALGORITHMS__CPRFILTER__H__ // eof - $RCSfile$