]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Extensions/Algorithms/RGBImageToOtherChannelsFilter.h
Accessors added to gaussian model estimator
[cpPlugins.git] / lib / cpPlugins / Extensions / Algorithms / RGBImageToOtherChannelsFilter.h
1 // -------------------------------------------------------------------------
2 // @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
3 // -------------------------------------------------------------------------
4
5 #ifndef __CPPLUGINS__EXTENSIONS__ALGORITHMS__RGBIMAGETOOTHERCHANNELSFILTER__H__
6 #define __CPPLUGINS__EXTENSIONS__ALGORITHMS__RGBIMAGETOOTHERCHANNELSFILTER__H__
7
8 #include <itkImageToImageFilter.h>
9
10 namespace cpPlugins
11 {
12   namespace Extensions
13   {
14     namespace Algorithms
15     {
16       /**
17        */
18       template< class I, class O, class C >
19       class RGBImageToOtherChannelsFilter
20         : public itk::ImageToImageFilter< I, O >
21       {
22       public:
23         typedef RGBImageToOtherChannelsFilter     Self;
24         typedef itk::ImageToImageFilter< I, O > Superclass;
25         typedef itk::SmartPointer< Self >       Pointer;
26         typedef itk::SmartPointer< const Self > ConstPointer;
27
28         typedef I TInputImage;
29         typedef O TOutputImage;
30         typedef C TConverter;
31         typedef typename I::PixelType TInputPixel;
32         typedef typename O::PixelType TOutputPixel;
33
34       public:
35         itkNewMacro( Self );
36         itkTypeMacro( RGBImageToOtherChannelsFilter, itkImageToImageFilter );
37
38       public:
39         O* GetChannel1( );
40         O* GetChannel2( );
41         O* GetChannel3( );
42
43         const O* GetChannel1( ) const;
44         const O* GetChannel2( ) const;
45         const O* GetChannel3( ) const;
46
47         void GraftChannel1( O* c1 );
48         void GraftChannel2( O* c2 );
49         void GraftChannel3( O* c3 );
50
51       protected:
52         RGBImageToOtherChannelsFilter( );
53         virtual ~RGBImageToOtherChannelsFilter( );
54
55         virtual void BeforeThreadedGenerateData( );
56         virtual void AfterThreadedGenerateData( );
57
58         virtual void ThreadedGenerateData(
59           const typename Superclass::OutputImageRegionType& region,
60           itk::ThreadIdType threadId
61           );
62
63       private:
64         // Purposely not implemented
65         RGBImageToOtherChannelsFilter( const Self& other );
66         void operator=( const Self& other );
67
68       private:
69         TConverter Converter;
70       };
71
72     } // ecapseman
73
74   } // ecapseman
75
76 } // ecapseman
77
78 #include <cpPlugins/Extensions/Algorithms/RGBImageToOtherChannelsFilter.hxx>
79
80 #endif // __CPPLUGINS__EXTENSIONS__ALGORITHMS__RGBIMAGETOOTHERCHANNELSFILTER__H__
81
82 // eof - $RCSfile$