]> Creatis software - clitk.git/commitdiff
COMP: fix test logic for ITK version which failed with the new ITK v5
authorSimon Rit <simon.rit@creatis.insa-lyon.fr>
Tue, 2 Jan 2018 15:13:18 +0000 (16:13 +0100)
committerSimon Rit <simon.rit@creatis.insa-lyon.fr>
Tue, 2 Jan 2018 15:13:18 +0000 (16:13 +0100)
registration/clitkBLUTDIRGenericFilter.cxx
registration/clitkConvertBLUTCoeffsToVFFilter.h
registration/clitkMatrixTransformToVFGenericFilter.h
registration/clitkMatrixTransformToVFGenericFilter.txx

index 9f7b84f456f36496f1be156400a0c43441dd2983..6c80fd911859199d28b36f618e2d01472c0d8eaa 100644 (file)
@@ -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<DisplacementFieldType, double> ConvertorType;
-#  else
+#else
       typedef itk::TransformToDisplacementFieldFilter<DisplacementFieldType, double> ConvertorType;
-#  endif
 #endif
       typename ConvertorType::Pointer filter= ConvertorType::New();
       filter->SetNumberOfThreads(1);
index dc85c7a445db478bf15294d68870d80b9d26decf..7ae33eb084baf8d057309d7f38e46ffe064c2f85 100644 (file)
@@ -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<OutputImageType, double> ConvertorType;
-#  else
-    typedef itk::TransformToDisplacementFieldFilter<OutputImageType, double> ConvertorType;
-#  endif
+#if (ITK_VERSION_MAJOR == 4) && (ITK_VERSION_MINOR < 6)
+  typedef itk::TransformToDisplacementFieldSource<OutputImageType, double> ConvertorType;
+#else
+  typedef itk::TransformToDisplacementFieldFilter<OutputImageType, double> ConvertorType;
 #endif
 
     itkNewMacro(Self);
index 9aa54895d3fb409b4144843b4e607e56c8ef2298..4f8fa7ceac08e6795503f0027c6b7581f2b46de9 100644 (file)
 
 //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"
 
index 8a36a882b91017a7c4d1e69cc1f34cd73cdcedd7..8bc8877cf9757239091cf126382cdfcc2a99397a 100644 (file)
@@ -78,12 +78,10 @@ namespace clitk
     typedef itk::Image<Displacement, Dimension> OutputImageType;
     
     // Filter
-#if ITK_VERSION_MAJOR >= 4
-#  if ITK_VERSION_MINOR < 6
+#if (ITK_VERSION_MAJOR == 4) && (ITK_VERSION_MINOR < 6)
     typedef itk::TransformToDisplacementFieldSource<OutputImageType, double> ConvertorType;
-#  else
+#else
     typedef itk::TransformToDisplacementFieldFilter<OutputImageType, double> ConvertorType;
-#  endif
 #endif
 
     typename   ConvertorType::Pointer filter= ConvertorType::New();