From: Simon Rit Date: Tue, 2 Jan 2018 15:13:18 +0000 (+0100) Subject: COMP: fix test logic for ITK version which failed with the new ITK v5 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=d95673a37d96951d0eeb9ff2445fbf7531c2e5d0;p=clitk.git COMP: fix test logic for ITK version which failed with the new ITK v5 --- diff --git a/registration/clitkBLUTDIRGenericFilter.cxx b/registration/clitkBLUTDIRGenericFilter.cxx index 9f7b84f..6c80fd9 100644 --- a/registration/clitkBLUTDIRGenericFilter.cxx +++ b/registration/clitkBLUTDIRGenericFilter.cxx @@ -30,14 +30,10 @@ It is distributed under dual licence #include "clitkBLUTDIRGenericFilter.h" #include "clitkBLUTDIRCommandIterationUpdateDVF.h" #include "itkCenteredTransformInitializer.h" -#if ITK_VERSION_MAJOR >= 4 -# if ITK_VERSION_MINOR < 6 -# include "itkTransformToDisplacementFieldSource.h" -# else -# include "itkTransformToDisplacementFieldFilter.h" -# endif +#if (ITK_VERSION_MAJOR == 4) && (ITK_VERSION_MINOR < 6) +# include "itkTransformToDisplacementFieldSource.h" #else -# include "itkTransformToDeformationFieldSource.h" +# include "itkTransformToDisplacementFieldFilter.h" #endif namespace clitk @@ -789,12 +785,10 @@ namespace clitk //======================================================= typedef itk::Vector< float, SpaceDimension > DisplacementType; typedef itk::Image< DisplacementType, InputImageType::ImageDimension > DisplacementFieldType; -#if ITK_VERSION_MAJOR >= 4 -# if ITK_VERSION_MINOR < 6 +#if (ITK_VERSION_MAJOR == 4) && (ITK_VERSION_MINOR < 6) typedef itk::TransformToDisplacementFieldSource ConvertorType; -# else +#else typedef itk::TransformToDisplacementFieldFilter ConvertorType; -# endif #endif typename ConvertorType::Pointer filter= ConvertorType::New(); filter->SetNumberOfThreads(1); diff --git a/registration/clitkConvertBLUTCoeffsToVFFilter.h b/registration/clitkConvertBLUTCoeffsToVFFilter.h index dc85c7a..7ae33eb 100644 --- a/registration/clitkConvertBLUTCoeffsToVFFilter.h +++ b/registration/clitkConvertBLUTCoeffsToVFFilter.h @@ -7,12 +7,10 @@ #include "clitkImageCommon.h" #include "clitkBSplineDeformableTransform.h" #include "itkBSplineDeformableTransform.h" -#if ITK_VERSION_MAJOR >= 4 -# if ITK_VERSION_MINOR < 6 -# include "itkTransformToDisplacementFieldSource.h" -# else -# include "itkTransformToDisplacementFieldFilter.h" -# endif +#if (ITK_VERSION_MAJOR == 4) && (ITK_VERSION_MINOR < 6) +# include "itkTransformToDisplacementFieldSource.h" +#else +# include "itkTransformToDisplacementFieldFilter.h" #endif namespace clitk @@ -51,12 +49,10 @@ namespace clitk typedef itk::Transform< double, TDVFType::ImageDimension, TDVFType::ImageDimension> GenericTransformType; -#if ITK_VERSION_MAJOR >= 4 -# if ITK_VERSION_MINOR < 6 - typedef itk::TransformToDisplacementFieldSource ConvertorType; -# else - typedef itk::TransformToDisplacementFieldFilter ConvertorType; -# endif +#if (ITK_VERSION_MAJOR == 4) && (ITK_VERSION_MINOR < 6) + typedef itk::TransformToDisplacementFieldSource ConvertorType; +#else + typedef itk::TransformToDisplacementFieldFilter ConvertorType; #endif itkNewMacro(Self); diff --git a/registration/clitkMatrixTransformToVFGenericFilter.h b/registration/clitkMatrixTransformToVFGenericFilter.h index 9aa5489..4f8fa7c 100644 --- a/registration/clitkMatrixTransformToVFGenericFilter.h +++ b/registration/clitkMatrixTransformToVFGenericFilter.h @@ -36,12 +36,10 @@ //itk include #include "itkLightObject.h" -#if ITK_VERSION_MAJOR >= 4 -# if ITK_VERSION_MINOR < 6 -# include "itkTransformToDisplacementFieldSource.h" -# else -# include "itkTransformToDisplacementFieldFilter.h" -# endif +#if (ITK_VERSION_MAJOR == 4) && (ITK_VERSION_MINOR < 6) +# include "itkTransformToDisplacementFieldSource.h" +#else +# include "itkTransformToDisplacementFieldFilter.h" #endif #include "itkAffineTransform.h" diff --git a/registration/clitkMatrixTransformToVFGenericFilter.txx b/registration/clitkMatrixTransformToVFGenericFilter.txx index 8a36a88..8bc8877 100644 --- a/registration/clitkMatrixTransformToVFGenericFilter.txx +++ b/registration/clitkMatrixTransformToVFGenericFilter.txx @@ -78,12 +78,10 @@ namespace clitk typedef itk::Image OutputImageType; // Filter -#if ITK_VERSION_MAJOR >= 4 -# if ITK_VERSION_MINOR < 6 +#if (ITK_VERSION_MAJOR == 4) && (ITK_VERSION_MINOR < 6) typedef itk::TransformToDisplacementFieldSource ConvertorType; -# else +#else typedef itk::TransformToDisplacementFieldFilter ConvertorType; -# endif #endif typename ConvertorType::Pointer filter= ConvertorType::New();