]> Creatis software - clitk.git/commitdiff
add windowed sinc function
authorschaerer <schaerer>
Fri, 11 Jun 2010 12:50:28 +0000 (12:50 +0000)
committerschaerer <schaerer>
Fri, 11 Jun 2010 12:50:28 +0000 (12:50 +0000)
.vimrc
filters/clitkImageResampleGenericFilter.cxx
vv/qt_ui/vvToolResample.ui

diff --git a/.vimrc b/.vimrc
index 05b25579fd426b4e14825024ce7b4e877224168d..97cf20f9b8ab76ae4ee5a3be96f6c0ded7e15e7b 100644 (file)
--- 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
index 81d0d6197d3b046c7ba80f9d1751249398f6dfaa..aa84b8e4fba1eafcced7237585e9a7a043954e71 100644 (file)
@@ -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<InputImageType, double> InterpolatorType;
-        typename InterpolatorType::Pointer interpolator = InterpolatorType::New();
-        interpolator->SetSplineOrder(mBSplineOrder);
+      if (mInterpolatorName == "windowed sinc") {
+        typedef itk::WindowedSincInterpolateImageFunction<InputImageType, 4> InterpolatorType;
+        typename InterpolatorType::Pointer interpolator =  InterpolatorType::New();
         filter->SetInterpolator(interpolator);
       } else {
-        if (mInterpolatorName == "blut") {
-          typedef itk::BSplineInterpolateImageFunctionWithLUT<InputImageType, double> InterpolatorType;
+        if (mInterpolatorName == "bspline") {
+          typedef itk::BSplineInterpolateImageFunction<InputImageType, double> 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<InputImageType, double> 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);
+          }
         }
       }
     }
index 63d680e2c8008dac3eb63934d88cc7b949af0ca3..b62d4436e8fc380e582096384ad6306823ada15c 100644 (file)
               <string>Blut (faster BSpline)</string>
              </property>
             </item>
+            <item>
+             <property name="text">
+              <string>Windowed Sinc</string>
+             </property>
+            </item>
            </widget>
           </item>
          </layout>