diff --git a/omero_vitessce/utils.py b/omero_vitessce/utils.py index e25aad8..6760564 100644 --- a/omero_vitessce/utils.py +++ b/omero_vitessce/utils.py @@ -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) @@ -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) diff --git a/test/data/MB266/VitessceConfig.json b/test/data/MB266/VitessceConfig.json index 0947ce0..efc010f 100755 --- a/test/data/MB266/VitessceConfig.json +++ b/test/data/MB266/VitessceConfig.json @@ -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": { @@ -88,8 +88,8 @@ } ], "renderLayers": [ - "Image 0", - "Segmentation" + "MB266-DAPI.tiff", + "MB266-CELLS.png" ] } }