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