@@ -1768,11 +1768,6 @@ def show_view(self, view=None, roll=None, distance=None, row=-1, col=-1):
1768
1768
brain surface to view (one of 'lateral', 'medial', 'rostral',
1769
1769
'caudal', 'dorsal', 'ventral', 'frontal', 'parietal') or kwargs to
1770
1770
pass to :func:`mayavi.mlab.view()`.
1771
-
1772
- Returns
1773
- -------
1774
- view : tuple
1775
- tuple returned from mlab.view
1776
1771
roll : float
1777
1772
camera roll
1778
1773
distance : float | 'auto' | None
@@ -1781,6 +1776,13 @@ def show_view(self, view=None, roll=None, distance=None, row=-1, col=-1):
1781
1776
Row index of which brain to use
1782
1777
col : int
1783
1778
Column index of which brain to use
1779
+
1780
+ Returns
1781
+ -------
1782
+ view : tuple
1783
+ tuple returned from mlab.view
1784
+ roll : float
1785
+ camera roll returned from mlab.roll
1784
1786
"""
1785
1787
return self .brain_matrix [row ][col ].show_view (view , roll , distance )
1786
1788
@@ -3125,7 +3127,8 @@ def add_overlay(self, old):
3125
3127
pos_thresh = threshold_filter (mesh , low = old .pos_lims [0 ])
3126
3128
pos = mlab .pipeline .surface (
3127
3129
pos_thresh , colormap = "YlOrRd" , figure = self ._f ,
3128
- vmin = old .pos_lims [1 ], vmax = old .pos_lims [2 ])
3130
+ vmin = old .pos_lims [1 ], vmax = old .pos_lims [2 ],
3131
+ reset_zoom = False )
3129
3132
pos .actor .property .backface_culling = False
3130
3133
pos_bar = mlab .scalarbar (pos , nb_labels = 5 )
3131
3134
pos_bar .reverse_lut = True
@@ -3140,7 +3143,8 @@ def add_overlay(self, old):
3140
3143
neg_thresh = threshold_filter (mesh , up = old .neg_lims [0 ])
3141
3144
neg = mlab .pipeline .surface (
3142
3145
neg_thresh , colormap = "PuBu" , figure = self ._f ,
3143
- vmin = old .neg_lims [1 ], vmax = old .neg_lims [2 ])
3146
+ vmin = old .neg_lims [1 ], vmax = old .neg_lims [2 ],
3147
+ reset_zoom = False )
3144
3148
neg .actor .property .backface_culling = False
3145
3149
neg_bar = mlab .scalarbar (neg , nb_labels = 5 )
3146
3150
neg_bar .scalar_bar_representation .position = (0.05 , 0.01 )
@@ -3196,7 +3200,7 @@ def add_data(self, array, fmin, fmid, fmax, thresh, lut, colormap, alpha,
3196
3200
with warnings .catch_warnings (record = True ):
3197
3201
surf = mlab .pipeline .surface (
3198
3202
pipe , colormap = colormap , vmin = fmin , vmax = fmax ,
3199
- opacity = float (alpha ), figure = self ._f )
3203
+ opacity = float (alpha ), figure = self ._f , reset_zoom = False )
3200
3204
surf .actor .property .backface_culling = False
3201
3205
3202
3206
# apply look up table if given
@@ -3226,7 +3230,8 @@ def add_annotation(self, annot, ids, cmap):
3226
3230
# Add scalar values to dataset
3227
3231
array_id , pipe = self ._add_scalar_data (ids )
3228
3232
with warnings .catch_warnings (record = True ):
3229
- surf = mlab .pipeline .surface (pipe , name = annot , figure = self ._f )
3233
+ surf = mlab .pipeline .surface (pipe , name = annot , figure = self ._f ,
3234
+ reset_zoom = False )
3230
3235
surf .actor .property .backface_culling = False
3231
3236
3232
3237
# Set the color table
@@ -3242,7 +3247,8 @@ def add_label(self, label, label_name, color, alpha):
3242
3247
from matplotlib .colors import colorConverter
3243
3248
array_id , pipe = self ._add_scalar_data (label )
3244
3249
with warnings .catch_warnings (record = True ):
3245
- surf = mlab .pipeline .surface (pipe , name = label_name , figure = self ._f )
3250
+ surf = mlab .pipeline .surface (pipe , name = label_name , figure = self ._f ,
3251
+ reset_zoom = False )
3246
3252
surf .actor .property .backface_culling = False
3247
3253
color = colorConverter .to_rgba (color , alpha )
3248
3254
cmap = np .array ([(0 , 0 , 0 , 0 ,), color ])
@@ -3258,9 +3264,9 @@ def add_morphometry(self, morph_data, colormap, measure,
3258
3264
"""Add a morphometry overlay to the image"""
3259
3265
array_id , pipe = self ._add_scalar_data (morph_data )
3260
3266
with warnings .catch_warnings (record = True ):
3261
- surf = mlab .pipeline .surface (pipe , colormap = colormap ,
3262
- vmin = min , vmax = max ,
3263
- name = measure , figure = self ._f )
3267
+ surf = mlab .pipeline .surface (
3268
+ pipe , colormap = colormap , vmin = min , vmax = max , name = measure ,
3269
+ figure = self ._f , reset_zoom = False )
3264
3270
3265
3271
# Get the colorbar
3266
3272
if colorbar :
@@ -3291,8 +3297,9 @@ def add_contour_overlay(self, scalar_data, min=None, max=None,
3291
3297
array_id , pipe = self ._add_scalar_data (scalar_data )
3292
3298
with warnings .catch_warnings (record = True ):
3293
3299
thresh = threshold_filter (pipe , low = min )
3294
- surf = mlab .pipeline .contour_surface (thresh , contours = n_contours ,
3295
- line_width = line_width )
3300
+ surf = mlab .pipeline .contour_surface (
3301
+ thresh , contours = n_contours , line_width = line_width ,
3302
+ reset_zoom = False )
3296
3303
if lut is not None :
3297
3304
l_m = surf .module_manager .scalar_lut_manager
3298
3305
l_m .load_lut_from_list (lut / 255. )
0 commit comments