Skip to content

Commit e1f4ec2

Browse files
committed
Fix nrrd_io
1 parent 10e4ade commit e1f4ec2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/vidata/io/nrrd_io.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ def load_nrrd(file: str | Path) -> tuple[np.ndarray, dict]:
9696
direction = header["space directions"] / (norms + 1e-12)
9797
else:
9898
direction = np.eye(ndims)
99-
direction = direction.flatten() # Flattened SITK style
99+
# NRRD uses COLUMN vectors → SITK uses ROW vectors --> .T
100+
direction = direction.T.flatten() # Flattened SITK style
100101

101102
# Convert Metadata from (X,Y,Z) → (Z,Y,X)
102103
spacing = spacing[::-1]

0 commit comments

Comments
 (0)