Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG: Updated VTK to fix histogram computation for volumes containing NaN
Fixes #4907. Contains: Revision: dd7e051af68cfbf3675e411494af7169fc7d5618 Author: Andras Lasso <lasso@queensu.ca> Date: 2020-05-01 1:36:14 AM Message: * [backport MR-6846] BUG: Fix crash in vtkImageHistogram if input contains NaN vtkImageHistogram caused application crash when input image contained NaN value using Intel TBB backend, Visual Studio 2017, x64. The problem was that when the image contained a NaN value then the computed scalar range was set to (Nan, Nan), which later got converted to invalid bin min/max indexes. The safety check that should have forced the indices to the valid range did not work, as it relied on comparison with a NaN value. Fixed computation of scalar range (similar to how it is done here: https://gitlab.kitware.com/vtk/vtk/-/commit/06d553fb232ac3992b99df47613506f106d2f46d), by changing the order of operands in the ternary operator. To make sure that similar error do not cause crash in the future, added a NaN-value check in the bin range computation, too. Added test case to verify that the results are correct and the application does not crash anymore if input image contains NaN.
- Loading branch information