neuralset.extractors.neuro.ChannelPositions

class neuralset.extractors.neuro.ChannelPositions(*, event_types: Literal['MneRaw', 'Meg', 'Eeg', 'Ieeg'] = 'MneRaw', aggregation: Literal['single', 'sum', 'mean', 'first', 'middle', 'last', 'cat', 'stack', 'trigger'] = 'single', allow_missing: bool = False, frequency: float = 0.0, neuro: MneRaw | None = None, n_spatial_dims: Literal[2, 3] = 2, layout_or_montage_name: str | None = None, include_ref_eeg: bool = False, normalize: bool = True, factor: float = 1.0, infra: MapInfra = MapInfra(folder=None, cluster=None, logs='{folder}/logs/{user}/%j', job_name=None, timeout_min=None, nodes=1, tasks_per_node=1, cpus_per_task=None, gpus_per_node=None, mem_gb=None, max_pickle_size_gb=None, slurm_constraint=None, slurm_partition=None, slurm_account=None, slurm_qos=None, slurm_use_srun=False, slurm_additional_parameters=None, conda_env=None, workdir=None, permissions=511, version='0', keep_in_ram=True, max_jobs=128, min_samples_per_job=1, forbid_single_item_computation=False, mode='cached'))[source][source]

Channel positions in 2D or 3D, extracted from a Raw object’s mne.Info.

3D positions (n_spatial_dims=3) are always returned in MNE’s head coordinate frame, which is defined by the LPA, RPA, and nasion fiducial landmarks (origin at the midpoint of LPA–RPA, x-axis toward RPA, y-axis toward nasion, z-axis upward). This holds regardless of whether positions come from a named standard montage or from the raw data’s channel locations. See https://mne.tools/stable/documentation/implementation.html#coordinate-systems for details.

Parameters:
  • neuro (neuralset.extractors.neuro.MneRaw | None) – Extractor that defines the preprocessing steps applied to the Raw objects. This can either be specified in the config, or built with the build method.

  • n_spatial_dims (int) – Number of spatial dimensions (i.e. coordinates) to extract for each channel. For n_spatial_dims=2, the 2D projection of the channel positions as obtained through mne.Layout will be used. For n_spatial_dims=3, the 3D positions are extracted from mne.Montage in head coordinate frame.

  • layout_or_montage_name (str | None) – Name of the Layout or Montage to use. See mne.channels.read_layout() for a list of valid layouts and mne.channels.get_builtin_montages() for standard montages. If not provided, the function will look for a layout in the Raw.info object or for a montage in the Raw object. Note: MNE’s standard montages are only for EEG systems; MEG montages must be loaded from the raw data.

  • include_ref_eeg (bool) – If True, additionally try to extract the position of the anode of bipolar EEG channel (e.g. for the channel name “P3-Cz”, return position of both “P3” and “Cz”), yielding and output of shape (n_channels, n_spatial_dims * 2). If True, event_types must be one of Eeg or Ieeg.

  • normalize (bool) – If True, min-max normalize channel positions between 0 and 1 across each dimension. If False, 2D positions are in arbitrary units given by the mne.Layout projection, while 3D positions will be in head coordinate frame (approximately in the range [-0.1, 0.1] meters).

  • factor (float) – Factor to scale the channel positions by. E.g. set it to 10.0 to get 3D coordinates in decimeters, which yields values approximately in the range [-1, 1].