]> Creatis software - clitk.git/blob - itk/itkBSplineResampleImageFunctionWithLUT.h
Set Directions to CropImage Like
[clitk.git] / itk / itkBSplineResampleImageFunctionWithLUT.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://www.centreleonberard.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 #ifndef __itkBSplineResampleImageFunctionWithLUT_h
19 #define __itkBSplineResampleImageFunctionWithLUT_h
20 #include "itkBSplineInterpolateImageFunctionWithLUT.h"
21
22 namespace itk
23 {
24 /** \class BSplineResampleImageFunctionWithLUT
25  * \brief Resample image intensity from a BSpline coefficient image using a LUT.
26  *
27  * This class resample the image intensity at a non-integer position
28  * from the input BSpline coefficient image using a LUT.
29  * 
30  * Spline order may be from 0 to 5.
31  *
32  * In ITK, BSpline coefficient can be generated using a
33  * BSplineDecompositionImageFilter. Using this image function in
34  * conjunction with ResampleImageFunction allows the reconstruction
35  * of the original image at different resolution and size.
36  *
37  * \sa BSplineInterpolateImageFunctionWithLUT
38  * \sa BSplineDecompositionImageFilter
39  * \sa ResampleImageFilter
40  *
41  * \ingroup ImageFunctions
42  */
43 template <class TImageType, class TCoordRep = float>
44 class ITK_EXPORT BSplineResampleImageFunctionWithLUT : 
45     public BSplineInterpolateImageFunctionWithLUT<
46   TImageType,TCoordRep,typename TImageType::PixelType >
47 {
48 public:
49   /** Standard class typedefs. */
50   typedef BSplineResampleImageFunctionWithLUT                   Self;
51   typedef BSplineInterpolateImageFunctionWithLUT< 
52     TImageType,TCoordRep, typename TImageType::PixelType >  Superclass;
53   typedef SmartPointer<Self>                                    Pointer;
54   typedef SmartPointer<const Self>                              ConstPointer;
55
56   /** Run-time type information (and related methods). */
57   itkTypeMacro(BSplineReconstructionImageFunction, 
58                BSplineInterpolateImageFunctionWithLUT);
59
60   /** New macro for creation of through a Smart Pointer */
61   itkNewMacro( Self );
62
63   /** Set the input image representing the BSplineCoefficients */
64   virtual void SetInputImage(const TImageType * inputData)
65   {
66     // bypass my superclass
67     this->InterpolateImageFunction<TImageType,TCoordRep>::SetInputImage(inputData);
68     this->m_Coefficients = inputData;
69     if ( this->m_Coefficients.IsNotNull() )
70       {
71       this->m_DataLength = this->m_Coefficients->GetBufferedRegion().GetSize();
72
73       // JV specific for BLUT ( contains the call to UpdatePrecomputedWeights() )
74       this->UpdateWeightsProperties();
75       }
76   }
77
78 protected:
79   BSplineResampleImageFunctionWithLUT() {};
80   virtual ~BSplineResampleImageFunctionWithLUT() {};
81   void PrintSelf(std::ostream& os, Indent indent) const
82   {
83     this->Superclass::PrintSelf( os, indent );
84   }
85
86 private:
87   BSplineResampleImageFunctionWithLUT(const Self&);//purposely not implemented
88 };
89
90 } // namespace itk
91
92
93 #endif
94