X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tools%2FclitkInvertVFGenericFilter.txx;h=93ad21f9aca5c3862c5ec905bb70d5cbf9c97a1f;hb=998ca9ca987553dc71578e5584e881f6bd537d91;hp=a18a6417c6b0ad26c3efc14225fba5d1c7444153;hpb=c234e07e4ef90bb8b08c75ca4f1b3a76055e7859;p=clitk.git diff --git a/tools/clitkInvertVFGenericFilter.txx b/tools/clitkInvertVFGenericFilter.txx index a18a641..93ad21f 100644 --- a/tools/clitkInvertVFGenericFilter.txx +++ b/tools/clitkInvertVFGenericFilter.txx @@ -18,7 +18,11 @@ #ifndef clitkInvertVFGenericFilter_txx #define clitkInvertVFGenericFilter_txx +#if ( ITK_VERSION_MAJOR < 5 ) #include "itkVectorResampleImageFilter.h" +#else +#include "itkResampleImageFilter.h" +#endif #include "clitkConvertBLUTCoeffsToVFFilter.h" /* ================================================= @@ -140,7 +144,11 @@ InvertVFGenericFilter::UpdateWithDimAndPixelType() spacing[i] = header->GetSpacing(i); } +#if ( ITK_VERSION_MAJOR < 5 ) typedef itk::VectorResampleImageFilter ResampleFilterType; +#else + typedef itk::ResampleImageFilter ResampleFilterType; +#endif typename ResampleFilterType::Pointer resampler = ResampleFilterType::New(); resampler->SetInput(input); resampler->SetOutputOrigin(input->GetOrigin()); @@ -156,7 +164,13 @@ InvertVFGenericFilter::UpdateWithDimAndPixelType() filter->SetInput(input); filter->SetVerbose(m_Verbose); - if (m_ArgsInfo.threads_given) filter->SetNumberOfThreads(m_ArgsInfo.threads_arg); + if (m_ArgsInfo.threads_given) { +#if ITK_VERSION_MAJOR <= 4 + filter->SetNumberOfThreads(m_ArgsInfo.threads_arg); +#else + filter->SetNumberOfWorkUnits(m_ArgsInfo.threads_arg); +#endif + } if (m_ArgsInfo.pad_given) { PixelType pad; if (m_ArgsInfo.pad_given != (pad.GetNumberOfComponents()) ) @@ -187,7 +201,13 @@ InvertVFGenericFilter::UpdateWithDimAndPixelType() } filter->SetVerbose(m_Verbose); - if (m_ArgsInfo.threads_given) filter->SetNumberOfThreads(m_ArgsInfo.threads_arg); + if (m_ArgsInfo.threads_given) { +#if ITK_VERSION_MAJOR <= 4 + filter->SetNumberOfThreads(m_ArgsInfo.threads_arg); +#else + filter->SetNumberOfWorkUnits(m_ArgsInfo.threads_arg); +#endif + } if (m_ArgsInfo.pad_given) { PixelType pad; if (m_ArgsInfo.pad_given != (pad.GetNumberOfComponents()) )