Plot brain surfaces with data layers Parameters ---------- surf_lh, surf_rh : str or os.PathLike or BSPolyData, optional Left and right hemisphere cortical surfaces, either as a file path to a valid surface file (e.g., .gii. .surf) or a pre-loaded surface from
| 167 | |
| 168 | |
| 169 | class Plot(object): |
| 170 | """Plot brain surfaces with data layers |
| 171 | |
| 172 | Parameters |
| 173 | ---------- |
| 174 | surf_lh, surf_rh : str or os.PathLike or BSPolyData, optional |
| 175 | Left and right hemisphere cortical surfaces, either as a file path |
| 176 | to a valid surface file (e.g., .gii. .surf) or a pre-loaded |
| 177 | surface from :func:`brainspace.mesh.mesh_io.read_surface`. At least one |
| 178 | hemisphere must be provided. Default: None |
| 179 | layout : {'grid', 'column', 'row'}, optional |
| 180 | Layout in which to plot brain surfaces. 'row' plots brains as a |
| 181 | single row ordered from left-to-right hemispheres (if applicable), |
| 182 | 'column' plots brains as a single column descending from |
| 183 | left-to-right hemispheres (if applicable). 'grid' plots surfaces |
| 184 | as a views-by-hemisphere (left-right) array; if only one |
| 185 | hemipshere is provided, then 'grid' is equivalent to 'row'. By |
| 186 | default 'grid'. |
| 187 | views : {'lateral', 'medial', 'dorsal', 'ventral', 'anterior', |
| 188 | 'posterior'}, str or list[str], optional |
| 189 | Views to plot for each provided hemisphere. Views are plotted in |
| 190 | in the order they are provided. If None, then lateral and medial |
| 191 | views are plotted. Default: None |
| 192 | mirror_views : bool, optional |
| 193 | Flip the order of the right hemisphere views for 'row' or 'column' |
| 194 | layouts, such that they mirror the left hemisphere views. Ignored if |
| 195 | `surf_rh` is None and `layout` is 'grid'. |
| 196 | flip : bool, optional |
| 197 | Flip the display order of left and right hemispheres in `grid` or |
| 198 | `row` layouts, if applicable. Useful when showing only 'anterior` |
| 199 | or 'inferior' views. Default: False |
| 200 | size : tuple of int, optional |
| 201 | The size of the space to plot surfaces, defined by (width, height). |
| 202 | Note that this differs from `figsize` in Plot.build(), which |
| 203 | determines the overall figure size for the matplotlib figure. |
| 204 | Default: (500, 400) |
| 205 | zoom : int, optional |
| 206 | Level of zoom to apply. Default: 1.5 |
| 207 | background : tuple, optional |
| 208 | Background color, default: (1, 1, 1) |
| 209 | label_text : dict[str, array-like], optional |
| 210 | Brainspace label text for column/row. Possible keys are |
| 211 | {‘left’, ‘right’, ‘top’, ‘bottom’}, which indicate the location. |
| 212 | See brainspace.plotting.surface_plotting.plot_surf for more |
| 213 | details Default: None. |
| 214 | brightness : float, optional |
| 215 | Brightness of plain gray surface. 0 = black, 1 = white. Default: |
| 216 | .5 |
| 217 | |
| 218 | Raises |
| 219 | ------ |
| 220 | ValueError |
| 221 | Neither `surf_lh` or `surf_rh` are provided |
| 222 | """ |
| 223 | def __init__(self, surf_lh=None, surf_rh=None, layout='grid', views=None, |
| 224 | mirror_views=False, flip=False, size=(500, 400), zoom=1.5, |
| 225 | background=(1, 1, 1), label_text=None, brightness=.5): |
| 226 | hemi_inputs = zip(['left', 'right'], [surf_lh, surf_rh]) |
no outgoing calls
no test coverage detected