Skip to content

Commit 8c20100

Browse files
MarcCoteeffigies
andauthored
Update nibabel/affines.py
Co-authored-by: Chris Markiewicz <[email protected]>
1 parent 1165d69 commit 8c20100

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

nibabel/affines.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ def apply_affine(aff, pts, inplace=False):
8787
if inplace:
8888
try:
8989
np.dot(pts, rzs.T, out=pts)
90-
pts += trans[None, :]
9190
except ValueError:
92-
# Fallback on the not inplace version.
93-
pts = np.dot(pts, rzs.T) + trans[None, :]
94-
else:
95-
pts = np.dot(pts, rzs.T) + trans[None, :]
91+
inplace = False
92+
else:
93+
pts += trans[None, :]
94+
if not inplace:
95+
pts = pts @ rzs.T + trans[None, :]
9696

9797
return pts.reshape(shape)
9898

0 commit comments

Comments
 (0)