No digitization found - ICA

External Email - Use Caution

Hi,
I am trying to work with a .vhdr file from brainvision. I loaded the data, and did some plots. Then, I tried the ICA, but I ended up with the following error: "No digitization points found". I'm guessing this is related to the set montage. I did a lot of searching, and I noticed a lot of people have the same issue. Still, I can't seem to find a way to solve this. I am also attaching the file, in case you need. For now, I just want to be able to run the ICA and to properly do the set the montage (if needed). I looked all over the MNE website for solutions, but I simply can't work this out.

PS: MNE is amazing!

Here is what I've got so far:

import mne

mne.set_log_level('WARNING')
fname = "go.nogo.01.vhdr"
raw = mne.io.read_raw_brainvision(fname, preload=True)

raw.plot_psd(fmax = 50)

raw.plot()

raw.filter(1,40)

raw.plot()

raw_new_ref = mne.add_reference_channels(raw, ref_channels=['RightEar'])
raw_new_ref.plot()

ica = mne.preprocessing.ICA(n_components=15, random_state=97)
ica.fit(raw)
ica.plot_sources(raw)

ica.plot_components()

Daniel Cabral.

PhD student
Graduate Teaching Assistant
Performance and Exercise Psychophysiology lab
School of Kinesiology
Auburn University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200920/c4be22e2/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: go.nogo.01.eeg
Type: application/octet-stream
Size: 11178600 bytes
Desc: go.nogo.01.eeg
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200920/c4be22e2/attachment-0003.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: go.nogo.01.vhdr
Type: application/octet-stream
Size: 3668 bytes
Desc: go.nogo.01.vhdr
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200920/c4be22e2/attachment-0004.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: go.nogo.01.vmrk
Type: application/octet-stream
Size: 61508 bytes
Desc: go.nogo.01.vmrk
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200920/c4be22e2/attachment-0005.obj

External Email - Use Caution

Your channels appear to use the 10-20 system. Something like this should
work:

import mne
fname = "go.nogo.01.vhdr"
raw = mne.io.read_raw_brainvision(fname, preload=True)
raw.filter(1, 40)
montage = mne.channels.make_standard_montage('standard_1020')
raw.set_montage(montage, on_missing='ignore') # RIghtEar missing
ica = mne.preprocessing.ICA(n_components=15, random_state=97)
ica.fit(raw)
ica.plot_sources(raw)
ica.plot_components()

See for more information:

https://mne.tools/dev/auto_tutorials/intro/plot_40_sensor_locations.html?highlight=set_montage

Eric

External Email - Use Caution

Hi,
Thanks for the response. It worked perfectly. I do have one more question though.
I have been struggling to find the events from my files. Here is what I've got so far:
I am attaching a vhdr file with the markers
import mne

mne.set_log_level('WARNING')
fname = "go.nogo.01.vhdr"
raw = mne.io.read_raw_brainvision(fname, preload=True)

montage = mne.channels.make_standard_montage('standard_1020')raw.set_montage(montage, raise_if_subset = False)

ica = mne.preprocessing.ICA(n_components=15, random_state=97)
ica.fit(raw.copy().filter(1,40))
ica.plot_sources(raw);
ica.plot_components()

raw = ica.apply(raw.copy(), exclude = ica.exclude)

raw.plot();

events = mne.events_from_annotations(raw, event_id='auto')
events;
tmin, tmax = -0.2, 0.5

events_nogo_sed = [88,89,90,91,92,93,94,95,96,97,98,99,100,
                          101,102,103,104,105,106,107,108,109,110,
                          111,112,113]

epochs = mne.Epochs(raw, events, events_nogo_sed, tmin, tmax)

TypeError: events should be a NumPy array of integers, got <class 'tuple'>

External Email - Use Caution

The error is trying to tell you that the type(events) is not an ndarray,
but rather a tuple. If you print(type(events)), you should see "tuple".
This is because events_from_annotations returns two values:

https://mne.tools/stable/generated/mne.events_from_annotations.html

And those two values really come in a tuple. So you need:

events, event_ids_annot = mne.events_from_annotations(...)

or something like that. For more information, see:

https://mne.tools/stable/auto_tutorials/intro/plot_20_events_from_raw.html#converting-between-events-arrays-and-annotations-objects

Eric