Skip to content

Commit daa3fe6

Browse files
committed
Fix shear transformation for multiple axes (Project-MONAI#8450)
Signed-off-by: Eloi Navet <[email protected]>
1 parent 13b96ae commit daa3fe6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

monai/transforms/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ def _create_shear(spatial_dims: int, coefs: Sequence[float] | float, eye_func=np
985985
if spatial_dims == 2:
986986
coefs = ensure_tuple_size(coefs, dim=2, pad_val=0.0)
987987
out = eye_func(3)
988-
out[0, 1], out[1, 0] = coefs[0], coefs[1]
988+
out[0, 1], out[1, 0], out[1, 1] = coefs[0], coefs[1], 1 + coefs[0] * coefs[1]
989989
return out # type: ignore
990990
if spatial_dims == 3:
991991
coefs = ensure_tuple_size(coefs, dim=6, pad_val=0.0)

0 commit comments

Comments
 (0)