From 1bbbd127f84b5f5949b2cbb82badb9193b3f59e8 Mon Sep 17 00:00:00 2001 From: schaerer Date: Fri, 11 Jun 2010 12:50:28 +0000 Subject: [PATCH] add windowed sinc function --- .vimrc | 2 +- filters/clitkImageResampleGenericFilter.cxx | 29 +++++++++++++-------- vv/qt_ui/vvToolResample.ui | 5 ++++ 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.vimrc b/.vimrc index 05b2557..97cf20f 100644 --- a/.vimrc +++ b/.vimrc @@ -6,5 +6,5 @@ set expandtab "set cino={.5s,e-.5s,^-.5s set shiftwidth=2 -set makeprg=/home/joel/workspace/cvs/clitk3/fast_make.sh +set makeprg=${HOME}/workspace/cvs/clitk3/fast_make.sh set grepprg=clgrep diff --git a/filters/clitkImageResampleGenericFilter.cxx b/filters/clitkImageResampleGenericFilter.cxx index 81d0d61..aa84b8e 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); + } } } } diff --git a/vv/qt_ui/vvToolResample.ui b/vv/qt_ui/vvToolResample.ui index 63d680e..b62d443 100644 --- a/vv/qt_ui/vvToolResample.ui +++ b/vv/qt_ui/vvToolResample.ui @@ -924,6 +924,11 @@ Blut (faster BSpline) + + + Windowed Sinc + + -- 2.47.1