]> Creatis software - clitk.git/blob - itk/clitkVectorBSplineResampleImageFunctionWithLUT.h
Initial revision
[clitk.git] / itk / clitkVectorBSplineResampleImageFunctionWithLUT.h
1 #ifndef __clitkVectorBSplineResampleImageFunctionWithLUT_h
2 #define __clitkVectorBSplineResampleImageFunctionWithLUT_h
3
4 #include "clitkVectorBSplineInterpolateImageFunctionWithLUT.h"
5
6 namespace clitk
7 {
8 /** \class VectorBSplineResampleImageFunctionWithLUT
9  * \brief Resample image intensity from a VectorBSpline coefficient image using a LUT.
10  *
11  * This class resample the image intensity at a non-integer position
12  * from the input VectorBSpline coefficient image using a LUT.
13  * 
14  * Spline order may be from 0 to 5.
15  *
16  * In ITK, VectorBSpline coefficient can be generated using a
17  * VectorBSplineDecompositionImageFilter. 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 VectorBSplineInterpolateImageFunctionWithLUT
22  * \sa VectorBSplineDecompositionImageFilter
23  * \sa ResampleImageFilter
24  *
25  * \ingroup ImageFunctions
26  */
27 template <class TImageType, class TCoordRep = float>
28 class ITK_EXPORT VectorBSplineResampleImageFunctionWithLUT : 
29     public VectorBSplineInterpolateImageFunctionWithLUT<
30   TImageType,TCoordRep,ITK_TYPENAME TImageType::PixelType::ValueType > 
31 {
32 public:
33   /** Standard class typedefs. */
34   typedef VectorBSplineResampleImageFunctionWithLUT   Self;
35   typedef VectorBSplineInterpolateImageFunctionWithLUT< 
36     TImageType,TCoordRep, ITK_TYPENAME TImageType::PixelType::ValueType >  Superclass;
37   typedef itk::SmartPointer<Self>                    Pointer;
38   typedef itk::SmartPointer<const Self>              ConstPointer;
39
40   /** Run-time type information (and related methods). */
41   itkTypeMacro(VectorBSplineReconstructionImageFunction, 
42                VectorBSplineInterpolateImageFunctionWithLUT);
43
44   /** New macro for creation of through a Smart Pointer */
45   itkNewMacro( Self );
46
47   /** Set the input image representing the BSplineCoefficients */
48   virtual void SetInputImage(const TImageType * inputData)
49   {
50     // bypass my superclass
51     this->itk::VectorInterpolateImageFunction<TImageType,TCoordRep>::SetInputImage(inputData);
52     this->m_Coefficients = inputData;
53     if ( this->m_Coefficients.IsNotNull() )
54       {
55       this->m_DataLength = this->m_Coefficients->GetBufferedRegion().GetSize();
56
57       // JV specific for BLUT ( contains the call to UpdatePrecomputedWeights() )
58       this->UpdateWeightsProperties();
59       }
60   }
61
62 protected:
63   VectorBSplineResampleImageFunctionWithLUT() {};
64   virtual ~VectorBSplineResampleImageFunctionWithLUT() {};
65   void PrintSelf(std::ostream& os, itk::Indent indent) const
66   {
67     this->Superclass::PrintSelf( os, indent );
68   }
69
70 private:
71   VectorBSplineResampleImageFunctionWithLUT(const Self&);//purposely not implemented
72 };
73
74 } // namespace clitk
75
76
77 #endif