I’ve created a script to test Slicer’s current (bimodal analysis based) auto window/level method and compare it to fixed percentile based method, on all Slicer sample images.
Description of methods used for generating the images
- baseline: current method in Slicer
- hist-0.1-99.9: minimum at 0.1th percentile, maximum at 99.9th percentile, no expansion (this setting is used by ITK-Snap)
- hist-1.0-99.9: minimum at 1th percentile, maximum at 99.9th percentile, min expanded by 10%
- hist-1.0-99.0-x0.10: minimum at 1th percentile, maximum at 99th percentile, min expanded by 10%, max expanded by 10%
- hist-1.0-99.0-x0.20: minimum at 1th percentile, maximum at 99th percentile, min expanded by 10%, max expanded by 20%
The fixed percentile based method is implemented in vtkImageHistogramStatistics: window min/max is set at a certain percentile of the histogram, optionally extended by a fraction of the window size.
From the results it is clear that the current auto window/level method is not optimal. Suppressing the first peak in the histogram is not necessarily a good idea for general use, as important signal may be in the first (“noise”) peak and it is hard to reliably detect boundaries of the “signal” peak. It would probably better to switch to the simple percentile method.
@fedorov @pieper @Fernando @jamesobutler
Could you have a look at the generated images and tell if you have any preference for which method we should use in Slicer?
If you want to test it on your images then send the link to those or you can run this code snippet on your computer.