Skip to content

Commit

Permalink
Use new NgffImage model in yokogawa_to_ome_zarr task (ref #351, ref
Browse files Browse the repository at this point in the history
  • Loading branch information
tcompa committed Sep 19, 2023
1 parent de03f63 commit 30d23d5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fractal_tasks_core/tasks/yokogawa_to_ome_zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from fractal_tasks_core.lib_channels import get_omero_channel_list
from fractal_tasks_core.lib_channels import OmeroChannel
from fractal_tasks_core.lib_glob import glob_with_multiple_patterns
from fractal_tasks_core.lib_image import NgffImage
from fractal_tasks_core.lib_parse_filename_metadata import parse_filename
from fractal_tasks_core.lib_pyramid_creation import build_pyramid
from fractal_tasks_core.lib_read_fractal_metadata import (
Expand All @@ -36,7 +37,6 @@
convert_ROI_table_to_indices,
)
from fractal_tasks_core.lib_write import OverwriteNotAllowedError
from fractal_tasks_core.lib_zattrs_utils import extract_zyx_pixel_sizes


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -110,11 +110,13 @@ def yokogawa_to_ome_zarr(
raise NotImplementedError
zarrurl = Path(input_paths[0]).as_posix() + f"/{component}"

ngff_image = NgffImage(**zarr.open_group(zarrurl).attrs.asdict())
num_levels = ngff_image.num_levels
coarsening_xy = ngff_image.coarsening_xy

parameters = get_parameters_from_metadata(
keys=[
"original_paths",
"num_levels",
"coarsening_xy",
"image_extension",
"image_glob_patterns",
],
Expand All @@ -125,8 +127,6 @@ def yokogawa_to_ome_zarr(
image_zarr_path=(Path(output_path) / component),
)
original_path_list = parameters["original_paths"]
num_levels = parameters["num_levels"]
coarsening_xy = parameters["coarsening_xy"]
image_extension = parameters["image_extension"]
image_glob_patterns = parameters["image_glob_patterns"]

Expand All @@ -145,7 +145,7 @@ def yokogawa_to_ome_zarr(

# Read useful information from ROI table and .zattrs
adata = read_zarr(f"{zarrurl}/tables/FOV_ROI_table")
pxl_size = extract_zyx_pixel_sizes(f"{zarrurl}/.zattrs")
pxl_size = ngff_image.get_pixel_sizes_zyx(level=0)
fov_indices = convert_ROI_table_to_indices(
adata, full_res_pxl_sizes_zyx=pxl_size
)
Expand Down

0 comments on commit 30d23d5

Please sign in to comment.