Add basic plot component for single JPEG and multi-page tiff artifacts - #173
Merged
Merged
Conversation
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. |
NatLeung96
approved these changes
Sep 15, 2026
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
force-pushed
the
plot-component
branch
from
September 15, 2026 14:28
eddfd3d to
9fc1bf8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 sessioncm40628-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).