I’ve added automatic thresholding to 3D Slicer’s segment editor and while testing it, I’ve got index out of range errors due to writing past the last element in a vector in LiThresholdCalculator<THistogram, TOutput>::GenerateData(void) in this line 94.
Exception thrown at 0x00007FFBF90CF218 in SlicerApp-real.exe: Microsoft C++ exception: itk::InvalidArgumentError at memory location 0x0000008369534A38.
For example, size of histogram was 64 (value of
size variable was 64) and when I got the error when
ih variable value was 64.
I don’t have time to further analyze this, but solution could be to add check to make sure that
ih is lower that
size (it is done later in the code). Or, maybe
ih <= histthresh should be changed to
ih < histthresh?