]> Creatis software - clitk.git/blob - tools/clitkCombineImageFilter.h
GateAsciiImageIO is now cross-platform using itksys::RegularExpression
[clitk.git] / tools / clitkCombineImageFilter.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 clitkCombineImageFilter_h
19 #define clitkCombineImageFilter_h
20
21 /* =================================================
22  * @file   clitkCombineImageFilter.h
23  * @author 
24  * @date   
25  * 
26  * @brief 
27  * 
28  ===================================================*/
29
30
31 // clitk include
32 #include "clitkIO.h"
33 #include "clitkCommon.h"
34
35 //itk include
36 #include "itkImageToImageFilter.h"
37
38 namespace clitk 
39 {
40
41   template <class InputImageType>
42   class ITK_EXPORT CombineImageFilter :
43     public itk::ImageToImageFilter<InputImageType, InputImageType>
44   {
45   public:
46     //----------------------------------------
47     // ITK
48     //----------------------------------------
49     typedef CombineImageFilter                                                 Self;
50     typedef itk::ImageToImageFilter<InputImageType, InputImageType>  Superclass;
51     typedef itk::SmartPointer<Self>                                   Pointer;
52     typedef itk::SmartPointer<const Self>                             ConstPointer;
53    
54     // Method for creation through the object factory
55     itkNewMacro(Self);  
56
57     // Run-time type information (and related methods)
58     itkTypeMacro( CombineImageFilter, ImageToImageFilter );
59
60     /** Dimension of the domain space. */
61     itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension);
62     itkStaticConstMacro(OutputImageDimension, unsigned int, Superclass::OutputImageDimension);
63     typedef itk::Image<int, InputImageDimension> MaskImageType;
64
65     //----------------------------------------
66     // Typedefs
67     //----------------------------------------
68     typedef typename InputImageType::RegionType OutputImageRegionType;
69
70     //----------------------------------------
71     // Set & Get
72     //----------------------------------------    
73     itkBooleanMacro(Verbose);
74     itkSetMacro( Verbose, bool);
75     itkGetConstReferenceMacro( Verbose, bool);
76
77     void SetMask(typename MaskImageType::Pointer m){m_Mask=m;}
78     typename MaskImageType::Pointer GetMask(void){return m_Mask;}
79
80  
81   protected:
82
83     //----------------------------------------  
84     // Constructor & Destructor
85     //----------------------------------------  
86     CombineImageFilter();
87     ~CombineImageFilter() {};
88
89     //----------------------------------------  
90     // Update
91     //----------------------------------------  
92     // Generate Data
93     void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, itk::ThreadIdType threadId);
94
95     //----------------------------------------  
96     // Data members
97     //----------------------------------------
98     bool m_Verbose;
99     typename MaskImageType::Pointer m_Mask;
100
101
102   };
103
104
105 } // end namespace clitk
106
107 #ifndef ITK_MANUAL_INSTANTIATION
108 #include "clitkCombineImageFilter.txx"
109 #endif
110
111 #endif // #define clitkCombineImageFilter_h
112
113