@@ -68,7 +68,7 @@ def __init__(self, data, affine=None, axes=None, cmap='gray',
68
68
self ._affine = affine .copy ()
69
69
codes = axcodes2ornt (aff2axcodes (self ._affine ))
70
70
order = np .argsort ([c [0 ] for c in codes ])
71
- flips = np .array ([c [1 ] for c in codes ])[order ]
71
+ flips = np .array ([c [1 ] < 0 for c in codes ])[order ]
72
72
self ._order = dict (x = int (order [0 ]), y = int (order [1 ]), z = int (order [2 ]))
73
73
self ._flips = dict (x = flips [0 ], y = flips [1 ], z = flips [2 ])
74
74
self ._scalers = np .abs (self ._affine ).max (axis = 0 )[:3 ]
@@ -128,7 +128,10 @@ def __init__(self, data, affine=None, axes=None, cmap='gray',
128
128
129
129
# set up axis crosshairs
130
130
self ._crosshairs = dict ()
131
- for type_ , i_1 , i_2 in zip ('xyz' , 'yxx' , 'zzy' ):
131
+ r = [self ._scalers [self ._order ['z' ]] / self ._scalers [self ._order ['y' ]],
132
+ self ._scalers [self ._order ['z' ]] / self ._scalers [self ._order ['x' ]],
133
+ self ._scalers [self ._order ['y' ]] / self ._scalers [self ._order ['x' ]]]
134
+ for type_ , i_1 , i_2 , ratio in zip ('xyz' , 'yxx' , 'zzy' , r ):
132
135
ax , label = self ._axes [type_ ], labels [type_ ]
133
136
vert = ax .plot ([self ._idx [i_1 ]] * 2 ,
134
137
[- 0.5 , self ._sizes [i_2 ] - 0.5 ],
@@ -151,7 +154,7 @@ def __init__(self, data, affine=None, axes=None, cmap='gray',
151
154
horizontalalignment = anchor [0 ],
152
155
verticalalignment = anchor [1 ])
153
156
ax .axis (lims )
154
- # ax.set_aspect(aspect_ratio[type_]) # XXX FIX
157
+ ax .set_aspect (ratio )
155
158
ax .patch .set_visible (False )
156
159
ax .set_frame_on (False )
157
160
ax .axes .get_yaxis ().set_visible (False )
0 commit comments