From 1bf4e8d9c532eea3e6429ed5a691f6c588b21aa8 Mon Sep 17 00:00:00 2001 From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch> Date: Mon, 3 Sep 2018 17:52:00 +0200 Subject: [PATCH] Prevent saturation from binning when converting to 8 bit --- .../scripts/Plugins/NoiSee/NoiSee_Bead_Analysis.ijm | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/main/resources/scripts/Plugins/NoiSee/NoiSee_Bead_Analysis.ijm b/src/main/resources/scripts/Plugins/NoiSee/NoiSee_Bead_Analysis.ijm index 5a8cf10..14c23cb 100644 --- a/src/main/resources/scripts/Plugins/NoiSee/NoiSee_Bead_Analysis.ijm +++ b/src/main/resources/scripts/Plugins/NoiSee/NoiSee_Bead_Analysis.ijm @@ -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: -- GitLab