cedalion.vis.anatomy.scalp_plot

cedalion.vis.anatomy.scalp_plot(
ts: Annotated[DataArray, DataArraySchema(dims='time', coords='time', 'time', 'samples')],
geo3d: Annotated[DataArray, DataArraySchema(dims='label', coords='label', 'label', 'type')],
metric: DataArray | _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes],
ax,
title: str | None = None,
y_title: float = None,
vmin: float | None = None,
vmax: float | None = None,
center: float | None = None,
cmap: str | Colormap = 'bwr',
norm: Normalize | None = None,
bad_color: tuple[float, float, float] | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float] = [0.7, 0.7, 0.7],
min_dist: Quantity | None = None,
min_metric: float | None = None,
channel_lw: float = 2.0,
optode_size: float = 36.0,
optode_labels: bool = False,
cb_label: str | None = None,
cb_ticks_labels: list[float, str] | None = None,
add_colorbar: bool = True,
zorder: str | None = None,
)[source]

Creates a 2D plot of the head with channels coloured according to a given metric.

Parameters:
  • ts – a NDTimeSeries to provide channel definitions

  • geo3d – a LabeledPoints to provide the probe geometry

  • metric ((DataArray, (channel,) | ArrayLike)) – the scalar metric to be plotted for each channel. If provided as a DataArray it needs a channel dimension. If provided as a plain array or list it must have the same length as ts.channel and the matching is done by position.

  • ax – the matplotlib.Axes object into which to draw

  • title – the axes title

  • y_title – the y position of the title in axes coordinates

  • vmin – the minimum value of the metric

  • vmax – the maximum value of the metric

  • center – when calculating vmin and vmax, center the value range at this value.

  • cmap – the name of the colormap

  • norm – normalization for color map

  • bad_color – the color to use when the metric contains NaNs

  • min_dist – if provided channels below this distance threshold are not drawn

  • min_metric – if provided channels below this metric threshold are toned down

  • channel_lw – channel line width

  • optode_size – optode marker size

  • optode_labels – if True draw optode labels instead of markers

  • cb_label – colorbar label

  • cb_ticks_labels – ticks and labels for colorbar

  • add_colorbar – if true a colorbar is added to the plot

  • zorder – ‘ascending’ or ‘descending’ or None. Controls whether channels with high or low metric values are plotted on top.

Initial Contributors: