]> Creatis software - clitk.git/commitdiff
ported my changes to the new filter. Need to port the vv tool to use it, and add...
authorschaerer <schaerer>
Thu, 17 Jun 2010 14:39:26 +0000 (14:39 +0000)
committerschaerer <schaerer>
Thu, 17 Jun 2010 14:39:26 +0000 (14:39 +0000)
will do so a day when simon + david are available :)

filters/clitkResampleImageGenericFilter.txx
itk/clitkResampleImageWithOptionsFilter.h
itk/clitkResampleImageWithOptionsFilter.txx

index 3b57f76e38f411772e794c5b9815bc0819f03265..fb4c80d095b6e6b368380aca43f87e5c35e83a28 100644 (file)
@@ -146,9 +146,13 @@ clitk::ResampleImageGenericFilter<args_info_type>::UpdateWithInputImageType()
         if (interp == "blut") {
           filter->SetInterpolationType(ResampleImageFilterType::B_LUT);
         } else {
-          std::cerr << "Error. I do not know interpolation '" << mArgsInfo.interp_arg
-                    << "'. Choose among: nn, linear, bspline, blut" << std::endl;
-          exit(0);
+          if (interp == "windowed sinc") {
+            filter->SetInterpolationType(ResampleImageFilterType::WSINC);
+          } else {
+            std::cerr << "Error. I do not know interpolation '" << mArgsInfo.interp_arg
+              << "'. Choose among: nn, linear, bspline, blut, windowed sinc" << std::endl;
+            exit(0);
+          }
         }
       }
     }
index d997a3d8a56f587309de603c4b0d84ab44b2be1a..d90c724f119a07ad2a4045dabe966dc05f6bead6 100644 (file)
@@ -80,7 +80,8 @@ namespace clitk {
       NearestNeighbor = 0,
       Linear = 1, 
       BSpline = 2, 
-      B_LUT = 3
+      B_LUT = 3,
+      WSINC
     } InterpolationTypeEnumeration;
 
     /** Input : image to resample */
index b9969dacb9b1ad1d4a69cae08e1752b5f5d185ef..aa09f7129812ce2cc3065e85925d5d09faac173f 100644 (file)
@@ -28,6 +28,7 @@
 #include "itkResampleImageFilter.h"
 #include "itkAffineTransform.h"
 #include "itkNearestNeighborInterpolateImageFunction.h"
+#include "itkWindowedSincInterpolateImageFunction.h"
 #include "itkLinearInterpolateImageFunction.h"
 #include "itkBSplineInterpolateImageFunction.h"
 #include "itkBSplineInterpolateImageFunctionWithLUT.h"
@@ -213,6 +214,7 @@ GenerateData()
     case Linear: std::cout << "Linear" << std::endl; break;
     case BSpline: std::cout << "BSpline " << m_BSplineOrder << std::endl; break;
     case B_LUT: std::cout << "B-LUT " << m_BSplineOrder << " " << m_BLUTSamplingFactor << std::endl; break;
+    case WSINC: std::cout << "Windowed Sinc" << std::endl; break;
     }
     std::cout << "Threads        = " << this->GetNumberOfThreads() << std::endl;
     std::cout << "LastDimIsTime  = " << m_LastDimensionIsTime << std::endl;
@@ -257,6 +259,12 @@ GenerateData()
     filter->SetInterpolator(interpolator);
     break;
   }
+  case WSINC: {
+    typedef itk::WindowedSincInterpolateImageFunction<InputImageType, 4> InterpolatorType;
+    typename InterpolatorType::Pointer interpolator =  InterpolatorType::New();
+    filter->SetInterpolator(interpolator);
+    break;
+  }
   }
 
   // Initial Gaussian blurring if needed