How to obtain Stim channels

Hello,

  • MNE version: 1.6.1
  • operating system: windows 10

I aiming to compute the coherence connectivity and show them in 3D using the helmet geometry like the example (Compute all-to-all connectivity in sensor space — MNE-Connectivity 0.6.0 documentation).
My data is in EDF format. However, I got an error in obtaining the events (ValueError: No stim channel found to extract event triggers). How can I find the stim channels for my data as the data info is
Info | 8 non-empty values
bads:
ch_names: EEG Fp1, EEG Fp2, EEG F7, EEG F3, EEG Fz, EEG F4, EEG F8, EEG …
chs: 22 EEG
custom_ref_applied: False
highpass: 0.3 Hz
lowpass: 70.0 Hz
meas_date: 2006-03-27 09:52:22 UTC
nchan: 22
projs:
sfreq: 250.0 Hz
subject_info: 4 items (dict).

Maybe one of the channel names might int that it’s not an EEG channel but a stim channel with the wrong type set? Maybe you have annotations? Else, maybe you lack all event information in your recording.

Mathieu

1 Like

@Moh.H welcome to the forum!

MNE typically imports events of EEG data as annotations, since many amplifier systems don’t have a stim channel. Check out raw.annotations. If there are annotations in the data, they should also be visible when you do raw.plot(). Annotations can be converted to events, and I believe in MNE 1.7 it will be possible to create epochs directly from annotated raw data without having to create events from the annotations first.

Best wishes,
Richard

2 Likes

Thank you for your reply,
I tried to obtain raw.annotations for my data and I couldn’t find any annotations. Also, there is no annotation when I plot the recording.
My goal is to obtain the spectral connectivity and show them in 3D. Can you direct me how to do that as I’m new in this field.

Are you sure the events are stored in the EDF file? If there’s no stim channel and no annotations, then the file does not contain events. Maybe these are stored in a separate file (just like in the example you’ve linked)?

2 Likes

Hi @cbrnr
I think you are right that the recording doesn’t contain events and, unfortunately, I don’t have another file for the recording. Now, how can I create the events for the recording?

You can not create information out of thin air. There is no magic here, maybe contact whoever acquired this dataset and discuss with this person to figure out where the events are stored.

Mathieu

1 Like

Hello @mscheltienne
So now I can’t obtain the connectivity by my current data. Is it right, If isn’t, how can I make it?

Thanks for your advance.

Hello, you can create arbitrary events for example using mne.make_fixed_length_events or epochs via mne.make_fixed_length_epochs

Is this a resting-state recording?

Richard

2 Likes

Hello @richard
Yes, the recording is a resting-state.
I tried to create arbitrary events using mne.make_fixed_length_events and I successfully compute spectral connectivity. However, I couldn’t plot them using plot_sensors_connectivity.
Although when I print the number of channels in epochs and in connectivity data are equals, this error occurred.

Number of channels in epochs: 22
Number of channels in connectivity data: 22
ValueError: The number of channels picked (22) does not correspond to the size of the connectivity data (484)