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