]> Creatis software - clitk.git/blob - tools/clitkImageResampleGenericFilter.h
Display values of two images and their difference in the same way instead of rounding...
[clitk.git] / tools / clitkImageResampleGenericFilter.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
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.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ======================================================================-====*/
18
19 #ifndef CLITKIMAGERESAMPLEGENERICFILTER_H
20 #define CLITKIMAGERESAMPLEGENERICFILTER_H
21
22 // clitk include
23 #include "clitkImageToImageGenericFilter.h"
24
25 namespace clitk {
26   
27   //--------------------------------------------------------------------
28   class ImageResampleGenericFilter: 
29     public ImageToImageGenericFilter<ImageResampleGenericFilter> {
30     
31   public: 
32     // constructor
33     ImageResampleGenericFilter();
34
35     // Types
36     typedef ImageResampleGenericFilter    Self;
37     typedef itk::SmartPointer<Self>       Pointer;
38     typedef itk::SmartPointer<const Self> ConstPointer;
39
40     // New
41     itkNewMacro(Self);
42     
43     void SetOutputSize(const std::vector<int> & size);
44     void SetOutputSpacing(const std::vector<double> & spacing);
45     void SetGaussianSigma(const std::vector<double> & sigma);
46     void SetInterpolationName(const std::string & inter);
47     void SetDefaultPixelValue(double dpv) { mDefaultPixelValue = dpv;}
48     void SetBSplineOrder(int o) { mBSplineOrder = o; }
49     void SetBLUTSampling(int b) { mSamplingFactors.resize(1); mSamplingFactors[0] = b; }
50
51     //--------------------------------------------------------------------
52     template<class InputImageType> void UpdateWithInputImageType();
53
54   protected:
55     //--------------------------------------------------------------------
56     std::string mInterpolatorName;
57     std::vector<int> mOutputSize;
58     std::vector<double> mOutputSpacing;
59     std::vector<double> mOutputOrigin;
60     double mDefaultPixelValue;
61     bool mApplyGaussianFilterBefore;
62     std::vector<double> mSigma;
63     int mBSplineOrder;
64     std::vector<int> mSamplingFactors;
65
66     //--------------------------------------------------------------------
67     template<unsigned int Dim> void InitializeImageTypeWithDim();
68      
69   }; // end class ImageResampleGenericFilter
70   //--------------------------------------------------------------------
71     
72   //#include "clitkImageResampleGenericFilter.txx"
73
74 } // end namespace
75 //--------------------------------------------------------------------
76     
77 #endif /* end #define CLITKIMAGERESAMPLEGENERICFILTER_H */
78