@@ -229,6 +229,11 @@ def _make_viewer(figure, n_row, n_col, title, scene_size, offscreen,
229
229
for f in figure :
230
230
f .scene .interactor .interactor_style = \
231
231
tvtk .InteractorStyleTerrain ()
232
+ for figure in figures :
233
+ for f in figure :
234
+ # on a non-testing backend, and using modern VTK/Mayavi
235
+ if hasattr (getattr (f .scene , 'renderer' , None ), 'use_fxaa' ):
236
+ f .scene .renderer .use_fxaa = True
232
237
else :
233
238
if isinstance (figure , int ): # use figure with specified id
234
239
figure = [mlab .figure (figure , size = scene_size )]
@@ -387,6 +392,7 @@ class Brain(object):
387
392
texts : dict
388
393
The text objects.
389
394
"""
395
+
390
396
def __init__ (self , subject_id , hemi , surf , title = None ,
391
397
cortex = "classic" , alpha = 1.0 , size = 800 , background = "black" ,
392
398
foreground = None , figure = None , subjects_dir = None ,
@@ -1182,7 +1188,8 @@ def time_label(x):
1182
1188
1183
1189
self ._data_dicts [hemi ].append (data )
1184
1190
1185
- self .scale_data_colormap (min , mid , max , transparent , center , alpha )
1191
+ self .scale_data_colormap (min , mid , max , transparent , center , alpha ,
1192
+ data )
1186
1193
1187
1194
if initial_time_index is not None :
1188
1195
self .set_data_time_index (initial_time_index )
@@ -1903,7 +1910,7 @@ def _brain_color(self):
1903
1910
1904
1911
@verbose
1905
1912
def scale_data_colormap (self , fmin , fmid , fmax , transparent ,
1906
- center = None , alpha = 1.0 , verbose = None ):
1913
+ center = None , alpha = 1.0 , data = None , verbose = None ):
1907
1914
"""Scale the data colormap.
1908
1915
1909
1916
The colormap may be sequential or divergent. When the colormap is
@@ -1942,17 +1949,22 @@ def scale_data_colormap(self, fmin, fmid, fmax, transparent,
1942
1949
center of the (divergent) colormap
1943
1950
alpha : float
1944
1951
sets the overall opacity of colors, maintains transparent regions
1952
+ data : dict | None
1953
+ The data entry for which to scale the colormap.
1954
+ If None, will use the data dict from either the left or right
1955
+ hemisphere (in that order).
1945
1956
verbose : bool, str, int, or None
1946
1957
If not None, override default verbose level (see surfer.verbose).
1947
1958
"""
1948
1959
divergent = center is not None
1949
1960
1950
1961
# Get the original colormap
1951
- for h in ['lh' , 'rh' ]:
1952
- data = self .data_dict [h ]
1953
- if data is not None :
1954
- table = data ["orig_ctable" ].copy ()
1955
- break
1962
+ if data is None :
1963
+ for h in ['lh' , 'rh' ]:
1964
+ data = self .data_dict [h ]
1965
+ if data is not None :
1966
+ break
1967
+ table = data ["orig_ctable" ].copy ()
1956
1968
1957
1969
lut = _scale_mayavi_lut (table , fmin , fmid , fmax , transparent ,
1958
1970
center , alpha )
@@ -2957,6 +2969,7 @@ def _scale_mayavi_lut(lut_table, fmin, fmid, fmax, transparent,
2957
2969
2958
2970
class _Hemisphere (object ):
2959
2971
"""Object for visualizing one hemisphere with mlab"""
2972
+
2960
2973
def __init__ (self , subject_id , hemi , figure , geo , geo_curv ,
2961
2974
geo_kwargs , geo_reverse , subjects_dir , bg_color , backend ,
2962
2975
fg_color ):
@@ -3139,7 +3152,7 @@ def _add_vector_data(self, vectors, vector_values, fmin, fmid, fmax,
3139
3152
vmax = fmax , figure = self ._f , opacity = vector_alpha )
3140
3153
3141
3154
# Enable backface culling
3142
- quiver .actor .property .backface_culling = False
3155
+ quiver .actor .property .backface_culling = True
3143
3156
quiver .mlab_source .update ()
3144
3157
3145
3158
# Compute scaling for the glyphs
0 commit comments