@@ -296,20 +296,24 @@ class Brain(object):
296
296
freesurfer surface mesh name (ie 'white', 'inflated', etc.)
297
297
title : str
298
298
title for the window
299
- cortex : str, tuple, or dict
300
- Specifies if/how binarized curvature values are rendered. If
301
- binarized curvature values should be rendered it can be
302
- either the name of a preset PySurfer cortex colorscheme (one
303
- of 'classic' (default), 'bone', 'low_contrast', or
304
- 'high_contrast'), the name of a mayavi colormap, a 4-tuple with
305
- values (colormap, min, max, reverse), or a dictionary with
306
- corresponding keys to fully specify the curvature colors. If a
307
- color is specified instead, the brain is rendered in that
308
- color without displaying the binarized curvature values. A
309
- setting of `None` produces a gray brain without binarized
310
- curvature.
299
+ cortex : str, tuple, dict, or None
300
+ Specifies how the cortical surface is rendered. Accepts
301
+ specification of a colormap (in which case binarized curvature
302
+ values are rendered) or a color (in which case the cortical
303
+ surface is rendered without binarized curvature values). Can
304
+ be set to: (1) the name of one of the preset cortex styles
305
+ ('classic' [default], 'high_contrast', 'low_contrast', or
306
+ 'bone'), (2) the name of a colormap, (3) a tuple with four
307
+ entries for (colormap, vmin, vmax, reverse) indicating the
308
+ name of the colormap, the min and max values respectively and
309
+ whether or not the colormap should be reversed, (4) a valid
310
+ color specification (such as a 3-tuple with RGB values or a
311
+ valid color name), or (5) a dictionary of keyword arguments
312
+ that is passed on to the call to surface. If set to `None`,
313
+ color is set to (0.5, 0.5, 0.5) rendering a gray brain without
314
+ binarized curvature.
311
315
alpha : float in [0, 1]
312
- Alpha level to control opacity.
316
+ Alpha level to control opacity of the cortical surface .
313
317
size : float or pair of floats
314
318
the size of the window, in pixels. can be one number to specify
315
319
a square window, or the (width, height) of a rectangular window.
@@ -352,7 +356,7 @@ def __init__(self, subject_id, hemi, surf, title=None,
352
356
"be removed in future versions. You should update your "
353
357
"code and pass these options directly to the `Brain` "
354
358
"constructor." )
355
- warn (msg )
359
+ warn (msg , DeprecationWarning )
356
360
cortex = config_opts .get ("cortex" , cortex )
357
361
background = config_opts .get ("background" , background )
358
362
foreground = config_opts .get ("foreground" , foreground )
@@ -370,7 +374,7 @@ def __init__(self, subject_id, hemi, surf, title=None,
370
374
"will reproduce the previous behavior when `curv` was "
371
375
"set to `False`. To emulate the previous behavior for "
372
376
"cases where `curv` was set to `True`, simply omit it." )
373
- warn (msg )
377
+ warn (msg , DeprecationWarning )
374
378
if not curv :
375
379
cortex = None
376
380
@@ -516,11 +520,20 @@ def _get_geo_params(self, cortex, alpha=1.0):
516
520
517
521
Parameters
518
522
----------
519
- cortex : {classic, high_contrast, low_contrast, bone, tuple}
520
- The name of one of the preset cortex styles, or a tuple
521
- with four entries as described in the return vales.
523
+ cortex : {str, tuple, dict, None}
524
+ Can be set to: (1) the name of one of the preset cortex
525
+ styles ('classic', 'high_contrast', 'low_contrast', or
526
+ 'bone'), (2) the name of a colormap, (3) a tuple with
527
+ four entries for (colormap, vmin, vmax, reverse)
528
+ indicating the name of the colormap, the min and max
529
+ values respectively and whether or not the colormap should
530
+ be reversed, (4) a valid color specification (such as a
531
+ 3-tuple with RGB values or a valid color name), or (5) a
532
+ dictionary of keyword arguments that is passed on to the
533
+ call to surface. If set to None, color is set to (0.5,
534
+ 0.5, 0.5).
522
535
alpha : float in [0, 1]
523
- Alpha level to control opacity.
536
+ Alpha level to control opacity of the cortical surface .
524
537
525
538
Returns
526
539
-------
@@ -553,9 +566,14 @@ def _get_geo_params(self, cortex, alpha=1.0):
553
566
vmin = - .2 , vmax = 2 ,
554
567
opacity = alpha ), True , True ))
555
568
if isinstance (cortex , dict ):
569
+ if not cortex .has_key ('opacity' ):
570
+ cortex ['opacity' ] = alpha
571
+ if cortex .has_key ('colormap' ):
572
+ if not cortex .has_key ('vmin' ):
573
+ cortex ['vmin' ] = - 1
574
+ if not cortex .has_key ('vmax' ):
575
+ cortex ['vmax' ] = 2
556
576
geo_params = cortex , False , True
557
- if not geo_params [0 ].has_key ('opacity' ):
558
- geo_params [0 ]['opacity' ] = alpha
559
577
elif cortex in colormap_map :
560
578
geo_params = colormap_map [cortex ]
561
579
elif cortex in lut_manager .lut_mode_list ():
0 commit comments