]> Creatis software - clitk.git/blob - filters/clitkImageFillRegionGenericFilter.h
added the new headers
[clitk.git] / filters / clitkImageFillRegionGenericFilter.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://oncora1.lyon.fnclcc.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 CLITKIMAGEFILLREGIONGENERICFILTER_H
19 #define CLITKIMAGEFILLREGIONGENERICFILTER_H
20 /**
21  -------------------------------------------------------------------
22  * @file   clitkImageFillRegionGenericFilter.h
23  * @author David Sarrut <David.Sarrut@creatis.insa-lyon.fr>
24  * @date   23 Feb 2008
25  -------------------------------------------------------------------*/
26
27 // clitk include
28 #include "clitkCommon.h"
29 #include "clitkImageCommon.h"
30 #include "clitkImageToImageGenericFilter.h"
31
32 // itk include
33 #include "itkImage.h"
34 #include "itkImageIOBase.h"
35 #include "itkImageRegionIterator.h"
36 #include "itkImageRegionConstIterator.h"
37 #include "itkImageRegionIteratorWithIndex.h"
38
39 namespace clitk {
40   
41   //--------------------------------------------------------------------
42   class ImageFillRegionGenericFilter: 
43     public clitk::ImageToImageGenericFilter<ImageFillRegionGenericFilter> {
44   
45   public:
46         
47     // Constructor 
48     ImageFillRegionGenericFilter ();
49     ~ImageFillRegionGenericFilter (){;}
50
51     // Types
52     typedef ImageFillRegionGenericFilter  Self;
53     typedef itk::SmartPointer<Self>       Pointer;
54     typedef itk::SmartPointer<const Self> ConstPointer;
55
56     // New
57     itkNewMacro(Self);
58     
59     // Set methods
60     void SetFillPixelValue (double value) { mPixelValue = value; }
61     void SetRegion(int * size, int * start) { mSize = size; mStart = start ; }
62     void SetSphericRegion(std::vector<double> & radius, std::vector<double> & center);
63     void SetSphericRegion(std::vector<double> & radius);
64
65     //--------------------------------------------------------------------
66     // Main function called each time the filter is updated
67     template<class InputImageType>  
68     void UpdateWithInputImageType();
69
70   protected:  
71     template<unsigned int Dim> void InitializeImageType();
72     double mPixelValue;
73     int * mSize;
74     int * mStart;
75     std::vector<double> mCenter;
76     std::vector<double> mRadius;
77     bool mSphericRegion;
78     bool m_IsCentered;
79
80     template<unsigned int Dim, class PixelType> void Update_WithDimAndPixelType_SphericRegion();
81
82   }; // end class ImageFillRegionGenericFilter
83 //--------------------------------------------------------------------
84
85 #include "clitkImageFillRegionGenericFilter.txx"
86
87 } // end namespace
88 //--------------------------------------------------------------------
89
90 #endif //#define CLITKIMAGEFILLREGIONGENERICFILTER_H
91