Skip to content
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

silx view: Large 2D datasets are open #4124

Open
t20100 opened this issue May 22, 2024 · 7 comments
Open

silx view: Large 2D datasets are open #4124

t20100 opened this issue May 22, 2024 · 7 comments
Milestone

Comments

@t20100
Copy link
Member

t20100 commented May 22, 2024

When opening a large 2D dataset containing many curves (shape: 1e6 x 3000, dtype: float32), it takes too long to display with the default view (raw?), while one want to browse the curves.

As a workaround, it is possible to open first another dataset and select the curves plot before selecting the 2D dataset.

It would be good to avoid this by either adding a confirmation before loading really large datasets or by changing the default view when the 2D data is really large.

Related to silx-kit/h5web#1651

@vasole
Copy link
Member

vasole commented May 22, 2024

I guess the dataset does not identify itself as being of spectrum type.

What about deciding between spectrum and image based on the ratio between rows and columns when no previous visualization has taken place? I guess images will usually not have orders of magnitude between the two dimensions.

@t20100
Copy link
Member Author

t20100 commented May 22, 2024

There's no attributes or NXdata description, just a plain 2D dataset.

The ratio can be a good way to discriminate.
I was also considering the number of pixels to give an idea how demanding it will be to load it.
We probably don't want to display straight away a 1e6 x 1e6 pixel image either.

@woutdenolf
Copy link
Contributor

This issue is the same for MX data produced by Dectris. Silx is essentially unusable for MX.

@vasole
Copy link
Member

vasole commented Oct 13, 2024

@woutdenolf

Does the problem also affect PyMca? I would like to take a look at the offending datasets. Among other possibilities, the problem might be related to compression in huge chunks.

@t20100 t20100 added this to the Next release milestone Oct 14, 2024
@t20100
Copy link
Member Author

t20100 commented Oct 14, 2024

From what I know, there's currently 2 issues with silx view regarding large datasets:

  • Opening a 2D dataset that is too large to be displayed as an image (e.g., a stack of 1e6 azimuthal integrations).
  • Opening a 3D dataset as a stack of images to display one slice yet in one of the view it loads the whole stack... The code of silx view is meant to avoid loading all the data, but it looks to be quite fragile + depending on the Nexus @interpretation it picks a different view to display to data (see silx view: For NXdata with 3D dataset, avoid loading the whole dataset by default #4167). @woutdenolf, I think it is more this issue you are facing with dectris files.

@vasole, it depends which part of silx pymca is using:

  • For the first issue, unless pymca checks the size of the dataset before displaying it, it will have the same issue.
  • For the second issue, from what I recall, the issue is in the way to map the axes from the 3D dataset to what is displayed and how this gets used... so it should be specific to silx view.

IMO both issues should be fixed for the next release.

@vasole
Copy link
Member

vasole commented Oct 14, 2024

This issue is the same for MX data produced by Dectris. Silx is essentially unusable for MX.

Well, PyMca only has issues when accessing the file via silx (show information, double click...)

When accessing the target file from silx, everything works at the silx side. When accessing the file via the master file, silx hangs.

There is a badly configured NXdata group too.

@t20100
Copy link
Member Author

t20100 commented Oct 14, 2024

What you see is most likely related to #4167: If silx view picks the StackView widget for display, it loads the whole stack (while it should not!)...

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

No branches or pull requests

3 participants