Update:
(1) Re Hari's suggestion
I tried converting the fif file to a hpts file using the C implementation:
(from the shell)
mne_convert_dig_data --fif $SUBJECT.fif --hptsout $SUBJECT.hpts --headcoord
(from python)
digfile_hpts = op.join(subjects_dir, subject, subject + '.hpts')
montage = mne.channels.read_montage(digfile_hpts)
raw = mne.io.read_raw_brainvision(subjects_dir + subject + '/' + subject +
'.vhdr',
montage=montage, verbose=None,
preload=False)
This raises a new error:
None of the sensors defined in the montage were found in the info
structure. Check the channel names.
The channel names in the montage are of the form '0001' ... '0291', with
duplicated '0001' ... '0064' at the end. The channel names in the raw data
are of the form '01' ... '64'.
I noticed that the first column in the .hpts file has 'eeg' for the last 64
rows (vs 'cardinal', 'hpi', and 'extra' for the previous ones). This first
column isn't being used by read_montage, but I think it is what
distinguishes the eeg channel locations from the other digitizer info.
I could manually change the channel names in the .hpts file to '01' ...
'64' for those rows, to match the channel names in the Brainvision file.
Not a pretty solution, but it might work.
(2) Re Eric's comment
I'd be happy to cut down the script/files. Where should I upload files? I'm
at Martinos, want to be sure to follow HIPAA etc.
In the meantime, I've created an issue on github linking back to this
thread.
Thanks,
Emily