Repository navigation
refactor(imviewer): remove the unused brightness slider step switch - #152
Open
ehennestad wants to merge 2 commits into
Open
ehennestad wants to merge 2 commits into
ehennestad wants to merge 2 commits into
Conversation
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>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
createBrightnessSliderpicks aNumTicksvalue from the image stack's data type in aswitch, then overwrites it with256on the next line. The'unit8'case also never matchesuint8data. So the switch has no effect.The data-type dependence it aimed for is already handled elsewhere.
setSliderExtremeLimitsruns right after each slider is created. It setsNumTicksfromImageStack.DataTypeIntensityLimits: 65535 steps foruint16, 255 foruint8, 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', 256directly, as onmain. It adds a comment saying thatsetSliderExtremeLimitssets the step count. The behaviour is unchanged.🤖 Generated with Claude Code