pvly
(Dora Lin)
July 18, 2023, 9:26am
1
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:
reset the montage by mne.channels.make_standard_montage
, but it remained the same.
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
richard
(Richard Höchenberger)
July 18, 2023, 10:38am
2
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
pvly
(Dora Lin)
July 19, 2023, 1:28am
3
Thank you, Richard. It seems to provide a similar result if I showed the names of the sensors.
richard:
raw.plot_sensors()
richard
(Richard Höchenberger)
July 19, 2023, 6:53am
4
It seems the coordinates are flipped
pvly
(Dora Lin)
July 19, 2023, 7:15am
5
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?
richard
(Richard Höchenberger)
July 19, 2023, 9:18am
6
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.
pvly
(Dora Lin)
July 19, 2023, 11:26am
7
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!
richard
(Richard Höchenberger)
July 19, 2023, 1:49pm
8
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…
pvly
(Dora Lin)
July 20, 2023, 4:34am
9
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.
richard
(Richard Höchenberger)
July 20, 2023, 9:08am
10
Can you share these files, please?
pvly
(Dora Lin)
July 20, 2023, 4:32pm
11
richard
(Richard Höchenberger)
July 20, 2023, 5:39pm
12
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)
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…
drammock
(Dan McCloy)
July 20, 2023, 10:12pm
13
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.
pvly
(Dora Lin)
July 21, 2023, 2:01am
14
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.
pvly
(Dora Lin)
July 21, 2023, 2:02am
15
I think this can be solved afterward by shifting the sensors?
richard
(Richard Höchenberger)
July 21, 2023, 6:44am
16
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")
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.
richard
(Richard Höchenberger)
July 21, 2023, 6:46am
17
The first one applies a montage to your data, the latter simply generates a montage, but doesn’t immediately apply it.
pvly
(Dora Lin)
July 21, 2023, 10:50am
18
Got it! Thank you for explaining!