X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=filters%2FclitkImageResampleGenericFilter.cxx;h=ab8e1131dad78ff1bd86f13ea6a3609c55286f3f;hb=bb436e8274c510438ccb5ec1df531675321341bb;hp=81d0d6197d3b046c7ba80f9d1751249398f6dfaa;hpb=1e034c70105f0926939acaaa27ddb46e904ae8bf;p=clitk.git diff --git a/filters/clitkImageResampleGenericFilter.cxx b/filters/clitkImageResampleGenericFilter.cxx index 81d0d61..ab8e113 100644 --- a/filters/clitkImageResampleGenericFilter.cxx +++ b/filters/clitkImageResampleGenericFilter.cxx @@ -38,6 +38,7 @@ #include "itkResampleImageFilter.h" #include "itkAffineTransform.h" #include "itkNearestNeighborInterpolateImageFunction.h" +#include "itkWindowedSincInterpolateImageFunction.h" #include "itkLinearInterpolateImageFunction.h" #include "itkBSplineInterpolateImageFunction.h" #include "itkBSplineInterpolateImageFunctionWithLUT.h" @@ -141,22 +142,28 @@ void clitk::ImageResampleGenericFilter::UpdateWithInputImageType() typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); filter->SetInterpolator(interpolator); } else { - if (mInterpolatorName == "bspline") { - typedef itk::BSplineInterpolateImageFunction InterpolatorType; - typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); - interpolator->SetSplineOrder(mBSplineOrder); + if (mInterpolatorName == "windowed sinc") { + typedef itk::WindowedSincInterpolateImageFunction InterpolatorType; + typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); filter->SetInterpolator(interpolator); } else { - if (mInterpolatorName == "blut") { - typedef itk::BSplineInterpolateImageFunctionWithLUT InterpolatorType; + if (mInterpolatorName == "bspline") { + typedef itk::BSplineInterpolateImageFunction InterpolatorType; typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); interpolator->SetSplineOrder(mBSplineOrder); - interpolator->SetLUTSamplingFactor(mSamplingFactors[0]); - filter->SetInterpolator(interpolator); + filter->SetInterpolator(interpolator); } else { - std::cerr << "Sorry, I do not know the interpolator '" << mInterpolatorName - << "'. Known interpolators are : nn, linear, bspline, blut" << std::endl; - exit(0); + if (mInterpolatorName == "blut") { + typedef itk::BSplineInterpolateImageFunctionWithLUT InterpolatorType; + typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); + interpolator->SetSplineOrder(mBSplineOrder); + interpolator->SetLUTSamplingFactor(mSamplingFactors[0]); + filter->SetInterpolator(interpolator); + } else { + std::cerr << "Sorry, I do not know the interpolator '" << mInterpolatorName + << "'. Known interpolators are : nn, linear, bspline, blut" << std::endl; + exit(0); + } } } } @@ -187,7 +194,7 @@ void clitk::ImageResampleGenericFilter::UpdateWithInputImageType() try { filter->Update(); } catch( itk::ExceptionObject & err ) { - std::cerr << "Error while filtering " << mInputFilenames[0].c_str() + std::cerr << "Error while filtering " << m_InputFilenames[0].c_str() << " " << err << std::endl; exit(0); }