(This thread was started already in the old list at: http://itk-users.7.n7.nabble.com/ITK-users-OtsuMultipleThresholdsImageFilter-creates-asymmetric-classes-for-symmetric-a-distribution-td38761.html)
I have investigated the problem described there and found the following bug:
When OtsuMultipleThresholdsImageFilter computes the classFrequency vector (in IncrementThresholds) it accumulates the frequencies in the histogram bins ]previous index, this index], so that the bin of the previous index is excluded, but the bin of the current index is included. This means the threshold is effectively at the UPPER boundary of the histogram bin.
When the actual threshold to be returned is computed (line 329), it uses the function GetMeasurement that returns the MIDPOINT of the bin:
m_Output[j] = histogram->GetMeasurement(maxVarThresholdIndexes[j],0);
This discrepancy leads to the error reported earlier.
I suggest the following fix. Replace line 329 with:
m_Output[j] = histogram->GetMaxs()[maxVarThresholdIndexes[j]];
which I understand gives corresponding maximum values of the bin, that were effectively used to discriminate into the classes during the variance maximization algorithm.