X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=itk%2FclitkGenericVectorInterpolator.txx;h=b2778494be3386db163b40d0bd48db09c112569f;hb=d8e6a6c0b380c2e7b542a2b9d922dc982a3d0d85;hp=9fd6892f663ce968ca92567cb20d0a21185ac379;hpb=0b7c9b1e1215634b02cbd38d4e4ba101d6111ba8;p=clitk.git diff --git a/itk/clitkGenericVectorInterpolator.txx b/itk/clitkGenericVectorInterpolator.txx index 9fd6892..b277849 100644 --- a/itk/clitkGenericVectorInterpolator.txx +++ b/itk/clitkGenericVectorInterpolator.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 __clitkGenericVectorInterpolator_txx +#ifndef __clitkGenericVectorInterpolator_txx #define __clitkGenericVectorInterpolator_txx #include "clitkGenericVectorInterpolator.h" @@ -23,68 +23,65 @@ namespace clitk { - //========================================================================================================================= - //constructor - template - GenericVectorInterpolator::GenericVectorInterpolator() - { - m_Interpolator=NULL; - m_Verbose=false; +//========================================================================================================================= +//constructor +template +GenericVectorInterpolator::GenericVectorInterpolator() +{ + m_Interpolator=NULL; + m_Verbose=false; +} + + +//========================================================================================================================= +//Get the pointer +template +typename GenericVectorInterpolator::InterpolatorPointer +GenericVectorInterpolator::GetInterpolatorPointer() +{ + //============================================================================ + // We retrieve the type of interpolation from the command line + //============================================================================ + typename InterpolatorType::Pointer interpolator; + + switch ( m_ArgsInfo.interpVF_arg ) { + case 0: + + interpolator= itk::VectorNearestNeighborInterpolateImageFunction< ImageType,TCoordRep >::New(); + if (m_Verbose) std::cout<<"Using nearestneighbor interpolation..."<::New(); + if (m_Verbose) std::cout<<"Using linear interpolation..."<::Pointer m =clitk::VectorBSplineInterpolateImageFunction< ImageType,TCoordRep >::New(); + m->SetSplineOrder(m_ArgsInfo.interpVFOrder_arg); + interpolator=m; + if (m_Verbose) std::cout<<"Using Bspline interpolation..."< - typename GenericVectorInterpolator::InterpolatorPointer - GenericVectorInterpolator::GetInterpolatorPointer() - { - //============================================================================ - // We retrieve the type of interpolation from the command line - //============================================================================ - typename InterpolatorType::Pointer interpolator; - - switch ( m_ArgsInfo.interpVF_arg ) - { - case 0: - - interpolator= itk::VectorNearestNeighborInterpolateImageFunction< ImageType,TCoordRep >::New(); - if (m_Verbose) std::cout<<"Using nearestneighbor interpolation..."<::New(); - if (m_Verbose) std::cout<<"Using linear interpolation..."<::Pointer m =clitk::VectorBSplineInterpolateImageFunction< ImageType,TCoordRep >::New(); - m->SetSplineOrder(m_ArgsInfo.interpVFOrder_arg); - interpolator=m; - if (m_Verbose) std::cout<<"Using Bspline interpolation..."<::Pointer m =clitk::VectorBSplineInterpolateImageFunctionWithLUT< ImageType,TCoordRep >::New(); - m->SetSplineOrder(m_ArgsInfo.interpVFOrder_arg); - m->SetLUTSamplingFactor(m_ArgsInfo.interpVFSF_arg); - interpolator=m; - if (m_Verbose) std::cout<<"Using BLUT interpolation..."<::Pointer m =clitk::VectorBSplineInterpolateImageFunctionWithLUT< ImageType,TCoordRep >::New(); + m->SetSplineOrder(m_ArgsInfo.interpVFOrder_arg); + m->SetLUTSamplingFactor(m_ArgsInfo.interpVFSF_arg); + interpolator=m; + if (m_Verbose) std::cout<<"Using BLUT interpolation..."<