Пример #1
0
pl.figure()
pl.title('Source most correlated with the EOG channel')
pl.plot(sources[eog_source_idx].T)
pl.show()

###############################################################################
# Reject artifact sources and compare results

# join the detected artifact indices
exclude = np.r_[ecg_source_idx, eog_source_idx]

# Restore sources, use 64 PCA components which include the ICA cleaned sources
# plus additional PCA components not supplied to ICA (up to rank 64).
# This allows to control the trade-off between denoising and preserving data.
epochs_ica = ica.pick_sources_epochs(epochs,
                                     include=None,
                                     exclude=exclude,
                                     n_pca_components=64,
                                     copy=True)

# plot original epochs
pl.figure()
epochs.average().plot()
pl.show()

# plot cleaned epochs
pl.figure()
epochs_ica.average().plot()
pl.show()
Пример #2
0
# get sources
sources = ica.get_sources_epochs(epochs, concatenate=True)

pl.figure()
pl.title('Source most correlated with the EOG channel')
pl.plot(sources[eog_source_idx].T)
pl.show()

###############################################################################
# Reject artifact sources and compare results

# join the detected artifact indices
exclude = np.r_[ecg_source_idx, eog_source_idx]

# Restore sources, use 64 PCA components which include the ICA cleaned sources
# plus additional PCA components not supplied to ICA (up to rank 64).
# This allows to control the trade-off between denoising and preserving data.
epochs_ica = ica.pick_sources_epochs(epochs, include=None, exclude=exclude,
                                     n_pca_components=64, copy=True)

# plot original epochs
pl.figure()
epochs.average().plot()
pl.show()

# plot cleaned epochs
pl.figure()
epochs_ica.average().plot()
pl.show()