Skip to content
Snippets Groups Projects
Commit 1bf4e8d9 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Prevent saturation from binning when converting to 8 bit

parent 74b036da
No related branches found
No related tags found
No related merge requests found
......@@ -666,15 +666,8 @@ function process_beads() {
if (bitDepth() == 16) {
print("16 bit image type detected, converting to 8 bit...");
Stack.getStatistics(_, _, stack_min, stack_max, _);
new_max = stack_max * 1.1;
// NOTE: having a new value larger than the max value of the current bit
// depth is unproblematic since ImageJ apparently just uses the maximum
// possible value then:
print("setting display range min/max to 0/" + new_max + " (was: " +
stack_min + "/" + stack_max + ")");
setMinAndMax(0, new_max);
run("8-bit");
valueRange = detectValueRange();
mapTo8bitPreservingSaturation(valueRange[0]);
}
// remove the scaling so all units (measurements, coordinates, ...) are pixel-based:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment