MultiChannelDatasetMixin#

class torch_brain.dataset.MultiChannelDatasetMixin[source]#

Bases: object

Mixin class for torch_brain.dataset.Dataset subclasses containing multi-channel recordings (e.g., EEG, ECoG, EMG, sEEG, etc).

Provides:
  • get_channel_ids() for retrieving sorted channel IDs from recording views returned by get_recording(...).

  • Configurable channel-ID uniquification by prepending metadata components before each channel id: multichannel_dataset_mixin_uniquify_channel_ids_with_session prepends session.id (default False) and multichannel_dataset_mixin_uniquify_channel_ids_with_subject prepends subject.id (default True). This subject.id uniquification allows channels with the same name in the same subject to be treated as the same channel across sessions. If both are enabled, the prefix order is subject.id/session.id.

get_channel_ids()[source]#

Return sorted channel IDs across recordings.

get_channel_ids aggregates rec.channels.id from get_recording(...). Any subject/session uniquification is applied there according to multichannel_dataset_mixin_uniquify_channel_ids_with_subject and multichannel_dataset_mixin_uniquify_channel_ids_with_session.

Return type:

list[str]