# EEG pipeline with MNE

**URL:** <https://mne.discourse.group/t/eeg-pipeline-with-mne/1475>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [April 4, 2018, 9:13pm UTC](https://mne.discourse.group/t/eeg-pipeline-with-mne/1475 "2018-04-04T21:13:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 4, 2018, 9:13pm UTC](https://mne.discourse.group/t/eeg-pipeline-with-mne/1475/1 "2018-04-04T21:13:39Z")

</div>

Hi there,  
I am analyzing some data from an experiment with children with dyslexia and  
a control group. The experiment was done using a 128 electrodes EEG.  
Basically, children were presented some words which could be wrong spelled  
or correct and were asked to decide whether these words were correct or  
not. The words were 120, 60 correct and 60 incorrect. These words were also  
divided into different categories (included/not included in a previously  
done training).

I would like to see if there are differences between:  
- correct/incorrect words  
- words that were included/not included  
- dyslexic children/control group.

I wanted to be sure that my pipeline was correct, as I am facing some  
difficulties.

1) I don't have any electrodes marked as eog or emg. I suppose I can just  
rename the two electrodes close to the eyes and the two two at the level of  
the cheekbones?  
2) Some subjects do not have a reference. Can I procede in this way?

> if len(raw.info['chs']) == 130:  
> &nbsp;&nbsp;&nbsp;&nbsp;ref\_channels=  
> &nbsp;&nbsp;&nbsp;&nbsp;print ('A reference is already present.')  
> else:  
> &nbsp;&nbsp;&nbsp;&nbsp;print('Data need to be referenced')  
> &nbsp;&nbsp;&nbsp;&nbsp;raw.set\_eeg\_reference('average', projection=True) # set EEG average  
> reference  
> &nbsp;&nbsp;&nbsp;&nbsp;ref\_channels=['Cz']  
> &nbsp;&nbsp;&nbsp;&nbsp;#raw.apply\_proj() #To apply the projection

3) What parameters should I pass to ICA to remove blinks/movement  
automatically? I can do ICA after epoching and then I visually check my  
data again, manually selecting other artifacts that have not been detected?

4) I want to implement autoreject in my pipeline. When should I use it?

5) Is it correct to check bad channels visually and using \*RANSAC algorithm  
from autoreject\* over all the epochs? I also tried to check for outliers  
using the function \*is\_outlier\* from here [https://stackoverflow.com/](https://stackoverflow.com/)  
questions/22354094/pythonic-way-of-detecting-outliers-in-  
one-dimensional-observation-data. It gives me a clue about which electrodes  
are different from the others, am I correct? Often times the ransac  
algorithm and the is\_outlier function gives me a similar list of electrodes.

6)What if I want to use different tmax and tmin for different events when  
creating epochs?

I want to be sure about my pipeline as this is the first eeg analysis I am  
doing.  
- I impor raw data -\> I mark bad channels -\> I do the reference -\> I create  
events and epochs -\> I run ICA  
At this point I actually don't understand how to remove artifacts with ICA.  
I just need to create EOG epochs and reject them?

After ICA I visually check the data again and manually remove other  
artifacts.

-\> Then I do the ERP for the events I am interested in.

At this point I would like to know how I can make the statistics to see if  
there are differences between conditions and between groups.

Suggestions?  
Kind Regards.  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20180404/5f29807a/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180404/5f29807a/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 5, 2018, 7:57pm UTC](https://mne.discourse.group/t/eeg-pipeline-with-mne/1475/2 "2018-04-05T19:57:54Z")

</div>

hi Davide,

answering all your questions in details could be book 🙂

maybe this preprint [https://www.biorxiv.org/content/early/2017/12/28/240044](https://www.biorxiv.org/content/early/2017/12/28/240044)  
that comes with code and recommendations to visually assess the quality  
of your processing steps can help.

HTH  
Alex
