dirconn.write_simulation_bids#
- dirconn.write_simulation_bids(sim: SimulatedData, root: str | os.PathLike[str], *, subject: str, task: str, session: str | None = None, run: int | str | None = None, overwrite: bool = False) dict[str, Path]#
Write a simulation as a raw BIDS dataset plus a derivatives dataset.
The sensor channels go to a standard raw EEG dataset in
root(BrainVision files, written bymne-bids; the simulated unit is written as one microvolt). Epoched simulations are stored as concatenated trials with anevents.tsvfile and aDirconnsidecar entry that letsread_bids()split them again. Everything else goes toroot/derivatives/dirconn-simulationin the dirconn convention: the noise-free node activity (desc-sources), the direct channels as recorded (desc-direct), the broadband truth, the leadfield and a record holding the provenance.Nothing is written when a target already exists and
overwriteis false.- Parameters:
sim (SimulatedData) – The simulation to store.
root (path-like) – Root of the raw BIDS dataset.
subject (str) – BIDS entities.
task (str) – BIDS entities.
session (optional) – BIDS entities.
run (optional) – BIDS entities.
overwrite (bool) – Replace existing files.
- Returns:
The files written:
raw(the BrainVision header),sources,direct(only with direct nodes),truth,leadfieldandsimulation.- Return type:
dict of str to Path