Histogram normalisation should account for bin widths
A user showed me a set of overlapping histograms of several images that had the same number of non-zero voxels. They had set the histogram mode to "Probability" and the histograms roughly overlapped but they had vastly different heights... it didn't make sense, I thought, since they had selected "Probability". However, I realised this was because the histogram bin widths were completely different, and so the integral of the histograms were unequal.
Can I propose that what you really want for a "Probability" normalisation is having an integral of 1.0 instead of just having bar-heights sum to 1, i.e. so that the normalisation accounts for the bin width? (See the difference between normed=True
and density=True
in numpy's histogram)
Fix should just amount to changing this one line but I don't know the value of the bin spacing: https://git.fmrib.ox.ac.uk/fsl/fsleyes/fsleyes/-/blob/master/fsleyes/profiles/histogramprofile.py#L430