...
The user can enter the components_to_exclude or the App can provide them. First we create epoch we create ecg epochs mne already has a convenience function for that it's called mne.preprocessing.create_ecg_epochs
we feed in the raw data (the raw data before filtering). So what's going to happen is that mne is going to try to figure out where the heart beats are, it's going to extract these events essentially and then based on these events it's going to produce epochs, then mne used small tool actually some kind of classification algorithm that tries to find ecg artifacts in our in our ICA (on other word we're going to ask mne to look into our ecg epochs and try to find the components that are actually related to the ecg activity in these epochs.Then we're going to do the exact same thing with eog. Once we have all of these components: the ecg components and the eog components that explain the respective artifacts we're just going to concatenate them and we're going to add them to ica.exclude
which is the list of components indices actually we intend to exclude as soon as we apply ica to clean our data. So we ran ica on the epochs we produced specifically for ica but now that we have discovered which components are related to artifacts and we want to remove these these artifacts from our data so we actually apply ica to the data we are analyzing while conducting our study by ica.apply
.