Skip to content

Commit

Permalink
Correct spacing of images read from zarr files.
Browse files Browse the repository at this point in the history
The order was not reversed.
  • Loading branch information
blowekamp committed Jan 19, 2024
1 parent 0f35ba2 commit 91588b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sitkibex/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ def _zarr_read_channel(filename: Path, channel=None) -> sitk.Image:
arr = arr[0, channel_number, ...]
img = sitk.GetImageFromArray(arr.astype(arr.dtype.newbyteorder("=")), isVector=False)

img.SetSpacing(spacing[2:])
# Select XYZ spacing from input TCZYX
img.SetSpacing(spacing[:1:-1])

return img

Expand Down

0 comments on commit 91588b5

Please sign in to comment.