@@ -1200,7 +1200,7 @@ def time_label(x):
1200
1200
self ._data_dicts [hemi ].append (data )
1201
1201
1202
1202
self .scale_data_colormap (min , mid , max , transparent , center , alpha ,
1203
- data )
1203
+ data , hemi = hemi )
1204
1204
1205
1205
if initial_time_index is not None :
1206
1206
self .set_data_time_index (initial_time_index )
@@ -1951,7 +1951,8 @@ def _brain_color(self):
1951
1951
1952
1952
@verbose
1953
1953
def scale_data_colormap (self , fmin , fmid , fmax , transparent ,
1954
- center = None , alpha = 1.0 , data = None , verbose = None ):
1954
+ center = None , alpha = 1.0 , data = None ,
1955
+ hemi = None , verbose = None ):
1955
1956
"""Scale the data colormap.
1956
1957
1957
1958
The colormap may be sequential or divergent. When the colormap is
@@ -1994,15 +1995,19 @@ def scale_data_colormap(self, fmin, fmid, fmax, transparent,
1994
1995
The data entry for which to scale the colormap.
1995
1996
If None, will use the data dict from either the left or right
1996
1997
hemisphere (in that order).
1998
+ hemi : str | None
1999
+ If None, all hemispheres will be scaled.
1997
2000
verbose : bool, str, int, or None
1998
2001
If not None, override default verbose level (see surfer.verbose).
1999
2002
"""
2000
2003
divergent = center is not None
2004
+ hemis = self ._check_hemis (hemi )
2005
+ del hemi
2001
2006
2002
2007
# Get the original colormap
2003
2008
if data is None :
2004
- for h in [ 'lh' , 'rh' ] :
2005
- data = self .data_dict [h ]
2009
+ for hemi in hemis :
2010
+ data = self .data_dict [hemi ]
2006
2011
if data is not None :
2007
2012
break
2008
2013
table = data ["orig_ctable" ].copy ()
@@ -2015,14 +2020,15 @@ def scale_data_colormap(self, fmin, fmid, fmax, transparent,
2015
2020
2016
2021
views = self ._toggle_render (False )
2017
2022
# Use the new colormap
2018
- for hemi in [ 'lh' , 'rh' ] :
2023
+ for hemi in hemis :
2019
2024
data = self .data_dict [hemi ]
2020
2025
if data is not None :
2021
2026
for surf in data ['surfaces' ]:
2022
2027
cmap = surf .module_manager .scalar_lut_manager
2023
2028
cmap .load_lut_from_list (lut / 255. )
2024
2029
if divergent :
2025
- cmap .data_range = np .array ([center - fmax , center + fmax ])
2030
+ cmap .data_range = np .array (
2031
+ [center - fmax , center + fmax ])
2026
2032
else :
2027
2033
cmap .data_range = np .array ([fmin , fmax ])
2028
2034
@@ -2050,7 +2056,7 @@ def scale_data_colormap(self, fmin, fmid, fmax, transparent,
2050
2056
l_m .load_lut_from_list (lut / 255. )
2051
2057
if divergent :
2052
2058
l_m .data_range = np .array (
2053
- [center - fmax , center + fmax ])
2059
+ [center - fmax , center + fmax ])
2054
2060
else :
2055
2061
l_m .data_range = np .array ([fmin , fmax ])
2056
2062
0 commit comments