]> Creatis software - clitk.git/blob - itk/clitkVectorBSplineResampleImageFunction.h
Add 2 options to clitkImage2Dicom
[clitk.git] / itk / clitkVectorBSplineResampleImageFunction.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 __clitkVectorBSplineResampleImageFunction_h
19 #define __clitkVectorBSplineResampleImageFunction_h
20 #include "clitkVectorBSplineInterpolateImageFunction.h"
21
22 namespace clitk
23 {
24 /** \class VectorBSplineResampleImageFunction
25  * \brief Resample image intensity from a VectorBSpline coefficient image.
26  *
27  * This class resample the image intensity at a non-integer position
28  * from the input VectorBSpline coefficient image.
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 VectorBSplineInterpolateImageFunction
38  * \sa VectorBSplineDecompositionImageFilter
39  * \sa VectorResampleImageFilter
40  *
41  * \ingroup ImageFunctions
42  */
43 template <class TImageType, class TCoordRep = float>
44 class ITK_EXPORT VectorBSplineResampleImageFunction : 
45     public VectorBSplineInterpolateImageFunction<
46   TImageType,TCoordRep, typename TImageType::PixelType::ValueType >
47 {
48 public:
49   /** Standard class typedefs. */
50   typedef VectorBSplineResampleImageFunction                          Self;
51   typedef VectorBSplineInterpolateImageFunction<TImageType,TCoordRep, typename TImageType::PixelType::ValueType >  Superclass;
52   typedef itk::SmartPointer<Self>                                    Pointer;
53   typedef itk::SmartPointer<const Self>                              ConstPointer;
54
55   /** Run-time type information (and related methods). */
56   itkTypeMacro(VectorBSplineResampleImageFunction, 
57                VectorBSplineInterpolateImageFunction);
58
59   /** New macro for creation of through a Smart Pointer */
60   itkNewMacro( Self );
61
62   /** Set the input image representing the BSplineCoefficients */
63   virtual void SetInputImage(const TImageType * inputData)
64     {
65       // bypass my superclass
66       this->itk::VectorInterpolateImageFunction<TImageType,TCoordRep>::SetInputImage(inputData);
67       this->m_Coefficients = inputData;
68       if ( this->m_Coefficients.IsNotNull() )
69         {
70           this->m_DataLength = this->m_Coefficients->GetBufferedRegion().GetSize();
71         }
72     }
73
74 protected:
75   VectorBSplineResampleImageFunction() {};
76   virtual ~VectorBSplineResampleImageFunction() {};
77
78 private:
79   VectorBSplineResampleImageFunction(const Self&);//purposely not implemented
80 };
81
82 } // namespace clitk
83
84
85 #endif