gastropy.brainvision_to_bids

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 .vhdr file via MNE-Python, optionally downsamples and selects channels, then writes BIDS-compliant _physio.tsv.gz and _physio.json files.

Parameters:
  • vhdr_path (str or Path) – Path to the BrainVision .vhdr header 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). If None, 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:

dict

Raises:

ImportError – If MNE-Python is not installed.