pnpl.datasets.schoffelen2019.dataset.Schoffelen2019

pnpl.datasets.schoffelen2019.dataset.Schoffelen2019#

class pnpl.datasets.schoffelen2019.dataset.Schoffelen2019(data_path, task, preprocessing='notch+bp+ds', preprocessing_config=None, include_subjects=None, exclude_subjects=None, include_tasks=None, exclude_tasks=None, include_run_keys=None, exclude_run_keys=None, standardize=True, clipping_boundary=10.0, channel_means=None, channel_stds=None, include_info=False, create_h5_if_missing=True, download=True, preload_h5=False)[source]#

Schöffelen 2019 (MOUS) continuous MEG dataset (CTF).

Parameters:
  • data_path (str) – Local data directory (BIDS root).

  • task – TaskProtocol-shaped task object (see pnpl.tasks.schoffelen2019).

  • preprocessing (Optional[str]) – Preprocessing string used in derivative filenames.

  • preprocessing_config (Optional[Dict[str, Dict[str, Any]]]) – Preprocessing-step overrides.

  • exclude_subjects (Optional[Sequence[str]]) – BIDS subject ids without the sub- prefix (e.g., "A2002", "V1117").

  • exclude_tasks (Optional[Sequence[str]]) – "auditory", "visual", "rest". Tasks are auto-skipped for subjects that didn’t perform them (see is_task_for_subject()).

  • exclude_run_keys (Optional[Sequence[tuple]]) – 4-tuples (subject, "01", task, "01").

  • channel_stds (ndarray | None) – See pnpl.datasets.mixins.StandardizationMixin.

  • include_info (bool) – If True, __getitem__ returns (x, y, info).

  • create_h5_if_missing (bool) – If True, materialize H5 on demand.

  • download (bool) – If True, fetch missing files from Radboud WebDAV.

  • preload_h5 (bool) – Read H5 into RAM on first access.

  • include_subjects (Optional[Sequence[str]])

  • exclude_subjects

  • include_tasks (Optional[Sequence[str]])

  • exclude_tasks

  • include_run_keys (Optional[Sequence[tuple]])

  • exclude_run_keys

  • standardize (bool)

  • clipping_boundary (Optional[float])

  • channel_means (ndarray | None)

  • channel_stds

__init__(data_path, task, preprocessing='notch+bp+ds', preprocessing_config=None, include_subjects=None, exclude_subjects=None, include_tasks=None, exclude_tasks=None, include_run_keys=None, exclude_run_keys=None, standardize=True, clipping_boundary=10.0, channel_means=None, channel_stds=None, include_info=False, create_h5_if_missing=True, download=True, preload_h5=False)[source]#
Parameters:
  • data_path (str)

  • preprocessing (str | None)

  • preprocessing_config (Dict[str, Dict[str, Any]] | None)

  • include_subjects (Sequence[str] | None)

  • exclude_subjects (Sequence[str] | None)

  • include_tasks (Sequence[str] | None)

  • exclude_tasks (Sequence[str] | None)

  • include_run_keys (Sequence[tuple] | None)

  • exclude_run_keys (Sequence[tuple] | None)

  • standardize (bool)

  • clipping_boundary (float | None)

  • channel_means (ndarray | None)

  • channel_stds (ndarray | None)

  • include_info (bool)

  • create_h5_if_missing (bool)

  • download (bool)

  • preload_h5 (bool)

Methods

__init__(data_path, task[, preprocessing, ...])

calculate_standardization_params(h5_data_loader)

Calculate channel means and stds across all runs.

clip_sample(sample, boundary)

Clip sample values to [-boundary, boundary].

close_h5_files()

Close all open H5 file handles and drop preloaded arrays.

ensure_directory(dpath)

Recursively download a remote directory to dpath.

ensure_file(fpath)

Ensure a file exists locally, downloading via WebDAV if needed.

get_bids_raw_path(subject, session, task, run)

Construct path to raw BIDS MEG file.

get_calibration_files()

Get paths to Maxwell filter calibration files.

get_derivatives_path(subject, session[, ...])

Construct path to derivatives directory.

get_events_path(subject, session, task, run)

Construct path to events TSV file.

get_h5_dataset(run_key)

Get (cached) H5 dataset for a run.

get_h5_path(subject, session, task, run[, ...])

Construct path to H5 file.

get_headpos_path(subject, session, task, run)

Construct path to cached head position file.

get_meg_dir(subject[, session])

get_preprocessed_path(subject, session, ...)

Construct path to preprocessed file in derivatives.

get_sfreq_from_h5(h5_path)

Get sampling frequency from H5 file.

init_continuous_h5([preload_h5])

Initialize the H5 data cache.

load_continuous_window(subject, session, ...)

Load a time window from continuous H5 data.

load_continuous_window_from_sample(sample)

Load time window from a sample tuple.

load_head_positions(subject, session, task, run)

Load cached head positions from CSV file.

load_preprocessed_bids(subject, session, ...)

Load a preprocessed FIF file from the derivatives directory.

load_raw_bids(subject, session, task, run[, ...])

Load the raw CTF recording, ensuring the .ds directory is fully downloaded first.

prefetch_files(file_paths)

Prefetch multiple files in parallel (skips already-present).

raw_bids_exists(subject, session, task, run)

Check if raw BIDS data exists for given identifiers.

resolve_remote_file(rel_path)

Return {"size", "is_collection", "url"} for a remote path, without listing siblings or descendants.

setup_standardization([standardize, ...])

Set up standardization parameters.

standardize(data)

Apply z-score normalization and optional clipping to data.

Attributes

RADBOUD_DATASET_URL

RADBOUD_PASSWORD_ENV

RADBOUD_USERNAME_ENV

broadcasted_means

broadcasted_stds

channel_means

channel_stds

label_info

n_channels

n_times