From ce31f140af0b0edbea151dcd0877dab4b8cb24dd Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Sun, 17 Mar 2019 08:41:44 -0400 Subject: [PATCH] COMP: Specify type in LiThresholdCalculator min call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To address: In file included from /home/kitware/mattm/ITK/Modules/Filtering/Thresholding/include/itkLiThresholdCalculator.h:87:0, from Wrapping/Typedefs/itkLiThresholdCalculatorSwigInterface.h:19, from Wrapping/Modules/ITKThresholding/itkLiThresholdCalculatorPython.cpp:3371: /home/kitware/mattm/ITK/Modules/Filtering/Thresholding/include/itkLiThresholdCalculator.hxx: In instantiation of ‘void itk::LiThresholdCalculator::GenerateData() [with THistogram = itk::Statistics::Histogram; TOutput = float]’: Wrapping/Modules/ITKThresholding/itkLiThresholdCalculatorPython.cpp:8112:1: required from here /home/kitware/mattm/ITK/Modules/Filtering/Thresholding/include/itkLiThresholdCalculator.hxx:65:34: error: no matching function for call to ‘min(const MeasurementType&, double)’ const double bin_min = std::min(histogram->GetBinMin(0,0), 0.0); --- .../Thresholding/include/itkLiThresholdCalculator.hxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/Filtering/Thresholding/include/itkLiThresholdCalculator.hxx b/Modules/Filtering/Thresholding/include/itkLiThresholdCalculator.hxx index 1a64520becd..ffc18001136 100644 --- a/Modules/Filtering/Thresholding/include/itkLiThresholdCalculator.hxx +++ b/Modules/Filtering/Thresholding/include/itkLiThresholdCalculator.hxx @@ -22,6 +22,7 @@ #include "itkLiThresholdCalculator.h" #include "itkProgressReporter.h" #include "itkMath.h" +#include namespace itk { @@ -61,7 +62,7 @@ LiThresholdCalculator double temp; // If there are negative values then shift the values to zero. - const double bin_min = std::min(histogram->GetBinMin(0,0), 0.0); + const double bin_min = std::min(static_cast(histogram->GetBinMin(0,0)), 0.0); tolerance = 0.5; num_pixels = histogram->GetTotalFrequency();