From e2e94b898c12ca6f3da6effab06b3afc8031e335 Mon Sep 17 00:00:00 2001 From: ehennestad Date: Mon, 19 Oct 2026 10:24:45 +0200 Subject: [PATCH 1/2] refactor(imviewer): remove the unused brightness slider step switch createBrightnessSlider chose a step count from the data type, then overwrote it with 256 on the next line. The 'unit8' case also never matched uint8 data. setSliderExtremeLimits runs right after each slider is created and sets NumTicks from the data type's intensity limits, for example 65535 steps for uint16 and 255 for uint8, so the construction value never reached the user. The constructor now passes 'NumTicks', 256 directly. The behaviour is unchanged. Co-Authored-By: Claude Opus 5.5 --- code/apps/+imviewer/@App/App.m | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/code/apps/+imviewer/@App/App.m b/code/apps/+imviewer/@App/App.m index bc333599..01a20903 100755 --- a/code/apps/+imviewer/@App/App.m +++ b/code/apps/+imviewer/@App/App.m @@ -1102,26 +1102,17 @@ function createBrightnessSlider(obj) obj.uiwidgets.BrightnessSlider = uim.widget.rangeslider.empty; obj.uiwidgets.BrightnessToolbar = uim.widget.toolbar.empty; - switch obj.ImageStack.DataType - case {'unit8'} - numTicks = 256+1; - case {'uint16', 'int16'} - numTicks = 2^16+1; - case {'single', 'double'} - numTicks = 256; - otherwise - numTicks = 256; - end - numTicks = 256; for i = 1:obj.ImageStack.NumChannels label = sprintf('Ch%d', i); - % Create brightness slider + % Create brightness slider. NumTicks is a starting value: + % setSliderExtremeLimits sets it from the intensity limits of + % the data type. obj.brightnessSlider(i) = uim.widget.rangeslider(uicc, ... 'Location', 'northeast', 'Margin', [0,0,30,yMargin(i)], ... 'Size', [120, 25], 'Visible', 'off', 'Padding', [10, 5, 10, 5], ... - 'NumTicks', numTicks, 'Label', label); + 'NumTicks', 256, 'Label', label); obj.uiwidgets.BrightnessSlider(i) = obj.brightnessSlider(i); From 87e12429eba8a3758c364c2295e1256c414e6476 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2026 08:29:39 +0000 Subject: [PATCH 2/2] Update GitHub badges [skip ci] --- .github/badges/code_issues.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/badges/code_issues.svg b/.github/badges/code_issues.svg index edc4000e..d91d87c6 100644 --- a/.github/badges/code_issues.svg +++ b/.github/badges/code_issues.svg @@ -1 +1 @@ -code issues: 1290code issues1290 +code issues: 1288code issues1288