1 #ifndef CLITKIMAGERESAMPLEGENERICFILTER_H
2 #define CLITKIMAGERESAMPLEGENERICFILTER_H
4 -------------------------------------------------------------------
5 * @file clitkVFResampleGenericFilter.h
6 * @author David Sarrut <David.Sarrut@creatis.insa-lyon.fr>
7 * @date 23 Feb 2008 08:37:53
10 -------------------------------------------------------------------*/
13 #include "clitkCommon.h"
14 #include "clitkImageCommon.h"
15 #include "clitkImageToImageGenericFilter.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"
35 //--------------------------------------------------------------------
36 class VFResampleGenericFilter:
37 public clitk::ImageToImageGenericFilter<VFResampleGenericFilter> {
41 VFResampleGenericFilter();
44 typedef VFResampleGenericFilter Self;
45 typedef itk::SmartPointer<Self> Pointer;
46 typedef itk::SmartPointer<const Self> ConstPointer;
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; }
59 //--------------------------------------------------------------------
60 // Main function called each time the filter is updated
61 template<class InputImageType>
62 void UpdateWithInputImageType();
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;
75 std::vector<int> mSamplingFactors;
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);
83 }; // end class VFResampleGenericFilter
84 //--------------------------------------------------------------------
86 #include "clitkVFResampleGenericFilter.txx"
89 //--------------------------------------------------------------------
91 #endif /* end #define CLITKIMAGERESAMPLEGENERICFILTER_H */