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 ===========================================================================**/
19 #ifndef __clitkGenericInterpolator_txx
20 #define __clitkGenericInterpolator_txx
22 #include "clitkGenericInterpolator.h"
28 //=========================================================================================================================
30 template <class args_info_type, class ImageType, class TCoordRep>
31 GenericInterpolator<args_info_type, ImageType, TCoordRep>::GenericInterpolator()
38 //=========================================================================================================================
40 template <class args_info_type, class ImageType, class TCoordRep>
41 typename GenericInterpolator<args_info_type, ImageType, TCoordRep>::InterpolatorPointer
42 GenericInterpolator<args_info_type, ImageType, TCoordRep>::GetInterpolatorPointer()
44 //============================================================================
45 // We retrieve the type of interpolation from the command line
46 //============================================================================
47 typename InterpolatorType::Pointer interpolator;
49 switch ( m_ArgsInfo.interp_arg ) {
52 interpolator= itk::NearestNeighborInterpolateImageFunction< ImageType,TCoordRep >::New();
53 if (m_Verbose) std::cout<<"Using nearestneighbor interpolation..."<<std::endl;
58 interpolator = itk::LinearInterpolateImageFunction< ImageType,TCoordRep >::New();
59 if (m_Verbose) std::cout<<"Using linear interpolation..."<<std::endl;
63 typename itk::BSplineInterpolateImageFunction< ImageType,TCoordRep >::Pointer m =itk::BSplineInterpolateImageFunction< ImageType,TCoordRep >::New();
64 m->SetSplineOrder(m_ArgsInfo.interpOrder_arg);
66 if (m_Verbose) std::cout<<"Using Bspline interpolation..."<<std::endl;
71 typename itk::BSplineInterpolateImageFunctionWithLUT< ImageType,TCoordRep >::Pointer m =itk::BSplineInterpolateImageFunctionWithLUT< ImageType,TCoordRep >::New();
72 m->SetSplineOrder(m_ArgsInfo.interpOrder_arg);
73 m->SetLUTSamplingFactor(m_ArgsInfo.interpSF_arg);
75 if (m_Verbose) std::cout<<"Using BLUT interpolation..."<<std::endl;
83 //============================================================================