Incorrect eeg layout from mne.io.read_raw_curry

Hello,

I’m trying to work on the data from Curry 8.

import mne

fname = "tslin0713.cdt"

raw = mne.io.read_raw_curry(fname, preload = True)
layout_from_raw = mne.channels.make_eeg_layout(raw.info)
layout_from_raw.plot()

However, the result looks like this:

My operating system, MNE version, and Python version are:

  • MNE version: 1.4.2
  • operating system: macOS 12.5
  • Python version: 3.10.8

I also tried:

  1. reset the montage by mne.channels.make_standard_montage, but it remained the same.
  2. analyze this data file with EEGLAB in Matlab and the layout looked fine.

This is the cdt file I used: tslin0713.cdt - Google Drive

Thanks so much for any help.
Best wishes,

Dora

Hello @pvly and welcome to the forum!

What do you get for

raw.plot_sensors()

?

I have never used make_eeg_layout() and I don’t think you need it here.

Best wishes,
Richard

Thank you, Richard. It seems to provide a similar result if I showed the names of the sensors.

It seems the coordinates are flipped :thinking:

Yes, it rotates 180Ëš.
I can only find functions to shift or scale the positions of sensors, but not to rotate them.

I’m not sure if this problem comes from I/O or my original cdt file.
But is there any possibility to modify the sensor location by in-built function?

I wanted to read your file via your provided example code, but it doesn’t work:

FileNotFoundError: The following required files cannot be found: ['info' 'labels'].
Please make sure all required files are located in the same directory as /private/tmp/tslin0713.cdt.hpi.

If the info and labels are needed, I’ll read them via read_annotation

fname = "0713/tslin0713.cdt"

raw = mne.io.read_raw_curry(fname, preload = True)
eve = mne.read_annotations("0713/tslin0713.cdt.cef")
raw.plot_sensors(show_names = True)

with the cdt.cef file:

Thank you!

No it seems some .hip file is needed? I have never worked with Curry data so I am not familiar with how many files it comes…

For curry 8, there are four files generated automatically:

.cdt
.cdt.ceo (equavelent to .cdt.cef)
.cdt.dpa
.cdt.dpo

That’s all I have.

Can you share these files, please?

All the generated files are in this folder:
https://drive.google.com/drive/folders/1GCEEgvRt7w15L3fJErnHT17O-KRZ8sZF?usp=sharing

Thank you!

Setting one of our default montages works for me.

# %%
import mne

fname = "tslin0713.cdt"

raw = mne.io.read_raw_curry(fname)
raw.set_montage("standard_1005", match_case=False)
raw.plot_sensors(show_names=True)

image

Now I’m not sure if there’s a problem in our Curry reader, or if the electrode positions that ship with your dataset were simply saved incorrectly…

that image doesn’t look right either, does it? the mastoids are on the earlobes, FP1 and 2 are floating in front of the eyes, and FPz is on the nose.

Thank you so much! It works and that helps me a lot!

I have a follow-up question: what is the difference between set_montage() and make_standard_montage? Because the latter doesn’t work for me.

I think this can be solved afterward by shifting the sensors?

With sphere="eeglab" it’s slightly better:

# %%
import mne

fname = "tslin0713.cdt"
raw = mne.io.read_raw_curry(fname)
raw.set_montage("standard_1005", match_case=False)

# sphere="eeglab" below requires correct spelling
raw.rename_channels(
    {
        "FPZ": "Fpz",
        "OZ": "Oz"
    }
)
raw.plot_sensors(show_names=True, sphere="eeglab")

image

But still not great. As if Cz is not centered between Oz and Fpz.

I’d say something is wrong with these sensor coordinates or the sensor / cap placement.

The first one applies a montage to your data, the latter simply generates a montage, but doesn’t immediately apply it.

Got it! Thank you for explaining!