I’m trying to make preprocessing via ICA for further analysis. Below my script:
import os
import mne
data_path = './'
vhdr_file_base_1 = os.path.join(data_path, 'S01_exp.vhdr')
raw = mne.io.read_raw_brainvision(vhdr_file_base_1, preload=True) # read raw data with mne
raw.set_montage('biosemi32', on_missing='ignore')
raw.filter(l_freq=1, h_freq=None) # High-pass filter above 1 Hz
raw.filter(l_freq=None, h_freq=40) # Low-pass filter below 40 Hz
raw.filter(l_freq=8, h_freq=30) # Band-pass filter between 8 and 30 Hz
raw.notch_filter(freqs=50) # Notch filter at 50 Hz (power line noise)
# The regression technique works regardless of chosen reference. However, it is
# important to choose a reference before proceeding with the analysis.
raw.set_eeg_reference("average")
# Removing slow drifts makes for more stable regression coefficients. Make sure
# to apply the same filter to both EEG and EOG channels!
raw.filter(0.3, 40)
raw.compute_psd(fmax=50).plot(picks="data", exclude="bads", amplitude=False)
raw.plot(duration=5, n_channels=30)
# set up and fit the ICA
ica = mne.preprocessing.ICA(n_components=20, random_state=97, max_iter=800)
ica.fit(raw)
ica.exclude = [1, 2] # details on how we picked these are omitted here
ica.plot_properties(raw, picks=ica.exclude)
when I run this script I get an errors and warning:
Using matplotlib as 2D backend.
Fitting ICA to data using 32 channels (please be patient, this may take a while)
Selecting by number: 20 components
Fitting ICA took 9.0s.
Using multitaper spectrum estimation with 7 DPSS windows
WARNING:root:Did not find any electrode locations (in the info object), will attempt to use digitization points instead. However, if digitization points do not correspond to the EEG electrodes, this will lead to bad results. Please verify that the sensor locations in the plot are accurate.
...
RuntimeError: Did not find any digitization points of kind FIFFV_POINT_EEG (3) in the info.
I looked here little bit for a solution, but saw only this question which mostly did not help me at all. Before getting this error, I had problems with scikit-learn
which was no available, but I think in the end this package does not make any influence.
Thank you in advance for any tips and help!