coco_pipe.viz.topo#

Montage-based topographic helpers.

Channel-name-driven scalp topomaps that need only a list of channel names and values (no recording Info): a single static map, an interactive selector across several maps, and a predicate that gates topomaps to genuine sensor axes. Positions are resolved from a standard MNE montage via coco_pipe.viz.info_from_montage().

Attributes#

Functions#

standard_montage_channels([montage])

Return the lower-cased channel names of a standard MNE montage.

feature_names_are_channels(feature_names[, channels, ...])

Return True when every feature name is a known montage channel.

plot_topomap_from_channel_values(channel_names, ...[, ...])

Topomap plotting without a raw object (uses standard montage).

plot_topomap_selector(value_maps, title[, unit])

Interactive selector over MNE-rendered topomaps.

Module Contents#

coco_pipe.viz.topo.LOGGER#
coco_pipe.viz.topo.standard_montage_channels(montage='colin27_1020')#

Return the lower-cased channel names of a standard MNE montage.

Parameters:

montage (str)

Return type:

frozenset[str]

coco_pipe.viz.topo.feature_names_are_channels(feature_names, channels=None, *, montage='colin27_1020')#

Return True when every feature name is a known montage channel.

Used to gate scalp topomaps of component loadings: a topomap is only meaningful when the feature axis is the sensor montage (e.g. raw sensor-space input), not when features are band-by-channel descriptors flattened into composite names. When channels is None the vocabulary defaults to the full standard montage (which carries both legacy and modern 10-20 names); callers pass their own list to restrict the gate to a specific subset or to accept non-standard channel names.

Parameters:
Return type:

bool

coco_pipe.viz.topo.plot_topomap_from_channel_values(channel_names, values, title, cmap='viridis', unit=None, bad_channels=None, *, montage='colin27_1020')#

Topomap plotting without a raw object (uses standard montage).

Parameters:
  • channel_names (collections.abc.Sequence[str]) – List of channel names.

  • values (collections.abc.Sequence[float]) – Values to plot (one per channel).

  • title (str) – Figure title.

  • cmap (str) – Colormap name.

  • unit (str | None) – Optional unit for colorbar label.

  • bad_channels (list[str] | None) – Optional list of channels to mark with an ‘X’.

  • montage (str) – Standard MNE montage used to resolve electrode positions.

Return type:

matplotlib.pyplot.Figure | None

coco_pipe.viz.topo.plot_topomap_selector(value_maps, title, unit=None)#

Interactive selector over MNE-rendered topomaps.

Parameters:
Return type:

plotly.graph_objects.Figure | None