@@ -1200,7 +1200,7 @@ def time_label(x):
12001200 self._data_dicts[hemi].append(data)
12011201
12021202 self.scale_data_colormap(min, mid, max, transparent, center, alpha,
1203- data )
1203+ data, hemi=hemi )
12041204
12051205 if initial_time_index is not None:
12061206 self.set_data_time_index(initial_time_index)
@@ -1951,7 +1951,8 @@ def _brain_color(self):
19511951
19521952 @verbose
19531953 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):
19551956 """Scale the data colormap.
19561957
19571958 The colormap may be sequential or divergent. When the colormap is
@@ -1994,15 +1995,19 @@ def scale_data_colormap(self, fmin, fmid, fmax, transparent,
19941995 The data entry for which to scale the colormap.
19951996 If None, will use the data dict from either the left or right
19961997 hemisphere (in that order).
1998+ hemi : str | None
1999+ If None, all hemispheres will be scaled.
19972000 verbose : bool, str, int, or None
19982001 If not None, override default verbose level (see surfer.verbose).
19992002 """
20002003 divergent = center is not None
2004+ hemis = self._check_hemis(hemi)
2005+ del hemi
20012006
20022007 # Get the original colormap
20032008 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 ]
20062011 if data is not None:
20072012 break
20082013 table = data["orig_ctable"].copy()
@@ -2015,14 +2020,15 @@ def scale_data_colormap(self, fmin, fmid, fmax, transparent,
20152020
20162021 views = self._toggle_render(False)
20172022 # Use the new colormap
2018- for hemi in [ 'lh' , 'rh' ] :
2023+ for hemi in hemis :
20192024 data = self.data_dict[hemi]
20202025 if data is not None:
20212026 for surf in data['surfaces']:
20222027 cmap = surf.module_manager.scalar_lut_manager
20232028 cmap.load_lut_from_list(lut / 255.)
20242029 if divergent:
2025- cmap .data_range = np .array ([center - fmax , center + fmax ])
2030+ cmap.data_range = np.array(
2031+ [center - fmax, center + fmax])
20262032 else:
20272033 cmap.data_range = np.array([fmin, fmax])
20282034
@@ -2050,7 +2056,7 @@ def scale_data_colormap(self, fmin, fmid, fmax, transparent,
20502056 l_m.load_lut_from_list(lut / 255.)
20512057 if divergent:
20522058 l_m.data_range = np.array(
2053- [center - fmax , center + fmax ])
2059+ [center - fmax, center + fmax])
20542060 else:
20552061 l_m.data_range = np.array([fmin, fmax])
20562062
0 commit comments