X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvMidPosition.cxx;h=ed5880b562fbc3c11e4ab9199a4eed14cc2e4332;hb=998ca9ca987553dc71578e5584e881f6bd537d91;hp=f91422a908a11f88acec664242587ff95e04a3a3;hpb=f6381b1392a2b4e14510a5a646386d76a2823f76;p=clitk.git diff --git a/vv/vvMidPosition.cxx b/vv/vvMidPosition.cxx index f91422a..ed5880b 100644 --- a/vv/vvMidPosition.cxx +++ b/vv/vvMidPosition.cxx @@ -18,7 +18,11 @@ #include #include +#if ( ITK_VERSION_MAJOR < 5 ) #include +#else +#include +#endif #include "vvMidPosition.h" #include "clitkCommon.h" @@ -95,8 +99,13 @@ vvImage::Pointer WarpRefImage(OutputVFType::Pointer vf,vvImage::Pointer image,in //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::Pointer resampler =itk::VectorResampleImageFilter::New(); +#else + typename itk::ResampleImageFilter::Pointer + resampler =itk::ResampleImageFilter::New(); +#endif resampler->SetInput(vf); resampler->SetOutputSpacing(input->GetSpacing()); resampler->SetOutputOrigin(vf->GetOrigin()); @@ -108,11 +117,7 @@ vvImage::Pointer WarpRefImage(OutputVFType::Pointer vf,vvImage::Pointer image,in 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());