Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

First we need to load the raw data again, as we know now to get to our epochs we loaded the raw data we applied a certain set of filters, then we cut the raw data into epochs. Now it has been shown that ICA works best if we apply a high pass filter with a higher cut-off frequency, more like one hertz this increases ICA performance. If we have epochs processed with a different filter, we don't really want to feed them into the ICA we would like to produce a new set of epochs with filters applied that are of advantage to the ICA algorithm (This is the reason we have two separated apps one for epochs and another for filters) and to do that we have to start with the raw data again, we're going then to apply a filter this time it's a band pass with the lower cutoff at one hertz and the height at 40 hertz (filter App), then create epochs (epochs app), this new epochs should be the input of the which will then feed into ICA app. To run ICA we will use the mne.preprocessing.ICA object.

The user can enter the components_to_exclude or the App can provide them. First we create epoch we 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.excludewhich 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.