[Mne_analysis] Bipolar EEG and Epochs rejection

Phillip Alday phillip.alday at mpi.nl
Thu Mar 19 08:31:09 EDT 2020
Search archives:

        External Email - Use Caution        

(putting the list back in CC)

Yes, all that should work, but two comments:

1. Those are rather strict thresholds you're using. Depends on other
things in your data, but those are much stricter than the ones I'm used to.

2. You don't need to use copy for the eeg_mask; you need it in the
eog_mask because of the pick() step.

Best,

Phillip

On 19/03/2020 08:58, pie.min at libero.it wrote:
>
> Thank you very much for your usefull suggestion!
>
> 1) Yes I think you are right,  BVA uses absolute threshold. 
>
> 2) I meant µV. 
>
> So if I understood correctly using your method to have a rejection
> criteria of type: HEOG exceeding 30 µV, VEOG exceeding 60 µV and other
> channels exceeding 80 µV; I should write:
>
> epochs = mne.Epochs(raw, events=events[0], event_id=[71, 72],
> tmin=-0.1, tmax=0.6, proj=True, baseline=(-0.1,0), preload=True)
>
> hmask = abs_threshold(epochs.copy().pick("HEOG"), 30e-6, eog=True)
>
> vmask = abs_threshold(epochs.copy().pick("VEOG"), 60e-6, eog=True)
>
> eye_mask = np.logical_or(hmask, vmask)
>
> epochs.drop(eye_mask, reason="EOG")
>
>
> and then I should create another mask for the eeg channels to use on
> the remained epochs?
>
> For example like this:
>
> eeg_mask = abs_threshold(epochs.copy(), 80e-6, eeg = True, eog=False)
>
> epochs.drop(eeg_mask, reason="EEG_artifacts")
>
>
> Am I right?
>
> Thank you very much again, 
>
> Best, 
>
> Pietro
>
>
>> Il 18 marzo 2020 alle 20.11 Phillip Alday <phillip.alday at mpi.nl> ha
>> scritto:
>>
>> I don't think there's a way to do this via the Epochs constructor.
>> There are two questions I have:
>>
>> (1) Did BVA use  peak-to-peak and or absolute threshold? I'm guessing
>> absolute (see next question), but the Epochs constructor uses
>> peak-to-peak.
>>
>> (2) Did you mean mV (1e-3) or µV (1e-6)? You use mV in your text, but
>> the scaling in your example is µV.
>>
>> If you want absolute thresholds and not peak-to-peak, checkout
>> philistine.abs_threshold. Assuming you want mV
>>
>> https://philistine.readthedocs.io/en/latest/api/philistine.mne.abs_threshold.html
>>
>> epochs = ....
>>
>> hmask = abs_threshold(epochs.copy().pick("HEOG"), 30e-3, eog=True)
>>
>> vmask = abs_threshold(epochs.copy().pick("VEOG"), 120e-3, eog=True)
>>
>> eye_mask = np.logical_or(hmask, vmask)
>>
>> epochs.drop(eye_mask, reason="EOG")
>>
>> (note that I'm the author of philistine)
>>
>> Best,
>>
>> Phillip
>>
>> On 18/03/2020 16:53, pie.min at libero.it <mailto:pie.min at libero.it> wrote:
>>>
>>>         External Email - Use Caution        
>>>
>>> Goodmorning,
>>>
>>> I am new to python and MNE.
>>>
>>> I am trying to replicate a brain vision analyzer pre-processing in
>>> MNE. In this pre-processing authors rejected epochs in which
>>> horizontal EOG exceeded 30 mV and/or vertical EOG exceeded 60 mV.
>>> I'm trying to achieve this result using the command mne.Epochs.
>>> However, in the reject dictionary I don't know how to specify this
>>> "double condition".
>>>
>>> Ideally I would to write somenthing like that:
>>>
>>> reject = dict(eeg = 160e-6, ["VEOG"] = 120e-6, ["HEOG"] = 30e-6)
>>>
>>> epochs = mne.Epochs(raw, events=events[0], event_id=[71, 72],
>>> tmin=-0.1, tmax=0.6, proj=True, baseline=(-0.1,0), reject=reject,
>>> preload=True)
>>>
>>> However in reject dictionary, if I understood correctly, I can only
>>> use one key 'eog'.
>>>
>>> Thank you very much for your help,
>>> Any advice will be usefull,
>>> Bests,
>>> Pietro
>>>
>>> _______________________________________________
>>> Mne_analysis mailing list
>>> Mne_analysis at nmr.mgh.harvard.edu <mailto:Mne_analysis at nmr.mgh.harvard.edu>
>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
>
>  
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200319/ac7ae120/attachment-0001.html 


More information about the Mne_analysis mailing list