]> Creatis software - clitk.git/blob - filters/clitkVFResampleGenericFilter.h
removed headers
[clitk.git] / filters / clitkVFResampleGenericFilter.h
1 #ifndef CLITKIMAGERESAMPLEGENERICFILTER_H
2 #define CLITKIMAGERESAMPLEGENERICFILTER_H
3 /**
4  -------------------------------------------------------------------
5  * @file   clitkVFResampleGenericFilter.h
6  * @author David Sarrut <David.Sarrut@creatis.insa-lyon.fr>
7  * @date   23 Feb 2008 08:37:53
8
9  * @brief  
10  -------------------------------------------------------------------*/
11
12 // clitk include
13 #include "clitkCommon.h"
14 #include "clitkImageCommon.h"
15 #include "clitkImageToImageGenericFilter.h"
16
17 // itk include
18 #include "itkImage.h"
19 #include "itkVectorImage.h"
20 #include "itkFixedArray.h"
21 #include "itkImageFileReader.h"
22 #include "itkImageSeriesReader.h"
23 #include "itkImageFileWriter.h"
24 #include "itkRecursiveGaussianImageFilter.h"
25 #include "itkVectorResampleImageFilter.h"
26 #include "itkAffineTransform.h"
27 #include "itkVectorNearestNeighborInterpolateImageFunction.h"
28 #include "itkVectorLinearInterpolateImageFunction.h"
29 #include "itkBSplineInterpolateImageFunction.h"
30 #include "itkBSplineInterpolateImageFunctionWithLUT.h"
31 #include "itkCommand.h"
32
33 namespace clitk {
34   
35   //--------------------------------------------------------------------
36   class VFResampleGenericFilter: 
37     public clitk::ImageToImageGenericFilter<VFResampleGenericFilter> {
38     
39   public: 
40     // constructor
41     VFResampleGenericFilter();
42
43     // Types
44     typedef VFResampleGenericFilter       Self;
45     typedef itk::SmartPointer<Self>       Pointer;
46     typedef itk::SmartPointer<const Self> ConstPointer;
47
48     // New
49     itkNewMacro(Self);
50     
51     void SetOutputSize(const std::vector<int> & size);
52     void SetOutputSpacing(const std::vector<double> & spacing);
53     void SetGaussianSigma(const std::vector<double> & sigma);
54     void SetInterpolationName(const std::string & inter);
55     void SetDefaultPixelValue(double dpv) { mDefaultPixelValue = dpv;}
56     void SetBSplineOrder(int o) { mBSplineOrder = o; }
57     void SetBLUTSampling(int b) { mSamplingFactors.resize(1); mSamplingFactors[0] = b; }
58
59    //--------------------------------------------------------------------
60     // Main function called each time the filter is updated
61     template<class InputImageType>  
62     void UpdateWithInputImageType();
63
64   protected:
65     template<unsigned int Dim> void InitializeImageType();
66     //--------------------------------------------------------------------
67     std::string mInterpolatorName;
68     std::vector<int> mOutputSize;
69     std::vector<double> mOutputSpacing;
70     std::vector<double> mOutputOrigin;
71     double mDefaultPixelValue;
72     bool mApplyGaussianFilterBefore;
73     std::vector<double> mSigma;
74     int mBSplineOrder;
75     std::vector<int> mSamplingFactors;
76
77     //--------------------------------------------------------------------
78     template<unsigned int Dim, class PixelType, unsigned int DimCompo> 
79     void Update_WithDimAndPixelTypeAndComponent();
80     template<class ImageType>
81     typename ImageType::Pointer ComputeImage(typename ImageType::Pointer inputImage);
82     
83   }; // end class VFResampleGenericFilter
84   //--------------------------------------------------------------------
85     
86 #include "clitkVFResampleGenericFilter.txx"
87
88 } // end namespace
89 //--------------------------------------------------------------------
90     
91 #endif /* end #define CLITKIMAGERESAMPLEGENERICFILTER_H */
92