1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
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
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.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #ifndef CLITKIMAGERESAMPLEGENERICFILTER_H
19 #define CLITKIMAGERESAMPLEGENERICFILTER_H
21 -------------------------------------------------------------------
22 * @file clitkVFResampleGenericFilter.h
23 * @author David Sarrut <David.Sarrut@creatis.insa-lyon.fr>
24 * @date 23 Feb 2008 08:37:53
27 -------------------------------------------------------------------*/
30 #include "clitkCommon.h"
31 #include "clitkImageCommon.h"
32 #include "clitkImageToImageGenericFilter.h"
36 #include "itkVectorImage.h"
37 #include "itkFixedArray.h"
38 #include "itkImageFileReader.h"
39 #include "itkImageSeriesReader.h"
40 #include "itkImageFileWriter.h"
41 #include "itkRecursiveGaussianImageFilter.h"
42 #include "itkVectorResampleImageFilter.h"
43 #include "itkAffineTransform.h"
44 #include "itkVectorNearestNeighborInterpolateImageFunction.h"
45 #include "itkVectorLinearInterpolateImageFunction.h"
46 #include "itkBSplineInterpolateImageFunction.h"
47 #include "itkBSplineInterpolateImageFunctionWithLUT.h"
48 #include "itkCommand.h"
52 //--------------------------------------------------------------------
53 class VFResampleGenericFilter:
54 public clitk::ImageToImageGenericFilter<VFResampleGenericFilter> {
58 VFResampleGenericFilter();
61 typedef VFResampleGenericFilter Self;
62 typedef itk::SmartPointer<Self> Pointer;
63 typedef itk::SmartPointer<const Self> ConstPointer;
68 void SetOutputSize(const std::vector<int> & size);
69 void SetOutputSpacing(const std::vector<double> & spacing);
70 void SetGaussianSigma(const std::vector<double> & sigma);
71 void SetInterpolationName(const std::string & inter);
72 void SetDefaultPixelValue(double dpv) { mDefaultPixelValue = dpv;}
73 void SetBSplineOrder(int o) { mBSplineOrder = o; }
74 void SetBLUTSampling(int b) { mSamplingFactors.resize(1); mSamplingFactors[0] = b; }
76 //--------------------------------------------------------------------
77 // Main function called each time the filter is updated
78 template<class InputImageType>
79 void UpdateWithInputImageType();
82 template<unsigned int Dim> void InitializeImageType();
83 //--------------------------------------------------------------------
84 std::string mInterpolatorName;
85 std::vector<int> mOutputSize;
86 std::vector<double> mOutputSpacing;
87 std::vector<double> mOutputOrigin;
88 double mDefaultPixelValue;
89 bool mApplyGaussianFilterBefore;
90 std::vector<double> mSigma;
92 std::vector<int> mSamplingFactors;
94 //--------------------------------------------------------------------
95 template<unsigned int Dim, class PixelType, unsigned int DimCompo>
96 void Update_WithDimAndPixelTypeAndComponent();
97 template<class ImageType>
98 typename ImageType::Pointer ComputeImage(typename ImageType::Pointer inputImage);
100 }; // end class VFResampleGenericFilter
101 //--------------------------------------------------------------------
104 //--------------------------------------------------------------------
106 #endif /* end #define CLITKIMAGERESAMPLEGENERICFILTER_H */