Skip to content

Commit

Permalink
Show image names in spatial layers view.
Browse files Browse the repository at this point in the history
  • Loading branch information
MicheleBortol committed Nov 18, 2024
1 parent decac5e commit d341a59
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
12 changes: 7 additions & 5 deletions omero_vitessce/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,9 @@ def create_config(config_args, obj_type, obj_id, conn):

# Collects the images
images = []
img_urls = config_args.get("images")
for n, img_url in enumerate(img_urls):
images.append(OmeZarrWrapper(img_url=img_url, name=f"Image {n}"))
for img_url in config_args.get("images"):
img_file = img_files[img_urls.index(img_url)]
images.append(OmeZarrWrapper(img_url=img_url, name=img_file))

sp = vc.add_view(Vt.SPATIAL, dataset=vc_dataset)
lc = vc.add_view(Vt.LAYER_CONTROLLER, dataset=vc_dataset)
Expand Down Expand Up @@ -349,9 +349,11 @@ def create_config(config_args, obj_type, obj_id, conn):
hm = vc.add_view(Vt.HEATMAP, dataset=vc_dataset)
displays.append(hm)
if config_args.get("segmentation"):
seg_url = config_args.get("segmentation")
seg_name = img_files[img_urls.index(seg_url)]
segmentation = OmeZarrWrapper(
img_url=config_args.get("segmentation"),
name="Segmentation", is_bitmask=True)
img_url=seg_url, name=seg_name,
is_bitmask=True)
images.append(segmentation)
if config_args.get("rois"):
vc_dataset = add_rois(img_ids, vc_dataset, conn)
Expand Down
8 changes: 4 additions & 4 deletions test/data/MB266/VitessceConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@
"usePhysicalSizeScaling": true,
"images": [
{
"name": "Image 0",
"name": "MB266-DAPI.tiff",
"type": "ome-zarr",
"url": "http://localhost:4080/zarr/v0.4/image/1.zarr"
},
{
"name": "Segmentation",
"name": "MB266-CELLS.png",
"type": "ome-zarr",
"url": "http://localhost:4080/zarr/v0.4/image/2.zarr",
"metadata": {
Expand All @@ -88,8 +88,8 @@
}
],
"renderLayers": [
"Image 0",
"Segmentation"
"MB266-DAPI.tiff",
"MB266-CELLS.png"
]
}
}
Expand Down

0 comments on commit d341a59

Please sign in to comment.