]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/Algorithms/SkeletonToImageFilter.h
yet another refactoring
[cpPlugins.git] / lib / cpExtensions / Algorithms / SkeletonToImageFilter.h
1 // -------------------------------------------------------------------------
2 // @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
3 // -------------------------------------------------------------------------
4
5 #ifndef __cpExtensions__Algorithms__SkeletonToImageFilter__h__
6 #define __cpExtensions__Algorithms__SkeletonToImageFilter__h__
7
8 #include <cpExtensions/Config.h>
9 #include <itkImageSource.h>
10
11 // -------------------------------------------------------------------------
12 namespace cpExtensions
13 {
14   namespace Algorithms
15   {
16     /**
17      */
18     template< class _TSkeleton, class _TImage >
19     class SkeletonToImageFilter
20       : public itk::ImageSource< _TImage >
21     {
22     public:
23       // Basic types
24       typedef SkeletonToImageFilter           Self;
25       typedef itk::ImageSource< _TImage >     Superclass;
26       typedef itk::SmartPointer< Self >       Pointer;
27       typedef itk::SmartPointer< const Self > ConstPointer;
28
29       typedef _TSkeleton TSkeleton;
30       typedef _TImage    TImage;
31       typedef typename _TImage::IndexType  TIndex;
32       typedef typename _TImage::PixelType  TPixel;
33       typedef typename _TImage::PointType  TPoint;
34       typedef typename _TImage::RegionType TRegion;
35       typedef itk::ImageBase< _TImage::ImageDimension > TImageBase;
36
37     public:
38       itkNewMacro( Self );
39       itkTypeMacro( SkeletonToImageFilter, itk::ImageSource );
40
41       itkGetConstMacro( InsideValue, TPixel );
42       itkGetConstMacro( OutsideValue, TPixel );
43
44       itkSetMacro( InsideValue, TPixel );
45       itkSetMacro( OutsideValue, TPixel );
46
47     public:
48       const TImageBase* GetTemplateImage( ) const;
49       void SetTemplateImage( const TImageBase* image );
50
51       const TSkeleton* GetSkeleton( ) const;
52       void SetSkeleton( const TSkeleton* skeleton );
53
54     protected:
55       SkeletonToImageFilter( );
56       virtual ~SkeletonToImageFilter( );
57
58       virtual void GenerateData( ) cpExtensions_OVERRIDE;
59
60     private:
61       // Purposely not implemented
62       SkeletonToImageFilter( const Self& );
63       void operator=( const Self& );
64
65     protected:
66       TPixel m_InsideValue;
67       TPixel m_OutsideValue;
68     };
69
70   } // ecapseman
71
72 } // ecapseman
73
74 // -------------------------------------------------------------------------
75 #ifndef ITK_MANUAL_INSTANTIATION
76 #  include <cpExtensions/Algorithms/SkeletonToImageFilter.hxx>
77 #endif // ITK_MANUAL_INSTANTIATION
78
79 #endif // __cpExtensions__Algorithms__SkeletonToImageFilter__h__
80
81 // eof - $RCSfile$