gastropy.brainvision_to_bids#
- gastropy.brainvision_to_bids(vhdr_path, output_dir, subject, task='rest', session=None, target_sfreq=None, channel_pick=None)[source]#
Convert a BrainVision EGG recording to BIDS physio format.
Reads a BrainVision
.vhdrfile via MNE-Python, optionally downsamples and selects channels, then writes BIDS-compliant_physio.tsv.gzand_physio.jsonfiles.- Parameters:
vhdr_path (str or Path) – Path to the BrainVision
.vhdrheader file.output_dir (str or Path) – Root directory for BIDS output. Files are written to
output_dir/sub-XX/[ses-YY/]beh/.subject (str) – Subject identifier (without
sub-prefix).task (str, optional) – Task label for the BIDS filename. Default
"rest".session (str, optional) – Session identifier (without
ses-prefix). IfNone, the session level is omitted from the output path.target_sfreq (float, optional) – Target sampling frequency for downsampling. If
None, the original sampling rate is preserved.channel_pick (list of str, optional) – Channel names to include. If
None, all channels are kept.
- Returns:
Dictionary with keys
"tsv_path"and"json_path"pointing to the written files.- Return type:
- Raises:
ImportError – If MNE-Python is not installed.