Skip to content

Conversation

@t20100
Copy link
Member

@t20100 t20100 commented Jun 21, 2022

This needs more testing to make sure it works under all condition this widget is used

@t20100 t20100 added this to the 1.1.0 milestone Sep 28, 2022
@t20100
Copy link
Member Author

t20100 commented Oct 14, 2022

As it is, it is not working because then @axes is not supported.

@t20100 t20100 modified the milestones: 1.1.0, Next release Oct 17, 2022
@t20100
Copy link
Member Author

t20100 commented Oct 17, 2022

Moving this to next release. It's probably worth merging "Image" and "Stack" views at the same time.

@t20100 t20100 modified the milestones: 1.1.1, Next release Nov 29, 2022
@t20100 t20100 modified the milestones: 2.0.0, Next release Dec 7, 2023
@t20100 t20100 removed this from the Next release milestone Oct 7, 2024
@loichuder
Copy link
Member

Related to #4427 and #4412

I can take over if you wish @t20100

@t20100
Copy link
Member Author

t20100 commented Sep 24, 2025

Yes, please!

@loichuder loichuder self-assigned this Sep 25, 2025
@loichuder loichuder force-pushed the enable-change-axes-nxdata branch from 65b9509 to 09459e3 Compare September 29, 2025 12:31
@loichuder
Copy link
Member

Encountered #4432 on the way. I'll wait until the fix #4433 is merged before continuing this.

@loichuder loichuder force-pushed the enable-change-axes-nxdata branch 3 times, most recently from a5068f4 to a6280da Compare January 7, 2026 15:55
self._axesSelector = NumpyAxesSelector(self)
self._axesSelector.setNamedAxesSelectorVisibility(False)
self._axesSelector.selectionChanged.connect(self._updateImage)
self._axesSelector.selectedAxisChanged.connect(self._updateImageAxes)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that there are two updating methods:

  • self._updateImage is called when the slider value changes (the axes stay the same)
  • self._updateImageAxes is the new method called when the displayed axis changes. It takes care of resetting the plot properly before slicing the image accordingly.

In normal operation, self._updateImage will always be preceded by a call to self._updateImageAxes.

@loichuder
Copy link
Member

@t20100 Now ready for review

@loichuder loichuder marked this pull request as ready for review January 7, 2026 16:11
Comment on lines 452 to 458
signals: list[h5py.Dataset],
axes: list[h5py.Dataset] | None = None,
signals_names: list[str] | None = None,
axes_names: list[str] | None = None,
axes_scales: list[Literal["linear", "log"] | None] | None = None,
title: str | None = None,
isRgba: bool = False,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class is not reference in the doc and from a quick search the only place where it is used is:
https://github.com/silx-kit/pymca/blob/a07233366d76ad8e490a48e5b800493ee9db77be/src/PyMca5/PyMcaGui/io/hdf5/Hdf5NodeView.py#L139 and it should not be impacted by this change, so OK for me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I didn't really think about it but do you wish to go through a proper deprecation step?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I think it is OK to change the API here.
As I said: This is not in the doc, doesn't seems to be used directly... and it's a major release.

Comment on lines 524 to 525
x_axis_index = axis_indices["X"]
y_axis_index = axis_indices["Y"]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

X and Y are always available?

Copy link
Member

@loichuder loichuder Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If setImageData was called beforehand, yes.

And it should always be the case since the connection to the callback _updateImageAxes is done in setImageData. So if setImageData was not called, the _updateImageAxes slot is not connected to anything.

I will add additional checks for good measure though.

@t20100
Copy link
Member Author

t20100 commented Jan 8, 2026

Thanks for having take care of this!

@loichuder loichuder force-pushed the enable-change-axes-nxdata branch from f86d5da to 38e7bd1 Compare January 8, 2026 14:22
@loichuder
Copy link
Member

@t20100 Should be ready for a second review

@t20100
Copy link
Member Author

t20100 commented Jan 8, 2026

LGTM!

Since I opened the PR in the first place I cannot approve it through github 😀

@loichuder
Copy link
Member

Actually, I have to rework this a bit. It can raise errors for RGBA images

@loichuder loichuder force-pushed the enable-change-axes-nxdata branch from 38e7bd1 to 83468b8 Compare January 8, 2026 15:33
@loichuder loichuder changed the title Allow to change axes for nxdata stack of images silx.gui.data.NXdataWidgets.ArrayImagePlot: Allow to change axes for nxdata stack of images Jan 8, 2026
@loichuder
Copy link
Member

loichuder commented Jan 8, 2026

Actually, I have to rework this a bit. It can raise errors for RGBA images

Disabled the feature for RGBA images since it does not seem that useful: 83468b8

@loichuder loichuder merged commit 6db5065 into silx-kit:main Jan 8, 2026
3 of 4 checks passed
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.

2 participants