Coregistration using Captrak Digitization - Could Not read Measurement Data

  • MNE-Python version: 0.23.4
  • operating system: Linux - Ubuntu 20.04

Issue: I am trying to use EEG data for co-registration, however, the EEG points do not show on the coregistration GUI. And I checked the montage to see if that was the issue and it had no measurement data. Below is my code - I am trying to figure out if this is data collection issue or software.

Error:

patient = user_input: ("E39") in this case
montage_name = traverse('/CapTrak', patient, patient, '.bvct')
montage = mne.channels.read_dig_captrak(montage_name)
montage.save(pathlib.Path('/mnt/d/Aidan/' + patient + '/Digitization') / 'Captrak_Digitization.fif')
data = pathlib.Path('/mnt/d/Aidan/' + patient + '/Digitization') / 'Captrak_Digitization.fif'
info = mne.io.read_info(data)

Double checking Sensor locations

Raw.set_montage(montage)
Raw.plot_sensors()

Coregistration
mne.gui.coregistration(subject = patient, subjects_dir=SUBJECTS_DIR, inst = data)

Thanks for any and all assistance!

Hello @aar40 and welcome to the forum!

This is bound to fail, as you’re trying to load the saved montage as measurement info. This doesn’t make sense :sweat_smile:

I think the confusion here stems from the fact that in the coregistration UI, one field is labeled “Digitization source”. This field does not refer to a montage file, but to a file containing the participant’s measurement info – typically a .fif file that contains all the measurement data and the .info structure (which is what the coregistration UI will use to display the digitization points).

So what you need to do:

  • Load your EEG data in MNE-Python
  • Read the correct montage from disk
  • Add the montage to the EEG data, e.g. via raw.set_montage(your_montage)
  • Save the data to disk, e.g. via raw.save('outfile.fif')
  • When starting the coregistration UI, pass the path to this file via the inst parameter

Best wishes,
Richard

1 Like

Amazing! This makes so much more sense :smile: