Skip to content

Commit ffc8a9d

Browse files
committed
explicitly add layout in open_ome_zarr
1 parent 80d809c commit ffc8a9d

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

iohub/ngff/utils.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def _apply_transform_to_czyx(
165165
# Process CZYX given with the given indices
166166
# if input_channel_indices is not None and len(input_channel_indices) > 0:
167167
click.echo(f"Processing t={input_time_index}, c={input_channel_indices}")
168-
input_dataset = open_ome_zarr(input_position_path)
168+
input_dataset = open_ome_zarr(input_position_path, layout="fov", mode="r")
169169
czyx_data = input_dataset.data.oindex[
170170
input_time_index, input_channel_indices
171171
]
@@ -196,8 +196,10 @@ def _save_transformed(
196196
output_time_indices: int | list[int],
197197
) -> None:
198198
# NOTE: use tensorstore due to zarr-python#3221
199-
with open_ome_zarr(output_position_path, mode="r+") as output_dataset:
200-
ts = output_dataset["0"].tensorstore(concurrency=4)
199+
with open_ome_zarr(
200+
output_position_path, layout="fov", mode="r+"
201+
) as output_dataset:
202+
ts = output_dataset.data.tensorstore(concurrency=4)
201203
ts.oindex[output_time_indices, output_channel_indices].write(
202204
transformed
203205
).result()
@@ -576,7 +578,9 @@ def process_single_position(
576578

577579
# Write extra metadata to the output store
578580
extra_metadata = kwargs.pop("extra_metadata", None)
579-
with open_ome_zarr(output_position_path, mode="r+") as output_dataset:
581+
with open_ome_zarr(
582+
output_position_path, layout="fov", mode="r+"
583+
) as output_dataset:
580584
output_dataset.zattrs["extra_metadata"] = extra_metadata
581585

582586
# Loop through (T, C), applying transform and writing as we go

0 commit comments

Comments
 (0)