Skip to content

Commit

Permalink
Upgrade ome-zarr package
Browse files Browse the repository at this point in the history
  • Loading branch information
keller-mark committed Jan 22, 2024
1 parent 8934187 commit 983892d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies = [
'numpy>=1.21.2',
'anndata>=0.7.8,<0.9',
'scanpy>=1.9.3',
'ome-zarr==0.2.1',
'ome-zarr==0.8.3',
'tifffile>=2020.10.1',
'jsonschema>=3.2'
]
Expand Down
76 changes: 38 additions & 38 deletions vitessce/data_utils/ome.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,30 +75,30 @@ def rgb_img_to_ome_zarr(img_arr, output_path, img_name="Image", chunks=(1, 256,
image=img_arr,
group=z_root,
axes=axes,
omero={
"name": img_name,
"version": "0.3",
"rdefs": {},
"channels": [
{
"label": "R",
"color": "FF0000",
"window": default_window
},
{
"label": "G",
"color": "00FF00",
"window": default_window
},
{
"label": "B",
"color": "0000FF",
"window": default_window
}
]
},
chunks=chunks
storage_options=dict(chunks=chunks)
)
z_root.attrs["omero"] = {
"name": img_name,
"version": "0.3",
"rdefs": {},
"channels": [
{
"label": "R",
"color": "FF0000",
"window": default_window
},
{
"label": "G",
"color": "00FF00",
"window": default_window
},
{
"label": "B",
"color": "0000FF",
"window": default_window
}
]
}


def multiplex_img_to_ome_zarr(img_arr, channel_names, output_path, img_name="Image", chunks=(1, 256, 256), axes="cyx", channel_colors=None):
Expand Down Expand Up @@ -132,19 +132,19 @@ def multiplex_img_to_ome_zarr(img_arr, channel_names, output_path, img_name="Ima
image=img_arr,
group=z_root,
axes=axes,
omero={
"name": img_name,
"version": "0.3",
"rdefs": {},
"channels": [
{
"label": channel_name,
"color": channel_colors[channel_name] if channel_colors is not None else "FFFFFF",
"window": default_window
}
for channel_name
in channel_names
]
},
chunks=chunks
storage_options=dict(chunks=chunks)
)
z_root.attrs["omero"] = {
"name": img_name,
"version": "0.3",
"rdefs": {},
"channels": [
{
"label": channel_name,
"color": channel_colors[channel_name] if channel_colors is not None else "FFFFFF",
"window": default_window
}
for channel_name
in channel_names
]
}

0 comments on commit 983892d

Please sign in to comment.