]> Creatis software - clitk.git/blob - tools/clitkMaskOfIntegratedIntensityGenericFilter.h
With ITK 5, add itkReadRawBytesAfterSwappingMacro and itkWriteRawBytesAfterSwappingMacro
[clitk.git] / tools / clitkMaskOfIntegratedIntensityGenericFilter.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 CLITKMaskOfIntegratedIntensityGENERICFILTER_H
20 #define CLITKMaskOfIntegratedIntensityGENERICFILTER_H
21
22 #include "clitkIO.h"
23 #include "clitkImageToImageGenericFilter.h"
24
25 //--------------------------------------------------------------------
26 namespace clitk
27 {
28
29   template<class args_info_type>
30     class ITK_EXPORT MaskOfIntegratedIntensityGenericFilter:
31     public ImageToImageGenericFilter<MaskOfIntegratedIntensityGenericFilter<args_info_type> >
32     {
33
34     public:
35
36       //--------------------------------------------------------------------
37       MaskOfIntegratedIntensityGenericFilter();
38
39       //--------------------------------------------------------------------
40       typedef MaskOfIntegratedIntensityGenericFilter         Self;
41       typedef itk::SmartPointer<Self>                      Pointer;
42       typedef itk::SmartPointer<const Self>                ConstPointer;
43
44       //--------------------------------------------------------------------
45       // Method for creation through the object factory
46       // and Run-time type information (and related methods)
47       itkNewMacro(Self);
48       itkTypeMacro(MaskOfIntegratedIntensityGenericFilter, LightObject);
49
50       //--------------------------------------------------------------------
51       void SetArgsInfo(const args_info_type & a);
52
53       void SetPercentage(double p) { mPercentage = p; }
54       double GetPercentage() const { return mPercentage; }
55
56       //--------------------------------------------------------------------
57       // Main function called each time the filter is updated
58       template<class InputImageType>
59         void UpdateWithInputImageType();
60
61     protected:
62       template<unsigned int Dim> void InitializeImageType();
63       args_info_type mArgsInfo;
64       double mPercentage;
65
66     }; // end class
67   //--------------------------------------------------------------------
68
69 //Implementation of the pair comparative function
70 template <typename T> bool comparator ( const std::pair<T, size_t>& l, const std::pair<T, size_t>& r);
71
72 } // end namespace clitk
73
74 #ifndef ITK_MANUAL_INSTANTIATION
75 #include "clitkMaskOfIntegratedIntensityGenericFilter.txx"
76 #endif
77
78 #endif // #define clitkMaskOfIntegratedIntensityGenericFilter_h