Skip to content

refactor(imviewer): remove the unused brightness slider step switch - #152

Open
ehennestad wants to merge 2 commits into
devfrom
remove-dead-brightness-slider-switch
Open

ehennestad wants to merge 2 commits into
devfrom
remove-dead-brightness-slider-switch

Conversation

@ehennestad

Copy link
Copy Markdown
Collaborator

createBrightnessSlider picks a NumTicks value from the image stack's data type in a switch, then overwrites it with 256 on the next line. The 'unit8' case also never matches uint8 data. So the switch has no effect.

The data-type dependence it aimed for is already handled elsewhere. setSliderExtremeLimits runs right after each slider is created. It sets NumTicks from ImageStack.DataTypeIntensityLimits: 65535 steps for uint16, 255 for uint8, and at least 100 for data in [0, 1]. It runs again when the brightness limits change. The value passed at construction is only a starting value.

This PR removes the switch and the override and passes 'NumTicks', 256 directly, as on main. It adds a comment saying that setSliderExtremeLimits sets the step count. The behaviour is unchanged.

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

369 tests  ±0   369 ✅ ±0   38s ⏱️ +11s
 25 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit e2e94b8. ± Comparison against base commit d8ee8c3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant