From cc820a586a00b6fedf5063d254fa32803b1fddf6 Mon Sep 17 00:00:00 2001 From: Vivien Delmon Date: Wed, 18 May 2011 10:52:57 +0200 Subject: [PATCH] itk4 migration - BinaryFunctorImageFilters taking constant were removed from itk by adding SetConstant method to their Image x Image counterpart. --- ...elativePositionConstraintToLabelImageFilter.txx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/itk/clitkAddRelativePositionConstraintToLabelImageFilter.txx b/itk/clitkAddRelativePositionConstraintToLabelImageFilter.txx index a9f8a91..54f4311 100644 --- a/itk/clitkAddRelativePositionConstraintToLabelImageFilter.txx +++ b/itk/clitkAddRelativePositionConstraintToLabelImageFilter.txx @@ -32,7 +32,11 @@ #include #include #include -#include +#if ITK_VERSION_MAJOR >= 4 + #include +#else + #include +#endif // itk [Bloch et al] #include "RelativePositionPropImageFilter.h" @@ -359,10 +363,16 @@ GenerateData() // Divide by the number of relpos if (GetNumberOfAngles() != 1) { +#if ITK_VERSION_MAJOR >= 4 + typedef itk::DivideImageFilter DivideFilter; + typename DivideFilter::Pointer divideFilter = DivideFilter::New(); + divideFilter->SetConstant2(GetNumberOfAngles()); +#else typedef itk::DivideByConstantImageFilter DivideFilter; typename DivideFilter::Pointer divideFilter = DivideFilter::New(); - divideFilter->SetInput(m_FuzzyMap); divideFilter->SetConstant(GetNumberOfAngles()); +#endif + divideFilter->SetInput(m_FuzzyMap); divideFilter->Update(); m_FuzzyMap = divideFilter->GetOutput(); } -- 2.47.1