std_dipplot#

std_dipplot(STUDY, ALLEEG, *args, clusters=None, comps=None, mode=None, dipcolor=None, dipsize=None, plot=True, return_com=False, **kwargs)#

Select and plot localized components from one or more STUDY clusters.

This standalone workflow consumes existing EEG["dipfit"]["model"] entries; it does not run source localization. Cluster, dataset, and component indices are EEGLAB-facing and therefore 1-based. comps selects positions within each cluster’s component list, matching EEGLAB’s std_plotcompdip convention rather than selecting component numbers.

The returned selection dictionaries expose dipoles and centroid. Each dipole records its study-set index, ALLEEG index, component number, subject, posxyz, momxyz, and residual variance rv. Modes joined and centroid implement the intent of the current EEGLAB test calls, which the pinned MATLAB implementation otherwise silently ignores.

Parameters:
  • STUDY (dict[str, Any] | None) – STUDY dictionary containing cluster membership.

  • ALLEEG (Any) – Loaded EEG dataset dictionaries with DIPFIT models.

  • clusters (Any) – 1-based cluster indices or "all". The parent cluster is excluded from "all" as in EEGLAB.

  • comps (Any) – Optional 1-based positions within each selected cluster.

  • mode (str | None) – "apart", "together", "multicolor", "joined", "centroid", or "comps".

  • dipcolor (Any) – Optional color or one color per selected cluster.

  • dipsize (Any) – Optional marker size or one size per selected cluster.

  • plot (bool) – Whether to create matplotlib figures.

  • return_com (bool) – Append a replayable Python command to the result.

  • args (Any)

  • kwargs (Any)

Returns:

(STUDY, selections, figures) and, when requested, the command. STUDY.cluster[*].dipole is updated with each selected centroid.

Return type:

tuple[Any, …]