1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
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
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.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #ifndef __clitkGenericVectorInterpolator_h
19 #define __clitkGenericVectorInterpolator_h
20 #include "clitkImageCommon.h"
23 #if ( ITK_VERSION_MAJOR < 5 )
24 #include "itkVectorNearestNeighborInterpolateImageFunction.h"
25 #include "itkVectorLinearInterpolateImageFunction.h"
27 #include "itkNearestNeighborInterpolateImageFunction.h"
28 #include "itkLinearInterpolateImageFunction.h"
30 #include "clitkVectorBSplineInterpolateImageFunction.h"
31 #include "clitkVectorBSplineInterpolateImageFunctionWithLUT.h"
35 Requires at least the following section is the .ggo file
37 option "interpVF" - "Interpolation: 0=NN, 1=Linear, 2=BSpline, 3=BLUT" int no default="1"
38 option "interpVFOrder" - "Order if BLUT or BSpline (0-5)" int no default="3"
39 option "interpVFSF" - "Sampling factor if BLUT" int no default="20"
41 The use will look something like
43 typedef clitk::GenericVectorInterpolator<InputImageType, double> GenericVectorInterpolatorType;
44 typename GenericVectorInterpolatorType::Pointer genericInterpolator=GenericVectorInterpolatorType::New();
45 genericInterpolator->SetArgsInfo(m_ArgsInfo);
46 typedef itk::VectorInterpolateImageFunction<InputImageType, double> InterpolatorType;
47 typename InterpolatorType::Pointer interpolator=genericInterpolator->GetInterpolatorPointer();
54 template <class args_info_type, class ImageType, class TCoordRep >
55 class GenericVectorInterpolator : public itk::LightObject
58 //==============================================
59 typedef GenericVectorInterpolator Self;
60 typedef itk::LightObject Superclass;
61 typedef itk::SmartPointer<Self> Pointer;
62 typedef itk::SmartPointer<const Self> ConstPointer;
64 #if ( ITK_VERSION_MAJOR < 5 )
65 typedef itk::VectorInterpolateImageFunction<ImageType, TCoordRep> InterpolatorType;
67 typedef itk::InterpolateImageFunction<ImageType, TCoordRep> InterpolatorType;
69 typedef typename InterpolatorType::Pointer InterpolatorPointer;
71 /** Method for creation through the object factory. */
74 //==============================================
76 void SetArgsInfo(args_info_type args_info)
78 m_ArgsInfo= args_info;
79 m_Verbose=m_ArgsInfo.verbose_flag;
82 //==============================================
84 InterpolatorPointer GetInterpolatorPointer(void);
86 //==============================================
88 GenericVectorInterpolator();
89 ~GenericVectorInterpolator() {};
92 args_info_type m_ArgsInfo;
93 InterpolatorPointer m_Interpolator;
97 } // end namespace clitk
98 #ifndef ITK_MANUAL_INSTANTIATION
99 #include "clitkGenericVectorInterpolator.txx"
102 #endif // #define __clitkGenericVectorInterpolator_h