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