X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=itk%2FclitkGenericInterpolator.txx;h=c401e8fa6591d60b9ec241b8f6bd1165b760e585;hb=f34fdef46fa656a1eb32271c0b9bf7d81bc7fc35;hp=072d3c6d7dc8748379d2d5d018371a303fcb48a8;hpb=0b7c9b1e1215634b02cbd38d4e4ba101d6111ba8;p=clitk.git diff --git a/itk/clitkGenericInterpolator.txx b/itk/clitkGenericInterpolator.txx index 072d3c6..c401e8f 100644 --- a/itk/clitkGenericInterpolator.txx +++ b/itk/clitkGenericInterpolator.txx @@ -1,7 +1,7 @@ /*========================================================================= Program: vv http://www.creatis.insa-lyon.fr/rio/vv - Authors belong to: + Authors belong to: - University of LYON http://www.universite-lyon.fr/ - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr @@ -15,7 +15,7 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html ======================================================================-====*/ -#ifndef __clitkGenericInterpolator_txx +#ifndef __clitkGenericInterpolator_txx #define __clitkGenericInterpolator_txx #include "clitkGenericInterpolator.h" @@ -23,69 +23,66 @@ namespace clitk { - //========================================================================================================================= - //constructor - template - GenericInterpolator::GenericInterpolator() - { - m_Interpolator=NULL; - m_Verbose=false; +//========================================================================================================================= +//constructor +template +GenericInterpolator::GenericInterpolator() +{ + m_Interpolator=NULL; + m_Verbose=false; +} + + +//========================================================================================================================= +//Get the pointer +template +typename GenericInterpolator::InterpolatorPointer +GenericInterpolator::GetInterpolatorPointer() +{ + //============================================================================ + // We retrieve the type of interpolation from the command line + //============================================================================ + typename InterpolatorType::Pointer interpolator; + + switch ( m_ArgsInfo.interp_arg ) { + case 0: + + interpolator= itk::NearestNeighborInterpolateImageFunction< ImageType,TCoordRep >::New(); + if (m_Verbose) std::cout<<"Using nearestneighbor interpolation..."<::New(); + if (m_Verbose) std::cout<<"Using linear interpolation..."<::Pointer m =itk::BSplineInterpolateImageFunction< ImageType,TCoordRep >::New(); + m->SetSplineOrder(m_ArgsInfo.interpOrder_arg); + interpolator=m; + if (m_Verbose) std::cout<<"Using Bspline interpolation..."< - typename GenericInterpolator::InterpolatorPointer - GenericInterpolator::GetInterpolatorPointer() - { - //============================================================================ - // We retrieve the type of interpolation from the command line - //============================================================================ - typename InterpolatorType::Pointer interpolator; - - switch ( m_ArgsInfo.interp_arg ) - { - case 0: - - interpolator= itk::NearestNeighborInterpolateImageFunction< ImageType,TCoordRep >::New(); - if (m_Verbose) std::cout<<"Using nearestneighbor interpolation..."<::New(); - if (m_Verbose) std::cout<<"Using linear interpolation..."<::Pointer m =itk::BSplineInterpolateImageFunction< ImageType,TCoordRep >::New(); - m->SetSplineOrder(m_ArgsInfo.interpOrder_arg); - interpolator=m; - if (m_Verbose) std::cout<<"Using Bspline interpolation..."<::Pointer m =itk::BSplineInterpolateImageFunctionWithLUT< ImageType,TCoordRep >::New(); - m->SetSplineOrder(m_ArgsInfo.interpOrder_arg); - m->SetLUTSamplingFactor(m_ArgsInfo.interpSF_arg); - interpolator=m; - if (m_Verbose) std::cout<<"Using BLUT interpolation..."<::Pointer m =itk::BSplineInterpolateImageFunctionWithLUT< ImageType,TCoordRep >::New(); + m->SetSplineOrder(m_ArgsInfo.interpOrder_arg); + m->SetLUTSamplingFactor(m_ArgsInfo.interpSF_arg); + interpolator=m; + if (m_Verbose) std::cout<<"Using BLUT interpolation..."<