-
Notifications
You must be signed in to change notification settings - Fork 80
colormap: allow users to provide percentile values for 'PERCENTILE' mode #4379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
42bd259 to
a41219e
Compare
1aa29cf to
ff9a24f
Compare
t20100
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's some unrelated changes embedded in this PR to clean up.
IMO SliderWithSpinBox is not worth making public.
I would consider a int slider rather than floats
Looks good to have API with range and a slider + spin box looks good to me!
88d6f85 to
f0df5ce
Compare
t20100
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ColormapDialog is already a lengthy piece of code. IMO it's best to off-load code when we can, so I propose to turn the SliderWithSpinBox into a specific PercentileWidget containing all the code regarding widget init/sync and 1-value <-> 2-tuple conversion
…ly 1-99 # Conflicts: # src/silx/utils/cache.py
* remove 'saturation' label * label layout: align to top
…usedPercentile'. Which might be a bit more 'understandable' (and the link to the percentile)
Co-authored-by: Thomas VINCENT <thomas.vincent@esrf.fr>
Co-authored-by: Thomas VINCENT <thomas.vincent@esrf.fr>
Co-authored-by: Thomas VINCENT <thomas.vincent@esrf.fr>
Co-authored-by: Thomas VINCENT <thomas.vincent@esrf.fr>
Co-authored-by: Thomas VINCENT <thomas.vincent@esrf.fr>
Co-authored-by: Thomas VINCENT <thomas.vincent@esrf.fr>
Co-authored-by: Thomas VINCENT <thomas.vincent@esrf.fr>
Co-authored-by: Thomas VINCENT <thomas.vincent@esrf.fr>
…etAutoscalePercentiles
…ntileRange' to 'fromPercentilesToSaturation' and 'fromLateralPercentileRangeToCentralPercentile' to 'fromSaturationToPercentiles'
…en, overwrite percnetile to make sure we have 1, 99
… one added by the PR, not modifying ohers to avoid any API break)
6d2f414 to
a6c6e3d
Compare
* replace emission of 'valueChanged' by 'percentilesChanged' as this is the one we want from the Colormap * move 'setRange' to protected because can be confusing with 'setPercentilesRange' * rename 'value' by 'getSaturationValue' because this is more clearer and avoid confusion. * add 'setPercentilesRange' and 'getPercentilesRange' API * fix 'setSaturationValue'
payno
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reworked the ColormapPercentilesWidget. Indeed it seems a bit more concise 🤞
…rder to make sure it receives int only
0f924f8 to
f64e2c2
Compare
t20100
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds clearer to me with _ColormapPercentileWidget!
I left a few comments, the main one being to avoid emitting percentilesChanged when the value has not changed.
Otherwise LGTM!
Co-authored-by: Thomas VINCENT <thomas.vincent@esrf.fr>
Co-authored-by: Thomas VINCENT <thomas.vincent@esrf.fr>
…tionValue' to '_getSaturation' and '_setSaturation' # Conflicts: # src/silx/gui/dialog/_ColormapPercentileWidget.py
…ase '_DEFAULT_PERCENTILES' evolves with time.
Details
#4371 to be merged first.
Feedback
Still not a big fan of the integration in the dialog. I don't think users can see the link between percentile and saturation.
I might also hide the slider until we are not on the 'percentile' mode.
Demo
output.webm