]> Creatis software - clitk.git/blob - tools/clitkVectorImageToImageFilter.h
Be sure to have the correct origin in clitkImage2DicomDose output
[clitk.git] / tools / clitkVectorImageToImageFilter.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 clitkVectorImageToImageFilter_h
19 #define clitkVectorImageToImageFilter_h
20
21 /* =================================================
22  * @file   clitkVectorImageToImageFilter.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, class OutputImageType>
42   class ITK_EXPORT VectorImageToImageFilter :
43     public itk::ImageToImageFilter<InputImageType, OutputImageType>
44   {
45   public:
46     //----------------------------------------
47     // ITK
48     //----------------------------------------
49     typedef VectorImageToImageFilter                                                 Self;
50     typedef itk::ImageToImageFilter<InputImageType, OutputImageType>  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( VectorImageToImageFilter, ImageToImageFilter );
59
60     /** Dimension of the domain space. */
61     itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension);
62     itkStaticConstMacro(OutputImageDimension, unsigned int, Superclass::OutputImageDimension);
63
64     //----------------------------------------
65     // Typedefs
66     //----------------------------------------
67     typedef typename OutputImageType::RegionType OutputImageRegionType;
68
69     //----------------------------------------
70     // Set & Get
71     //----------------------------------------    
72     itkBooleanMacro(Verbose);
73     itkSetMacro( Verbose, bool);
74     itkGetConstReferenceMacro( Verbose, bool);
75     itkSetMacro(ComponentIndex, unsigned int);
76     itkGetConstMacro(ComponentIndex, unsigned int);   
77
78   protected:
79
80     //----------------------------------------  
81     // Constructor & Destructor
82     //----------------------------------------  
83     VectorImageToImageFilter();
84     ~VectorImageToImageFilter() {};
85
86     //----------------------------------------  
87     // Update
88     //----------------------------------------  
89     void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, itk::ThreadIdType threadId );
90    
91     //----------------------------------------  
92     // Data members
93     //----------------------------------------
94     bool m_Verbose;
95     unsigned int m_ComponentIndex;
96
97   };
98
99
100 } // end namespace clitk
101
102 #ifndef ITK_MANUAL_INSTANTIATION
103 #include "clitkVectorImageToImageFilter.txx"
104 #endif
105
106 #endif // #define clitkVectorImageToImageFilter_h
107
108