]> Creatis software - clitk.git/blob - tools/clitkHistogramImageGenericFilter.h
Allow to display in all directions for images with size 2 and 3 in 3rd direction
[clitk.git] / tools / clitkHistogramImageGenericFilter.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
19 #ifndef clitkHistogramImageGenericFilter_h
20 #define clitkHistogramImageGenericFilter_h
21
22 #include "clitkIO.h"
23 #include "clitkImageToImageGenericFilter.h"
24 #include "clitkHistogramImage_ggo.h"
25
26 #include <vtkIntArray.h>
27 #include <vtkFloatArray.h>
28 #include <itkHistogram.h>
29
30 //--------------------------------------------------------------------
31 namespace clitk
32 {
33
34   class ITK_EXPORT HistogramImageGenericFilter:
35     public ImageToImageGenericFilter<HistogramImageGenericFilter>
36   {
37
38   public:
39     //--------------------------------------------------------------------
40     typedef HistogramImageGenericFilter         Self;
41     typedef itk::SmartPointer<Self>           Pointer;
42     typedef itk::SmartPointer<const Self>     ConstPointer;
43     typedef args_info_clitkHistogramImage       args_info_type;
44
45     //--------------------------------------------------------------------
46     // Method for creation through the object factory
47     // and Run-time type information (and related methods)
48     itkNewMacro(Self);  
49     itkTypeMacro(HistogramImageGenericFilter, LightObject);
50
51     //--------------------------------------------------------------------
52     void SetArgsInfo(const args_info_type & a);
53     void SetSizeBin (const double size);
54
55     // Save the histogram to txt file
56     void SaveAs();
57
58     //--------------------------------------------------------------------
59     // Main function called each time the filter is updated
60     template<class InputImageType>  
61     void UpdateWithInputImageType();
62
63     vtkFloatArray* GetArrayX();
64     vtkFloatArray* GetArrayY();
65
66   protected:
67     HistogramImageGenericFilter();
68     template<unsigned int Dim> void InitializeImageType();
69     args_info_type mArgsInfo;
70     
71     double mBinSize;
72     
73     vtkSmartPointer<vtkFloatArray> mArrayX;
74     vtkSmartPointer<vtkFloatArray> mArrayY;
75
76   }; // end class
77   //--------------------------------------------------------------------
78
79 } // end namespace clitk
80 //--------------------------------------------------------------------
81
82 #endif // #define clitkHistogramImageGenericFilter_h