]> Creatis software - clitk.git/blob - itk/clitkVectorBSplineResampleImageFunction.h
Initial revision
[clitk.git] / itk / clitkVectorBSplineResampleImageFunction.h
1 #ifndef __clitkVectorBSplineResampleImageFunction_h
2 #define __clitkVectorBSplineResampleImageFunction_h
3
4 #include "clitkVectorBSplineInterpolateImageFunction.h"
5
6 namespace clitk
7 {
8 /** \class VectorBSplineResampleImageFunction
9  * \brief Resample image intensity from a VectorBSpline coefficient image.
10  *
11  * This class resample the image intensity at a non-integer position
12  * from the input VectorBSpline coefficient image.
13  * 
14  * Spline order may be from 0 to 5.
15  *
16  * In ITK, BSpline coefficient can be generated using a
17  * BSplineDecompositionImageFilter. Using this image function in
18  * conjunction with ResampleImageFunction allows the reconstruction
19  * of the original image at different resolution and size.
20  *
21  * \sa VectorBSplineInterpolateImageFunction
22  * \sa VectorBSplineDecompositionImageFilter
23  * \sa VectorResampleImageFilter
24  *
25  * \ingroup ImageFunctions
26  */
27 template <class TImageType, class TCoordRep = float>
28 class ITK_EXPORT VectorBSplineResampleImageFunction : 
29     public VectorBSplineInterpolateImageFunction<
30   TImageType,TCoordRep,ITK_TYPENAME TImageType::PixelType::ValueType > 
31 {
32 public:
33   /** Standard class typedefs. */
34   typedef VectorBSplineResampleImageFunction                          Self;
35   typedef VectorBSplineInterpolateImageFunction<TImageType,TCoordRep, ITK_TYPENAME TImageType::PixelType::ValueType >  Superclass;
36   typedef itk::SmartPointer<Self>                                    Pointer;
37   typedef itk::SmartPointer<const Self>                              ConstPointer;
38
39   /** Run-time type information (and related methods). */
40   itkTypeMacro(VectorBSplineResampleImageFunction, 
41                VectorBSplineInterpolateImageFunction);
42
43   /** New macro for creation of through a Smart Pointer */
44   itkNewMacro( Self );
45
46   /** Set the input image representing the BSplineCoefficients */
47   virtual void SetInputImage(const TImageType * inputData)
48     {
49       // bypass my superclass
50       this->itk::VectorInterpolateImageFunction<TImageType,TCoordRep>::SetInputImage(inputData);
51       this->m_Coefficients = inputData;
52       if ( this->m_Coefficients.IsNotNull() )
53         {
54           this->m_DataLength = this->m_Coefficients->GetBufferedRegion().GetSize();
55         }
56     }
57
58 protected:
59   VectorBSplineResampleImageFunction() {};
60   virtual ~VectorBSplineResampleImageFunction() {};
61
62 private:
63   VectorBSplineResampleImageFunction(const Self&);//purposely not implemented
64 };
65
66 } // namespace clitk
67
68
69 #endif