]> Creatis software - clitk.git/blob - tools/clitkImageStatisticsGenericFilter.h
Merge branch 'master' of git.creatis.insa-lyon.fr:clitk
[clitk.git] / tools / clitkImageStatisticsGenericFilter.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://www.centreleonberard.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #ifndef clitkImageStatisticsGenericFilter_h
19 #define clitkImageStatisticsGenericFilter_h
20
21 // clitk include
22 #include "clitkIO.h"
23 #include "clitkCommon.h"
24 #include "clitkImageCommon.h"
25 #include "clitkImageStatistics_ggo.h"
26
27 //itk include
28 #include "itkLightObject.h"
29 #include "itkLabelStatisticsImageFilter.h"
30
31 namespace clitk 
32 {
33
34   class ITK_EXPORT ImageStatisticsGenericFilter : public itk::LightObject
35   {
36   public:
37     //----------------------------------------
38     // ITK
39     //----------------------------------------
40     typedef ImageStatisticsGenericFilter                   Self;
41     typedef itk::LightObject                   Superclass;
42     typedef itk::SmartPointer<Self>            Pointer;
43     typedef itk::SmartPointer<const Self>      ConstPointer;
44    
45     // Method for creation through the object factory
46     itkNewMacro(Self);  
47
48     // Run-time type information (and related methods)
49     itkTypeMacro( ImageStatisticsGenericFilter, LightObject );
50
51
52     //----------------------------------------
53     // Typedefs
54     //----------------------------------------
55
56
57     //----------------------------------------
58     // Set & Get
59     //----------------------------------------    
60     void SetArgsInfo(const args_info_clitkImageStatistics & a)
61     {
62       m_ArgsInfo=a;
63       m_Verbose=m_ArgsInfo.verbose_flag;
64       m_InputFileName=m_ArgsInfo.input_arg[0];
65     }
66     
67     
68     //----------------------------------------  
69     // Update
70     //----------------------------------------  
71     void Update();
72
73   protected:
74
75     //----------------------------------------  
76     // Constructor & Destructor
77     //----------------------------------------  
78     ImageStatisticsGenericFilter();
79     ~ImageStatisticsGenericFilter() {};
80
81     
82     //----------------------------------------  
83     // Templated members
84     //----------------------------------------  
85     template <unsigned int Dimension, unsigned int Components>  void UpdateWithDim(std::string PixelType);
86     template <unsigned int Dimension, class PixelType, unsigned int Components>  void UpdateWithDimAndPixelType();
87
88
89     //----------------------------------------  
90     // Data members
91     //----------------------------------------
92     args_info_clitkImageStatistics m_ArgsInfo;
93     bool m_Verbose;
94     std::string m_InputFileName;
95
96   };
97
98
99 } // end namespace clitk
100
101 #ifndef ITK_MANUAL_INSTANTIATION
102 #include "clitkImageStatisticsGenericFilter.txx"
103 #endif
104
105 #endif // #define clitkImageStatisticsGenericFilter_h