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

Show link to plate viewer on dataset page #553

Closed
jluethi opened this issue Sep 13, 2024 · 5 comments · Fixed by #562
Closed

Show link to plate viewer on dataset page #553

jluethi opened this issue Sep 13, 2024 · 5 comments · Fixed by #562

Comments

@jluethi
Copy link
Collaborator

jluethi commented Sep 13, 2024

The vizarr viewer links on the dataset page are very useful!

Currently, we only link to the individual images, e.g. the full zarr url. For example:
https://fractal.mls.uzh.ch/vizarr/?source=https://fractal.mls.uzh.ch/vizarr/data/data/active/jluethi/Fractal/20240723_23well_benchmark/20200812-CardiomyocyteDifferentiation14-Cycle1_mip.zarr/B/03/0
Bildschirmfoto 2024-09-13 um 16 28 45

A thing that is also super useful is linking to the plate view. By going to this url:
https://fractal.mls.uzh.ch/vizarr/?source=https://fractal.mls.uzh.ch/vizarr/data/data/active/jluethi/Fractal/20240723_23well_benchmark/20200812-CardiomyocyteDifferentiation14-Cycle1_mip.zarr
(just removing the sub path to row, col & image)
We see:
Bildschirmfoto 2024-09-13 um 16 29 22

We have metadata about whether a dataset has plates and what plates are available in the image list:

Bildschirmfoto 2024-09-13 um 16 29 35

The goal would be that:
If there are plates in the image list
Show selector for which plate to load. And show a button for "view plate" that send the user to the link above.

This should be displayed above the image list for the moment. I may have additional ideas of where we expose this in the future :)


How do we get the plate url? I'd say we take the first zarr_url with the plate attribute. Given its zarr_url, we reconstruct the plate url. I see 2 ways:

  1. We already extract the base path to avoid displaying it. We can just to base path + plate name
  2. We could also look at the full zarr_url, find the plate name in the url & drop everything after that from the url
@jluethi
Copy link
Collaborator Author

jluethi commented Sep 18, 2024

We should go with something like point 2: Drop the last 3 elements of the zarr_url

Reason: The plate attribute is not actually enforced to be correctly matching the file name

@tcompa
Copy link
Collaborator

tcompa commented Sep 18, 2024

Example of image list

zarr_url, plate
/some/plate1.zarr/B/03/0, "plate1"
/some/plate1.zarr/B/04/0, "plate1"
/some/plate2.zarr/A/03/0, "plate2"
  1. Check If "plate" is one of the images attributes, otherwise stop.
  2. Write component on top of image list, with message "Detected 2 plates, choose one to view it (dropdown showing "plate1" or "plate2")
  3. User clicks "plate1"
    • If no image with plate1 is currently available, make an API call filtering for plate=plate1 and asking for page-size =1
    • GIven the zarr_url of one plate1 image, remote the last three levels
    • Create vizarr link, and display a "View" button (next to the dropdown, not in the image list)

@zonia3000
Copy link
Collaborator

Example of View plate button (notice the URL previewed in the bottom of the screenshot):

image

If the zarr URL is not valid (it has less than 3 elements) an error is displayed:

image

@jluethi
Copy link
Collaborator Author

jluethi commented Sep 18, 2024

This looks like a great start for this feature! 👏🏻

Minor wording suggestion:
"This dataset contains 3 plates. Select which plate you want to view"

@tcompa
Copy link
Collaborator

tcompa commented Sep 19, 2024

I tested #562, and it works as expected.

I imported this dataset

{
  "name": "test-2",
  "zarr_dir": "/tmp/some/path/",
  "images": [
    { "zarr_url": "/tmp/some/path/plate1/we/ll/a", "origin": null, "attributes": { "plate": "plate1" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate1/we/ll/b", "origin": null, "attributes": { "plate": "plate1" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate1/we/ll/c", "origin": null, "attributes": { "plate": "plate1" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate1/we/ll/d", "origin": null, "attributes": { "plate": "plate1" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate1/we/ll/e", "origin": null, "attributes": { "plate": "plate1" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate1/we/ll/f", "origin": null, "attributes": { "plate": "plate1" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate1/we/ll/g", "origin": null, "attributes": { "plate": "plate1" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate1/we/ll/h", "origin": null, "attributes": { "plate": "plate1" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate2/we/ll/a", "origin": null, "attributes": { "plate": "plate2" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate2/we/ll/b", "origin": null, "attributes": { "plate": "plate2" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate2/we/ll/c", "origin": null, "attributes": { "plate": "plate2" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate2/we/ll/d", "origin": null, "attributes": { "plate": "plate2" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate2/we/ll/e", "origin": null, "attributes": { "plate": "plate2" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate2/we/ll/f", "origin": null, "attributes": { "plate": "plate2" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate2/we/ll/g", "origin": null, "attributes": { "plate": "plate2" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate2/we/ll/h", "origin": null, "attributes": { "plate": "plate2" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate3/we/ll/a", "origin": null, "attributes": { "plate": "plate3" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate3/we/ll/b", "origin": null, "attributes": { "plate": "plate3" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate3/we/ll/c", "origin": null, "attributes": { "plate": "plate3" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate3/we/ll/d", "origin": null, "attributes": { "plate": "plate3" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate3/we/ll/e", "origin": null, "attributes": { "plate": "plate3" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate3/we/ll/f", "origin": null, "attributes": { "plate": "plate3" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate3/we/ll/g", "origin": null, "attributes": { "plate": "plate3" }, "types": {} },
    { "zarr_url": "/tmp/some/path/plate3/we/ll/h", "origin": null, "attributes": { "plate": "plate3" }, "types": {} }
  ],
  "filters": {
    "attributes": {},
    "types": {}
  }
}

and got this page
image


The "View" button of the first image points to http://localhost:3000/?source=http://localhost:3000/data/tmp/some/path/plate1/we/ll/a.


I selected "plate2", and got
image
where the "View" button points to http://localhost:3000/?source=http://localhost:3000/data/tmp/some/path/plate2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

3 participants