@@ -258,37 +258,105 @@ def plot_conte69(data, lhlabel, rhlabel, surf='midthickness',
258258 Default: (0, 0, 0)
259259 kwargs : key-value mapping
260260 Keyword arguments for `mayavi.mlab.triangular_mesh()`
261+ Returns
262+ -------
263+ scene : mayavi.Scene
264+ Scene object containing plot
265+ """
266+
267+ return plot_fslr (data , lhlabel , rhlabel , surf_atlas = 'conte69' ,
268+ surf_type = surf , vmin = vmin , vmax = vmax , colormap = colormap ,
269+ colorbar = colorbar , num_labels = num_labels ,
270+ orientation = orientation , colorbartitle = colorbartitle ,
271+ backgroundcolor = backgroundcolor ,
272+ foregroundcolor = foregroundcolor , ** kwargs )
273+
274+
275+ def plot_fslr (data , lhlabel , rhlabel , surf_atlas = 'conte69' ,
276+ surf_type = 'midthickness' , vmin = None , vmax = None ,
277+ colormap = 'viridis' , colorbar = True , num_labels = 4 ,
278+ orientation = 'horizontal' , colorbartitle = None ,
279+ backgroundcolor = (1 , 1 , 1 ), foregroundcolor = (0 , 0 , 0 ),
280+ ** kwargs ):
281+
282+ """
283+ Plots surface `data` on a given fsLR32k atlas
284+
285+ Parameters
286+ ----------
287+ data : (N,) array_like
288+ Surface data for N parcels
289+ lhlabel : str
290+ Path to .gii file (generic GIFTI file) containing labels to N/2 parcels
291+ on the left hemisphere
292+ rhlabel : str
293+ Path to .gii file (generic GIFTI file) containing labels to N/2 parcels
294+ on the right hemisphere
295+ surf_atlas: {'conte69', 'yerkes19'}, optional
296+ Surface atlas on which to plot 'data'. Default: 'conte69'
297+ surf_type : {'midthickness', 'inflated', 'vinflated'}, optional
298+ Type of brain surface. Default: 'midthickness'
299+ vmin : float, optional
300+ Minimum value to scale the colormap. If None, the min of the data will
301+ be used. Default: None
302+ vmax : float, optional
303+ Maximum value to scale the colormap. If None, the max of the data will
304+ be used. Default: None
305+ colormap : str, optional
306+ Any colormap from matplotlib. Default: 'viridis'
307+ colorbar : bool, optional
308+ Wheter to display a colorbar. Default: True
309+ num_labels : int, optional
310+ The number of labels to display on the colorbar.
311+ Available only if colorbar=True. Default: 4
312+ orientation : str, optional
313+ Defines the orientation of colorbar. Can be 'horizontal' or 'vertical'.
314+ Available only if colorbar=True. Default: 'horizontal'
315+ colorbartitle : str, optional
316+ The title of colorbar. Available only if colorbar=True. Default: None
317+ backgroundcolor : tuple of float values with RGB code in [0, 1], optional
318+ Defines the background color. Default: (1, 1, 1)
319+ foregroundcolor : tuple of float values with RGB code in [0, 1], optional
320+ Defines the foreground color (e.g., colorbartitle color).
321+ Default: (0, 0, 0)
322+ kwargs : key-value mapping
323+ Keyword arguments for `mayavi.mlab.triangular_mesh()`
261324
262325 Returns
263326 -------
264327 scene : mayavi.Scene
265328 Scene object containing plot
266329 """
267330
268- from .datasets import fetch_conte69
331+ from .datasets import fetch_conte69 , fetch_yerkes19
269332 try :
270333 from mayavi import mlab
271334 except ImportError :
272- raise ImportError ('Cannot use plot_conte69 () if mayavi is not '
335+ raise ImportError ('Cannot use plot_fslr () if mayavi is not '
273336 'installed. Please install mayavi and try again.' )
274337
275338 opts = dict ()
276339 opts .update (** kwargs )
277340
278341 try :
279- surface = fetch_conte69 ()[surf ]
342+ if surf_atlas == 'conte69' :
343+ surface = fetch_conte69 ()[surf_type ]
344+ elif surf_atlas == 'yerkes19' :
345+ surface = fetch_yerkes19 ()[surf_type ]
346+
280347 except KeyError :
281348 raise ValueError ('Provided surf "{}" is not valid. Must be one of '
282349 '[\' midthickness\' , \' inflated\' , \' vinflated\' ]'
283- .format (surf ))
350+ .format (surf_type ))
351+
284352 lhsurface , rhsurface = [nib .load (s ) for s in surface ]
285353
286354 lhlabels = nib .load (lhlabel ).darrays [0 ].data
287355 rhlabels = nib .load (rhlabel ).darrays [0 ].data
288356 lhvert , lhface = [d .data for d in lhsurface .darrays ]
289357 rhvert , rhface = [d .data for d in rhsurface .darrays ]
290358
291- # add NaNs for subcortex
359+ # add NaNs for medial wall
292360 data = np .append (np .nan , data )
293361
294362 # get lh and rh data
@@ -510,7 +578,7 @@ def plot_fsaverage(data, *, lhannot, rhannot, order='lr', mask=None,
510578
511579 vtx_data .append (vtx )
512580
513- brain = plot_fsvertex (np .hstack (vtx_data ), order = order , mask = None ,
581+ brain = plot_fsvertex (np .hstack (vtx_data ), order = 'lr' , mask = None ,
514582 subject_id = subject_id , subjects_dir = subjects_dir ,
515583 vmin = vmin , vmax = vmax , ** kwargs )
516584
0 commit comments