]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/Algorithms/CPRImageFilter.h
9161260626a65e242d4477e1a444e58c7190dec7
[cpPlugins.git] / lib / cpExtensions / Algorithms / CPRImageFilter.h
1 #ifndef __cpExtensions__Algorithms__CPRImageFilter__h__
2 #define __cpExtensions__Algorithms__CPRImageFilter__h__
3
4 #include <itkImageToImageFilter.h>
5 #include <cpExtensions/Algorithms/IsoImageSlicer.h>
6
7 namespace cpExtensions
8 {
9   namespace Algorithms
10   {
11     /**
12      */
13     template< class _TImage, class _TCurve >
14     class CPRImageFilter
15       : public itk::ImageToImageFilter< _TImage, _TImage >
16     {
17     public:
18       typedef CPRImageFilter                              Self;
19       typedef itk::ImageToImageFilter< _TImage, _TImage > Superclass;
20       typedef itk::SmartPointer< Self >                   Pointer;
21       typedef itk::SmartPointer< const Self >             ConstPointer;
22
23       typedef _TImage TImage;
24       typedef _TCurve TCurve;
25       typedef typename TCurve::TScalar TScalar;
26
27       typedef IsoImageSlicer< TImage, TScalar > TSlicer;
28       typedef typename TSlicer::TInterpolateFunction TInterpolateFunction;
29
30     public:
31       itkNewMacro( Self );
32       itkTypeMacro( CPRImageFilter, itk::ImageToImageFilter );
33
34       itkGetConstMacro( SliceRadius, double );
35       itkGetObjectMacro( Interpolator, TInterpolateFunction );
36
37       itkSetMacro( SliceRadius, double );
38       itkSetObjectMacro( Interpolator, TInterpolateFunction );
39
40     public:
41       _TCurve* GetCurve( );
42       const _TCurve* GetCurve( ) const;
43       void SetCurve( _TCurve* curve );
44
45     protected:
46       CPRImageFilter( );
47       virtual ~CPRImageFilter( );
48
49       virtual void GenerateOutputInformation( ) cpExtensions_OVERRIDE;
50       virtual void GenerateInputRequestedRegion( ) cpExtensions_OVERRIDE;
51       virtual void GenerateData( ) cpExtensions_OVERRIDE;
52
53     protected:
54       double m_SliceRadius;
55       typename TInterpolateFunction::Pointer m_Interpolator;
56     };
57
58   } // ecapseman
59
60 } // ecapseman
61
62 #ifndef ITK_MANUAL_INSTANTIATION
63 #  include <cpExtensions/Algorithms/CPRImageFilter.hxx>
64 #endif // ITK_MANUAL_INSTANTIATION
65
66 #endif // __cpExtensions__Algorithms__CPRImageFilter__h__
67
68 // eof - $RCSfile$