#include <QApplication>
#include <itkWarpImageFilter.h>
+#if ( ITK_VERSION_MAJOR < 5 )
#include <itkVectorResampleImageFilter.h>
+#else
+#include <itkResampleImageFilter.h>
+#endif
#include "vvMidPosition.h"
#include "clitkCommon.h"
//We resample the VF because itk's warp filter doesn't like it when the vf and the image have
//different spacings
+#if ( ITK_VERSION_MAJOR < 5 )
typename itk::VectorResampleImageFilter<OutputVFType, OutputVFType >::Pointer
resampler =itk::VectorResampleImageFilter<OutputVFType, OutputVFType >::New();
+#else
+ typename itk::ResampleImageFilter<OutputVFType, OutputVFType >::Pointer
+ resampler =itk::ResampleImageFilter<OutputVFType, OutputVFType >::New();
+#endif
resampler->SetInput(vf);
resampler->SetOutputSpacing(input->GetSpacing());
resampler->SetOutputOrigin(vf->GetOrigin());
typename FilterType::Pointer warp_filter = FilterType::New();
warp_filter->SetInput(input);
-#if ITK_VERSION_MAJOR >= 4
warp_filter->SetDisplacementField(resampler->GetOutput());
-#else
- warp_filter->SetDeformationField(resampler->GetOutput());
-#endif
warp_filter->SetOutputSpacing(input->GetSpacing());
warp_filter->SetOutputOrigin(input->GetOrigin());
warp_filter->SetOutputSize(input->GetLargestPossibleRegion().GetSize());