vtkITKImageThresholdCalculator fails with errors like this recently (and crashes or just provides invalid result):
Failed to compute threshold value using method Shanbhag. Details: itk::ExceptionObject (00000076F88F6C90) Location: "void __cdecl itk::ImageConstIterator<class itk::Image<int,3> >::SetRegion(const class itk::ImageRegion<3> &)" File: c:\d\s4d\itk\modules\core\common\include\itkImageConstIterator.h Line: 210 Description: itk::ERROR: Region ImageRegion (00000076F88F6E68) Dimension: 3 Index: [0, 0, 0] Size: [512, 512, 9] is outside of buffered region ImageRegion (0000019E5F947430) Dimension: 3 Index: [0, 0, 0] Size: [0, 0, 0]
It still worked fine in Slicer 4.11.0-2019-08-11 (revision 28433), so I guess it is due to recent ITK updates.
How to reproduce: Load a volume, go to segment editor, select Threshold effect, click on left or right arrow buttons in “Automatic threshold” row.
Does anyone have a clue why could this happen? I don’t see anything special in vtkITKImageThresholdCalculator.cxx that I would expect to break due to an ITK update.