]> Creatis software - clitk.git/blobdiff - tools/clitkVFResampleGenericFilter.cxx
With ITKv5, change VectorResample and VectorCast Image Filter to Resample and Cast...
[clitk.git] / tools / clitkVFResampleGenericFilter.cxx
index d287fec36e0b4047b64c7c5490b59536afcdb810..d60b8d0d9ae145a2effb3bf908eb998ae366a96d 100644 (file)
@@ -111,7 +111,11 @@ clitk::VFResampleGenericFilter::ComputeImage(typename ImageType::Pointer inputIm
   typedef typename ImageType::PointType PointType;
 
   // Create Image Filter
+#if ( ITK_VERSION_MAJOR < 5 )
   typedef itk::VectorResampleImageFilter<ImageType,ImageType> FilterType;
+#else
+  typedef itk::ResampleImageFilter<ImageType,ImageType> FilterType;
+#endif
   typename FilterType::Pointer filter = FilterType::New();
 
   // Instance of the transform object to be passed to the resample
@@ -137,12 +141,20 @@ clitk::VFResampleGenericFilter::ComputeImage(typename ImageType::Pointer inputIm
 
   // Select interpolator
   if (mInterpolatorName == "nn") {
+#if ( ITK_VERSION_MAJOR < 5 )
     typedef itk::VectorNearestNeighborInterpolateImageFunction<ImageType, double> InterpolatorType;
+#else
+    typedef itk::NearestNeighborInterpolateImageFunction<ImageType, double> InterpolatorType;
+#endif
     typename InterpolatorType::Pointer interpolator = InterpolatorType::New();
     filter->SetInterpolator(interpolator);
   } else {
     if (mInterpolatorName == "linear") {
+#if ( ITK_VERSION_MAJOR < 5 )
       typedef itk::VectorLinearInterpolateImageFunction<ImageType, double> InterpolatorType;
+#else
+      typedef itk::LinearInterpolateImageFunction<ImageType, double> InterpolatorType;
+#endif
       typename InterpolatorType::Pointer interpolator =  InterpolatorType::New();
       filter->SetInterpolator(interpolator);
     } else {