Skip to content

Add basic plot component for single JPEG and multi-page tiff artifacts - #173

Merged
yousefmoazzam merged 24 commits into
mainfrom
plot-component
Sep 15, 2026
Merged

yousefmoazzam merged 24 commits into
mainfrom
plot-component

Conversation

@yousefmoazzam

Copy link
Copy Markdown
Collaborator

The performance of the slider for the multi-page tiff case hasn't been optimised at all and the feature has only been tested with small data (a stack of 5 images of shape (400, 400)), so there's going to be some performance issues with real-sized data with this starting point for the plot component.

The single image plot can be tested by using the session mg33746-1, and the multi-image plot can be tested by using the session cm40628-3 (the workflow to load for each of the sessions is currently hardcoded, so there's no need to do anything else to test this other than to enter those sessions in the session selector).

Screenshot from 2026-09-14 17-04-32 Screenshot from 2026-09-14 17-04-53

@NatLeung96

Copy link
Copy Markdown
Collaborator

TBF, I think the way workflows saves data is going to change at some point with processed data possibly being accessed through Tiled, so that it can be plotted in a similar fashion to what is required with raw data. But that is a future issue.

@fallars

fallars commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

do mind pausing this for a sec while push some other changes to app, but no worries if not.

Note that this is using the backend proxy that is intended for
converting multi-page tiffs to PNGs, so while the artifact is a JPEG,
the backend converts it to a PNG and is what the frontend is consuming.
The image index state indicates the index that is being transformed into
an `NDT` rather than the image index being fetched from the backend
proxy.

The distinction between "loading" and "fetching" that's worth making is
relating to the progress indicator and whether it's indicating data
being fetched or data that has already been fetched and is being
transformed, and is relevant to the currently existing bug of the
`loadingImageIndex` able to be `null` even when the data is starting to
be "fetched".

This bug will be addressed in the following commit.
The index of the image being "loaded" is only called after the artifact
data has been "fetched" from workflows via the backend proxy. Meaning,
the image index will stay `null` until the entire artifact data has been
"fetched", and will be set to the first index only when the first page
has been "loaded" (namely, transformed into an `NDT`). This means that
it may take some time before the first page is indicated as being
"loaded".

While the data is being "fetched", an indeterminate progress indicator
is displayed, and when the data starts being "loaded", a determinate
progress indicator is displayed.
…ator

Given that `loadData()` calls the total images setter only after the
artifact data has been fetched via the backend proxy, rendering the data
fetching/loading progress indicator when the total images state is
updated to not be `null` is fundamentally equivalent to not displaying
the indeterminate progress indicator during data fetching.

This results in a blank area in the plot component section for some
non-trivial period of time between selecting the artifact from the
dropdown menu and seeing the indicator for fetching the first image from
the multi-page tiff artifact.
This is to avoid having a plot persist if the session changes. Note that
this also sets the plot component to be disabled; this may or may not be
the preferred behaviour. Ie, it could be that when switching between
sessions, if one has enabled the plot component, it'd be preferrable to
keep it enabled unless explicitly disabled.

For now, this is a simple enough solution to prevent "outdated plots"
from being displayed.
@yousefmoazzam
yousefmoazzam merged commit f837277 into main Sep 15, 2026
1 check passed
@yousefmoazzam
yousefmoazzam deleted the plot-component branch September 15, 2026 14:38
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