Reading EEG .set digitized electrodes/fiducials info into mne coreg GUI

  • MNE version: 1.8.0
  • operating system: Windows 11

What is the correct way to use digitized information of fiducials and electrodes contained in the EEG .set data file into the mne coregistration GUI? I could not load these custom head coordinates data; the GUI defaults to a fsaverage data.

I am able to extract information from the .set file with:

# Step 1: Load the EEG .set file and extract fiducials and electrodes
print("Loading the EEG .set file...")
raw = mne.io.read_raw_eeglab(eeglab_fname, preload=True)

# Check for montage in the raw object
montage = raw.get_montage()
if montage is not None:
    print("Electrode montage detected in the .set file.")
else:
    print("No montage found in the .set file. Proceeding with additional data sources.")

# Extract fiducials if available
if raw.info['dig'] is not None:
    print("Fiducials found in the .set file:")
    for point in raw.info['dig']:
        if point['kind'] == mne.io.constants.FIFF.FIFFV_POINT_CARDINAL:  # Fiducial points
            fiducial_name = {1: "Nasion", 2: "LPA", 3: "RPA"}.get(point['ident'], "Unknown")
            print(f"Fiducial: {fiducial_name} | Coordinates (mm): {point['r']}")