]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/Algorithms/LightCompensationFilter.h
...
[cpPlugins.git] / lib / cpExtensions / Algorithms / LightCompensationFilter.h
1 // -------------------------------------------------------------------------
2 // @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
3 // -------------------------------------------------------------------------
4
5 #ifndef __CPEXTENSIONS__ALGORITHMS__LIGHTCOMPENSATIONFILTER__H__
6 #define __CPEXTENSIONS__ALGORITHMS__LIGHTCOMPENSATIONFILTER__H__
7
8 #include <itkInPlaceImageFilter.h>
9 #include <cpExtensions/Algorithms/ParallelImageMean.h>
10
11 namespace cpExtensions
12   {
13     namespace Algorithms
14     {
15       /**
16        */
17       template< class I >
18       class LightCompensationFilter
19         : public itk::InPlaceImageFilter< I, I >
20       {
21       public:
22         typedef LightCompensationFilter         Self;
23         typedef itk::InPlaceImageFilter< I, I > Superclass;
24         typedef itk::SmartPointer< Self >       Pointer;
25         typedef itk::SmartPointer< const Self > ConstPointer;
26
27         typedef I TImage;
28         typedef typename I::RegionType TRegion;
29
30         typedef cpExtensions::Algorithms::ParallelImageMean< I > TMeanCalculator;
31         typedef typename TMeanCalculator::TMean TMean;
32
33       public:
34         itkNewMacro( Self );
35         itkTypeMacro( LightCompensationFilter, itkInPlaceImageFilter );
36
37         itkGetConstMacro( Mean, TMean );
38
39       protected:
40         LightCompensationFilter( );
41         virtual ~LightCompensationFilter( );
42
43       private:
44         virtual void BeforeThreadedGenerateData( );
45         virtual void ThreadedGenerateData(
46           const TRegion& region, itk::ThreadIdType id
47           );
48         virtual void AfterThreadedGenerateData( );
49
50       protected:
51         TMean m_Mean;
52         TMean m_Coefficient;
53       };
54
55   } // ecapseman
56
57 } // ecapseman
58
59 #include <cpExtensions/Algorithms/LightCompensationFilter.hxx>
60
61 #endif // __CPEXTENSIONS__ALGORITHMS__LIGHTCOMPENSATIONFILTER__H__
62
63 // eof - $RCSfile$