Skip to content

Commit

Permalink
stack dask array along last axis to avoid transpose
Browse files Browse the repository at this point in the history
  • Loading branch information
niksirbi committed Mar 27, 2024
1 parent a7c5e1b commit c9283ed
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion examples/convert_tiffs_to_zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@

# Read the tiff stack into a dask array
da_arr = read_tiff_stack_with_dask(channel_dir)
da_arr = da_arr.transpose((2, 1, 0))

# Add the dask array to the zarr group
group.add_full_res_data(
Expand Down
2 changes: 1 addition & 1 deletion src/stack_to_chunk/io_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ def read_tiff_stack_with_dask(path: Path) -> da.Array:
da.from_delayed(delayed_reader, shape=shape, dtype=dtype)
for delayed_reader in lazy_arrays
]
return da.stack(dask_arrays, axis=0)
return da.stack(dask_arrays, axis=-1)

0 comments on commit c9283ed

Please sign in to comment.