neuralfetch.utils.bids.BidsExporter

pydantic model neuralfetch.utils.bids.BidsExporter[source][source]

Export a Neuralset Study to BIDS format, optionally in parallel via SLURM.

Parameters:
  • path – Root directory for the BIDS output.

  • device – Neurophysiology recording type. Must be one of "Eeg", "Meg", "Ieeg", "Emg", or "Fnirs".

  • task – BIDS task label. If None, the "task" column in the events DataFrame is used.

  • anonymize – Passed to mne_bids.write_raw_bids. Requires a daysback key. If None, no anonymization is performed.

  • overwrite – If True, overwrite existing BIDS files.

  • infra_bids – Caching/compute backend for per-timeline BIDS writes. Uses a local process pool by default; set cluster="slurm" (with a folder and SLURM parameters) to parallelise across cluster nodes.

Examples

Sequential (default):

BidsExporter(path="/data/bids", device="Meg", task="mytask").export(study)

Parallel SLURM:

BidsExporter(
    path="/data/bids",
    device="Meg",
    task="mytask",
    infra_bids=exca.MapInfra(
        cluster="slurm",
        folder="/tmp/bids_jobs",
        slurm_partition="learnfair",
        mem_gb=64,
        timeout_min=60,
    ),
).export(study)
Fields:
field path: Path [Required][source]
field device: str [Required][source]
field task: str | None = None[source]
field anonymize: dict[str, Any] | None = None[source]
field overwrite: bool = False[source]
field infra_bids: MapInfra = MapInfra(cluster='processpool')[source]
export(study: Study) Path[source][source]

Run the full BIDS export for study.

Returns the BIDS root path.