1 #ifndef CLITKIMAGERESAMPLEGENERICFILTER_H
2 #define CLITKIMAGERESAMPLEGENERICFILTER_H
5 -------------------------------------------------------------------
6 * @file clitkImageResampleGenericFilter.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 "itkImageFileReader.h"
21 #include "itkImageSeriesReader.h"
22 #include "itkImageFileWriter.h"
23 #include "itkRecursiveGaussianImageFilter.h"
24 #include "itkResampleImageFilter.h"
25 #include "itkAffineTransform.h"
26 #include "itkNearestNeighborInterpolateImageFunction.h"
27 #include "itkLinearInterpolateImageFunction.h"
28 #include "itkBSplineInterpolateImageFunction.h"
29 #include "itkBSplineInterpolateImageFunctionWithLUT.h"
30 #include "itkCommand.h"
34 //--------------------------------------------------------------------
35 class ImageResampleGenericFilter: public clitk::ImageToImageGenericFilter {
39 ImageResampleGenericFilter();
42 typedef ImageResampleGenericFilter Self;
43 typedef ImageToImageGenericFilter Superclass;
44 typedef itk::SmartPointer<Self> Pointer;
45 typedef itk::SmartPointer<const Self> ConstPointer;
50 void SetOutputSize(const std::vector<int> & size);
51 void SetOutputSpacing(const std::vector<double> & spacing);
52 void SetGaussianSigma(const std::vector<double> & sigma);
53 void SetInterpolationName(const std::string & inter);
54 void SetDefaultPixelValue(double dpv) { mDefaultPixelValue = dpv;}
55 void SetBSplineOrder(int o) { mBSplineOrder = o; }
56 void SetBLUTSampling(int b) { mSamplingFactors.resize(1); mSamplingFactors[0] = b; }
61 //--------------------------------------------------------------------
62 std::string mInterpolatorName;
63 std::vector<int> mOutputSize;
64 std::vector<double> mOutputSpacing;
65 std::vector<double> mOutputOrigin;
66 double mDefaultPixelValue;
67 bool mApplyGaussianFilterBefore;
68 std::vector<double> mSigma;
70 std::vector<int> mSamplingFactors;
72 //--------------------------------------------------------------------
73 template<unsigned int Dim> void Update_WithDim();
74 template<unsigned int Dim, class PixelType> void Update_WithDimAndPixelType();
76 //--------------------------------------------------------------------
77 template<class ImageType>
78 typename ImageType::Pointer ComputeImage(typename ImageType::Pointer inputImage);
80 }; // end class ImageResampleGenericFilter
81 //--------------------------------------------------------------------
83 #include "clitkImageResampleGenericFilter.txx"
86 //--------------------------------------------------------------------
88 #endif /* end #define CLITKIMAGERESAMPLEGENERICFILTER_H */