# EEG processing workflow and ICA application

**URL:** <https://mne.discourse.group/t/eeg-processing-workflow-and-ica-application/3073>\
**Category:** Support & Discussions\
**Tags:** preprocessing, eeg, evoked, ica, epochs\
**Created:** [April 30, 2021, 8:34am UTC](https://mne.discourse.group/t/eeg-processing-workflow-and-ica-application/3073 "2021-04-30T08:34:08Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [April 30, 2021, 12:04pm UTC](https://mne.discourse.group/t/eeg-processing-workflow-and-ica-application/3073/2 "2021-04-30T12:04:15Z")

</div>

Hello @eduardo and welcome to the forum!

> [@eduardo](#):
>
> - Create `raw` object from my EEG data matrix.
> - Set `raw.info['bads']` based on annotations taken during the experiment.
> - Apply high-pass filter and notch filter to `raw` to remove slow drifts and powerline artifact.

Applying a notch filter is not necessary and I personally am not very fond of them anyways … if you don’t need the “high” frequencies, you can simply apply a low-pass with a cut-off frequency well below the power-line frequency. But this is **not** necessary for ICA. Only the high-pass filter (e.g., 1 Hz lower bound) is important to remove slow drifts.

> [@eduardo](#):
>
> - Create `epochs` object based on filtered `raw` object and `events` of interest.

But which events? 🙂 You have resting-state data, right?  
You can chop the continuous data into equidistant chucks using [`make_fixed_length_epochs()`](https://mne.tools/stable/generated/mne.make_fixed_length_epochs.html)

> [@eduardo](#):
>
> - Fit ICA to `epochs` object.
> - Identify blink artifact component using `ica.find_bads_eog(epochs, ch_name = 'Fp1')` and exclude that component. Note: I do not have an eog channel so I find the blink artifact component using highest correlation with my Fp1 channel.
> - Apply ICA to `epochs` object to reconstruct the epochs without the blink artifact component.

This sounds good in general. If the data you want to analyze requires a lower filtering cutoff for the high-pass, the recommended approach is to actually create **two** sets the data, one filtered with a 1-Hz-or-so high-pass for **fitting** ICA, and another one with a lower cutoff (e.g., 0.1 Hz), to which you will **apply** the ICA artifact removal.

> [@eduardo](#):
>
> If we want to apply ICA to remove blink artifacts, should we fit ICA to the `epochs` object, then apply the fitted ICA to this very `epochs` object and finally estimate the `evoked` response as `epochs.average()` ?

That’s how I would do it, simply to have those cleaned epochs around in case I decide to do something else with them (source localization, machine learning) later on.

> [@eduardo](#):
>
> or should we first estimate the `evoked` response, fit ICA to the `evoked` object and the apply it to that very `evoked` object? I consider the first approach more appropriate, but I am not sure at all.

You cannot **fit** ICA to an evoked object in MNE (only epochs and raw data); however you can **apply** ICA cleaning to evoked data.

---

_[View the full topic](https://mne.discourse.group/t/eeg-processing-workflow-and-ica-application/3073)._
