braindecode.visualization.project_to_topomap#

braindecode.visualization.project_to_topomap(data, chs_info, res=64)[source]#

Project per-channel attribution values onto a 2-D scalp topomap grid.

Projects channel values onto a (res, res) grid using Clough-Tocher triangulation on the 2-D electrode positions obtained from MNE’s sphere fitting. Points outside the convex hull of the electrode positions are set to NaN.

Parameters:
  • data (numpy.ndarray) – Per-channel values of shape (n_chans,).

  • chs_info (list of dict) – MNE-style channel info list. Each entry must have a 'ch_name' key and a 'loc' array whose first three elements are the 3-D Cartesian electrode position in metres.

  • res (int, default=64) – Resolution of the output square grid (pixels per side).

Returns:

Interpolated scalp map of shape (res, res). Pixels outside the electrode convex hull are NaN.

Return type:

numpy.ndarray