Skip to content

Commit

Permalink
Merge pull request #16 from NFDI4BIOIMAGE/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
MicheleBortol authored Nov 18, 2024
2 parents decac5e + 17cd2ec commit 25451eb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
![Badge_OMERO](https://github.com/MicheleBortol/omero-vitessce/actions/workflows/omero_plugin.yml/badge.svg)
![Badge_PyPI](https://img.shields.io/pypi/v/omero-vitessce?label=pypi%20package)


OMERO.omero_vitessce
=======================

Expand Down Expand Up @@ -58,15 +57,12 @@ The plugin can be used with:
Clicking the link will open a new tab with the viewer displaying the selected configuration.
![Link-List-image](https://github.com/user-attachments/assets/7f556f86-7edf-49a0-bf2a-9c5f168922b1)



- **Generating custom config files**:

The form allows the user to automatically generate a config file with the selected parameters. After clicking the `Generate Config` button
a config file is generated and attached to the dataset/image. The viewer displaying the autogenerated configuration will open in a new tab.
![Form-image](https://github.com/user-attachments/assets/6e9bbb79-6b40-4d5f-bb0f-48f7bc6a13f1)


#### Open-with:
Right click on a `dataset` or an `images` in the left-panel and select `open-with` -> `Vitessce`.
This will open the vitessce viewer in a new tab using the first configuration file attachement.
Expand All @@ -76,7 +72,8 @@ This will open the vitessce viewer in a new tab using the first configuration fi
After autogenerating or selecting a config file, the Vitessce viewer is opened in a new tab:
![Viewer GIF](https://github.com/user-attachments/assets/0f1effac-e681-4782-a69e-76702451fcbb)


The viewer panels can also be rearranged to better fit the image type/size.
![Viewer slide](https://github.com/user-attachments/assets/5c8c9559-ea2c-44c9-acbe-26caaf951432)

### Config files
The omero-vitessce plugin considers all files with the `.json` extension attached to the image or dataset as config files for the viewer.
Expand Down Expand Up @@ -149,8 +146,7 @@ Images and data can be served through:
- `omero_vitessce/vitessce_json_rois/ID1,ID2,...` endpoint where `ID1,ID2,...` is a comma-separated list of image ids, to get the first shape of each ROI in `json` format.

Example showing ROIs from OMERO displayed in the omero-vitessce viewer window:
![image](https://github.com/user-attachments/assets/223072d6-9aa7-4b96-a199-65bbab863c1b)

![ROI comparison](https://github.com/user-attachments/assets/807026b8-4ed2-4977-890b-73aa9c547ca2)

Development
=======================
Expand Down Expand Up @@ -223,7 +219,6 @@ Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.<br>
You will also see any lint errors in the console.


### `npm run build`

Builds the app for production to the `build` folder and copies the
Expand All @@ -243,4 +238,3 @@ You will need to have the app configured in your OMERO.web install:
It bundles React in production mode and optimizes the build for the best performance.

See the Create React App section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="omero-vitessce",
version="1.2.0",
version="1.2.1",
description="OMERO Vitessce multimodal data viewer plugin for OMERO.web",
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
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 25451eb

Please sign in to comment.