]> Creatis software - clitk.git/blob - filters/clitkImageFillRegionGenericFilter.h
Initial revision
[clitk.git] / filters / clitkImageFillRegionGenericFilter.h
1 /*-------------------------------------------------------------------------
2
3   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
4   l'Image). All rights reserved. See Doc/License.txt or
5   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
6                                                                                 
7      This software is distributed WITHOUT ANY WARRANTY; without even
8      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9      PURPOSE.  See the above copyright notices for more information.
10                                                                              
11 -------------------------------------------------------------------------*/
12
13 #ifndef CLITKIMAGEFILLREGIONGENERICFILTER_H
14 #define CLITKIMAGEFILLREGIONGENERICFILTER_H
15
16 /**
17  -------------------------------------------------------------------
18  * @file   clitkImageFillRegionGenericFilter.h
19  * @author David Sarrut <David.Sarrut@creatis.insa-lyon.fr>
20  * @date   23 Feb 2008
21  -------------------------------------------------------------------*/
22
23 // clitk include
24 #include "clitkCommon.h"
25 #include "clitkImageCommon.h"
26 #include "clitkImageToImageGenericFilter.h"
27
28 // itk include
29 #include "itkImage.h"
30 #include "itkImageIOBase.h"
31 #include "itkImageRegionIterator.h"
32 #include "itkImageRegionConstIterator.h"
33 #include "itkImageRegionIteratorWithIndex.h"
34
35 namespace clitk {
36   
37   //--------------------------------------------------------------------
38   class ImageFillRegionGenericFilter : public clitk::ImageToImageGenericFilter {
39   
40   public:
41         
42     // Constructor 
43     ImageFillRegionGenericFilter ();
44     ~ImageFillRegionGenericFilter (){;}
45
46     // Types
47     typedef ImageFillRegionGenericFilter  Self;
48     typedef ImageToImageGenericFilter     Superclass;
49     typedef itk::SmartPointer<Self>       Pointer;
50     typedef itk::SmartPointer<const Self> ConstPointer;
51
52     // New
53     itkNewMacro(Self);
54     
55     // Set methods
56     void SetFillPixelValue (double value) { mPixelValue = value; }
57     void SetRegion(int * size, int * start) { mSize = size; mStart = start ; }
58     void SetSphericRegion(std::vector<double> & radius, std::vector<double> & center);
59     void SetSphericRegion(std::vector<double> & radius);
60
61     // Update
62     void Update ();
63
64   protected:  
65     double mPixelValue;
66     int * mSize;
67     int * mStart;
68     std::vector<double> mCenter;
69     std::vector<double> mRadius;
70     bool mSphericRegion;
71     bool m_IsCentered;
72
73
74     //--------------------------------------------------------------------
75     template<unsigned int Dim> void Update_WithDim();
76     template<unsigned int Dim, class PixelType> void Update_WithDimAndPixelType();
77     template<unsigned int Dim, class PixelType> void Update_WithDimAndPixelType_SphericRegion();
78     //--------------------------------------------------------------------
79
80   }; // end class ImageFillRegionGenericFilter
81 //--------------------------------------------------------------------
82
83 #include "clitkImageFillRegionGenericFilter.txx"
84
85 } // end namespace
86 //--------------------------------------------------------------------
87
88 #endif //#define CLITKIMAGEFILLREGIONGENERICFILTER_H
89