Skip to content

Commit 5a19f1c

Browse files
committed
Load image parents to get idrname
1 parent 740eae3 commit 5a19f1c

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

idr_gallery/templates/idr_gallery/archived_image.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11

22
<html>
33
<head>
4-
<title>Archived Image</title>
4+
<title>IDR: Archived Image</title>
55
</head>
6+
<style>
7+
body {
8+
font-family: Arial, sans-serif;
9+
margin: 20px;
10+
}
11+
</style>
612
<body>
713
<h1>Image Archived</h1>
814
<h2>Name: {{ image.name }}</h2>

idr_gallery/views.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,12 +495,13 @@ def image_viewer(request, iid, conn=None, **kwargs):
495495
# data_location is "IDR" or "Github" or "BIA" or "Embassy_S3"
496496
img_path, data_location, is_zarr = img_info
497497

498-
print("img_path, data_location, is_zarr:", img_path, data_location, is_zarr)
498+
# get parent Project or Screen to get IDRID name
499+
parents = image.getAncestry()
500+
idrid_name = parents[-1].name # e.g. idr0002-heriche-condensation/experimentA
501+
idrid_name = idrid_name.split("/")[0] # e.g. idr0002-heriche-condensation
499502

500503
download_url = None
501504
bia_ngff_id = None
502-
# FIXME: get correct idrid_name from image/project/screen
503-
idrid_name = "idr0000-unknown"
504505
if data_location == "IDR" or data_location == "Github":
505506
# then link to Download e.g. https://ftp.ebi.ac.uk/pub/databases/IDR/idr0002-heriche-condensation/
506507
# e.g. idr0002-heriche-condensation

0 commit comments

Comments
 (0)