Skip to content

Conversation

@payno
Copy link
Member

@payno payno commented Sep 8, 2025

  • silx.gui.plot.colormap: generalize the percentile mode

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.

image

Demo

output.webm

@payno payno changed the title DARFT: 4123 add new ercentiles v2 DRAFT: 4123 add new ercentiles v2 Sep 8, 2025
@payno payno changed the title DRAFT: 4123 add new ercentiles v2 DRAFT: colormap: allow percentile to be any user value (and not only 1-99) Sep 8, 2025
@payno payno force-pushed the 4123-add_new_ercentiles_v2 branch 3 times, most recently from 42bd259 to a41219e Compare September 10, 2025 08:22
@payno payno force-pushed the 4123-add_new_ercentiles_v2 branch 2 times, most recently from 1aa29cf to ff9a24f Compare September 12, 2025 09:36
Copy link
Member

@t20100 t20100 left a 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!

@payno payno force-pushed the 4123-add_new_ercentiles_v2 branch 2 times, most recently from 88d6f85 to f0df5ce Compare September 12, 2025 14:27
@payno payno changed the title DRAFT: colormap: allow percentile to be any user value (and not only 1-99) colormap: allow users to provide percentile values for 'PERCENTILE' mode Sep 12, 2025
Copy link
Member

@t20100 t20100 left a 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

payno and others added 16 commits September 18, 2025 14:47
…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>
@payno payno force-pushed the 4123-add_new_ercentiles_v2 branch from 6d2f414 to a6c6e3d Compare September 18, 2025 12:48
* 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'
Copy link
Member Author

@payno payno left a 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 🤞

@payno payno force-pushed the 4123-add_new_ercentiles_v2 branch from 0f924f8 to f64e2c2 Compare September 18, 2025 15:21
@payno payno requested a review from t20100 September 18, 2025 16:16
Copy link
Member

@t20100 t20100 left a 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!

@payno payno merged commit 5127095 into main Sep 23, 2025
4 checks passed
@payno payno deleted the 4123-add_new_ercentiles_v2 branch September 23, 2025 12:47
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.

3 participants