From: Vivien Delmon Date: Wed, 18 May 2011 08:52:57 +0000 (+0200) Subject: itk4 migration X-Git-Tag: v1.2.1~20^2~1 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=cc820a586a00b6fedf5063d254fa32803b1fddf6;p=clitk.git itk4 migration - BinaryFunctorImageFilters taking constant were removed from itk by adding SetConstant method to their Image x Image counterpart. --- 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(); }