Skip to content

Commit

Permalink
[utils] Flatten grid.direction() matrix in write_sitk_image()
Browse files Browse the repository at this point in the history
  • Loading branch information
aschuh-hf committed Aug 2, 2023
1 parent d51bbf2 commit b444fa7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/deepali/utils/imageio/sitk.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ def write_sitk_image(data: Tensor, grid: Grid, path: PathUri, compress: bool = T
r"""Write image file in any format supported by SimpleITK."""
origin = grid.origin().tolist()
spacing = grid.spacing().tolist()
direction = grid.direction().tolist()
direction = grid.direction().flatten().tolist()
image = image_from_tensor(data, origin=origin, spacing=spacing, direction=direction)
_write_image(image, path, compress=compress)

0 comments on commit b444fa7

Please sign in to comment.