@@ -1768,11 +1768,6 @@ def show_view(self, view=None, roll=None, distance=None, row=-1, col=-1):
17681768 brain surface to view (one of 'lateral', 'medial', 'rostral',
17691769 'caudal', 'dorsal', 'ventral', 'frontal', 'parietal') or kwargs to
17701770 pass to :func:`mayavi.mlab.view()`.
1771-
1772- Returns
1773- -------
1774- view : tuple
1775- tuple returned from mlab.view
17761771 roll : float
17771772 camera roll
17781773 distance : float | 'auto' | None
@@ -1781,6 +1776,13 @@ def show_view(self, view=None, roll=None, distance=None, row=-1, col=-1):
17811776 Row index of which brain to use
17821777 col : int
17831778 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
17841786 """
17851787 return self .brain_matrix [row ][col ].show_view (view , roll , distance )
17861788
@@ -3125,7 +3127,8 @@ def add_overlay(self, old):
31253127 pos_thresh = threshold_filter (mesh , low = old .pos_lims [0 ])
31263128 pos = mlab .pipeline .surface (
31273129 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 )
31293132 pos .actor .property .backface_culling = False
31303133 pos_bar = mlab .scalarbar (pos , nb_labels = 5 )
31313134 pos_bar .reverse_lut = True
@@ -3140,7 +3143,8 @@ def add_overlay(self, old):
31403143 neg_thresh = threshold_filter (mesh , up = old .neg_lims [0 ])
31413144 neg = mlab .pipeline .surface (
31423145 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 )
31443148 neg .actor .property .backface_culling = False
31453149 neg_bar = mlab .scalarbar (neg , nb_labels = 5 )
31463150 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,
31963200 with warnings .catch_warnings (record = True ):
31973201 surf = mlab .pipeline .surface (
31983202 pipe , colormap = colormap , vmin = fmin , vmax = fmax ,
3199- opacity = float (alpha ), figure = self ._f )
3203+ opacity = float (alpha ), figure = self ._f , reset_zoom = False )
32003204 surf .actor .property .backface_culling = False
32013205
32023206 # apply look up table if given
@@ -3226,7 +3230,8 @@ def add_annotation(self, annot, ids, cmap):
32263230 # Add scalar values to dataset
32273231 array_id , pipe = self ._add_scalar_data (ids )
32283232 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 )
32303235 surf .actor .property .backface_culling = False
32313236
32323237 # Set the color table
@@ -3242,7 +3247,8 @@ def add_label(self, label, label_name, color, alpha):
32423247 from matplotlib .colors import colorConverter
32433248 array_id , pipe = self ._add_scalar_data (label )
32443249 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 )
32463252 surf .actor .property .backface_culling = False
32473253 color = colorConverter .to_rgba (color , alpha )
32483254 cmap = np .array ([(0 , 0 , 0 , 0 ,), color ])
@@ -3258,9 +3264,9 @@ def add_morphometry(self, morph_data, colormap, measure,
32583264 """Add a morphometry overlay to the image"""
32593265 array_id , pipe = self ._add_scalar_data (morph_data )
32603266 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 )
32643270
32653271 # Get the colorbar
32663272 if colorbar :
@@ -3291,8 +3297,9 @@ def add_contour_overlay(self, scalar_data, min=None, max=None,
32913297 array_id , pipe = self ._add_scalar_data (scalar_data )
32923298 with warnings .catch_warnings (record = True ):
32933299 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 )
32963303 if lut is not None :
32973304 l_m = surf .module_manager .scalar_lut_manager
32983305 l_m .load_lut_from_list (lut / 255. )
0 commit comments