Skip to content

Commit

Permalink
follow up: allow copyfile_brainvision to work with .dat extension (#1010
Browse files Browse the repository at this point in the history
)

* assert that brainvision file can be read by MNE

* pep style

* pep style

* remove non-functional assertion

* raise warning if .dat extension is supplied
  • Loading branch information
dominikwelke authored Jun 1, 2022
1 parent fa7a94b commit 6fe5330
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mne_bids/copyfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,14 @@ def copyfile_brainvision(vhdr_src, vhdr_dest, anonymize=None, verbose=None):
# extract encoding from brainvision header file, or default to utf-8
enc = _get_brainvision_encoding(vhdr_src)

# raise warning if binary file has .dat extension
if '.dat' in eeg_file_path:
warn("The file extension of your binary EEG data file is .dat, while "
"the expected extension for raw data is .eeg. "
"This might imply it's preprocessed or processed data: "
"We copied the files and changed the extension to .eeg, "
"but please ensure that this is actually BIDS compatible data!")

# Copy data .eeg/.dat ... no links to repair
sh.copyfile(eeg_file_path, fname_dest + '.eeg')

Expand Down

0 comments on commit 6fe5330

Please sign in to comment.