Skip to content

Commit a58ee03

Browse files
author
Robert D. Vincent
committed
BF: use correct defaults for start and step.
1 parent f545e33 commit a58ee03

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

nibabel/minc1.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,14 @@ def get_affine(self):
111111
except AttributeError:
112112
dir_cos = _default_dir_cos[name]
113113
rot_mat[:, i] = dir_cos
114-
steps[i] = dim.step
115-
starts[i] = dim.start
114+
try:
115+
steps[i] = dim.step
116+
except AttributeError:
117+
steps[i] = 1.0
118+
try:
119+
starts[i] = dim.start
120+
except AttributeError:
121+
starts[i] = 0.0
116122
origin = np.dot(rot_mat, starts)
117123
aff = np.eye(nspatial + 1)
118124
aff[:nspatial, :nspatial] = rot_mat * steps

0 commit comments

Comments
 (0)