X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tools%2FclitkInvertVFGenericFilter.txx;h=93ad21f9aca5c3862c5ec905bb70d5cbf9c97a1f;hb=998ca9ca987553dc71578e5584e881f6bd537d91;hp=812ed0c69db5737b56b0eccc26e68c48dab90f3b;hpb=4f2fb7a9394563fd56582639232a9fe12492c5d6;p=clitk.git diff --git a/tools/clitkInvertVFGenericFilter.txx b/tools/clitkInvertVFGenericFilter.txx index 812ed0c..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()) ) @@ -205,11 +225,7 @@ InvertVFGenericFilter::UpdateWithDimAndPixelType() case 2: { // Create the InverseDeformationFieldFilter -#if ITK_VERSION_MAJOR >= 4 typedef itk::InverseDisplacementFieldImageFilter FilterType; -#else - typedef itk::InverseDeformationFieldImageFilter FilterType; -#endif typename FilterType::Pointer filter =FilterType::New(); filter->SetInput(input); filter->SetOutputOrigin(input->GetOrigin());