[Mne_analysis] How is the baseline correction calculated?

Jaakko Leppäkangas jaeilepp at student.jyu.fi
Tue Sep 6 01:17:13 EDT 2016
Search archives:

In the development version there is a new method just for that
http://mne-tools.github.io/dev/generated/mne.Evoked.html?highlight=apply_baseline#mne.Evoked.apply_baseline
.
You can also access the evoked data directly (evoked.data) and manipulate
it to your liking,

-Jaakko

On 5 September 2016 at 16:45, Emanuela Liaci <emanuela.liaci at gmail.com>
wrote:

> Hi Jaakko,
>
> thanks for the enlightenment. Yes of course, now I understand the problem.
> But then since I have to apply the correction after the averaging, how can
> I do it?
>
> Here my code:
>
> epochs_noRef = mne.EpochsArray(ElectrodeArray, info=info,tmin=-0.06)
>       # baseline = (-0.06, 0.04)
> epochs_Ref,_= mne.io.set_eeg_reference(epochs_noRef, ['TP9', 'TP10'])
> evoked=epochs_Ref.average()
>
> thanks a lot for your help,
> Emanuela
>
> On Mon, Sep 5, 2016 at 4:44 PM, Emanuela Liaci <emanuela.liaci at gmail.com>
> wrote:
>
>> Hi Jaakko,
>>
>> thanks for the enlightenment. Yes of course, now I understand the
>> problem. But then since I have to apply the correction after the emerging,
>> how can I do it?
>>
>> Here my code:
>>
>> epochs_noRef = mne.EpochsArray(ElectrodeArray, info=info,tmin=-0.06)
>>       # baseline = (-0.06, 0.04)
>> epochs_Ref,_= mne.io.set_eeg_reference(epochs_noRef, ['TP9', 'TP10'])
>> evoked=epochs_Ref.average()
>>
>> thanks a lot for your help,
>> Emanuela
>>
>> On Mon, Sep 5, 2016 at 4:14 PM, Jaakko Leppäkangas <
>> jaeilepp at student.jyu.fi> wrote:
>>
>>> Hi Emanuela,
>>>
>>> I assume you do the baselining when constructing the epochs
>>> (mne.Epochs(..., baseline=baseline))? It simply subtracts the mean over the
>>> baseline period. So the effective lines of code boil down to:
>>>
>>> mean = np.mean(data[..., imin:imax], axis=-1)[..., None]
>>> data -= mean
>>>
>>> , where the baseline runs from imin to imax. And yes this should be
>>> documented better. I'll make the issue to github.
>>>
>>> -Jaakko
>>>
>>> On 5 September 2016 at 14:48, Emanuela Liaci <emanuela.liaci at gmail.com>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> I am comparing the evoke data of one subject between my script in
>>>> Python with mne package and the script in IGOR pro that my lab used so far.
>>>>
>>>> I gave the following time interval for baseline correction to both:
>>>> baseline = (-0.060, 0.040). I noticed that the values of the average
>>>> change: for each electrode there is always the same difference (between
>>>> Python and IGOR) across data points.
>>>>
>>>> How come? Can I have a more detailed explanation of how the baseline
>>>> correction is applied?
>>>>
>>>> Many thanks,
>>>> Emanuela Liaci
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Mne_analysis mailing list
>>>> Mne_analysis at nmr.mgh.harvard.edu
>>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>>
>>>>
>>>> The information in this e-mail is intended only for the person to whom
>>>> it is
>>>> addressed. If you believe this e-mail was sent to you in error and the
>>>> e-mail
>>>> contains patient information, please contact the Partners Compliance
>>>> HelpLine at
>>>> http://www.partners.org/complianceline . If the e-mail was sent to you
>>>> in error
>>>> but does not contain patient information, please contact the sender and
>>>> properly
>>>> dispose of the e-mail.
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Mne_analysis mailing list
>>> Mne_analysis at nmr.mgh.harvard.edu
>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>
>>>
>>> The information in this e-mail is intended only for the person to whom
>>> it is
>>> addressed. If you believe this e-mail was sent to you in error and the
>>> e-mail
>>> contains patient information, please contact the Partners Compliance
>>> HelpLine at
>>> http://www.partners.org/complianceline . If the e-mail was sent to you
>>> in error
>>> but does not contain patient information, please contact the sender and
>>> properly
>>> dispose of the e-mail.
>>>
>>>
>>
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
>
> The information in this e-mail is intended only for the person to whom it
> is
> addressed. If you believe this e-mail was sent to you in error and the
> e-mail
> contains patient information, please contact the Partners Compliance
> HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to you in
> error
> but does not contain patient information, please contact the sender and
> properly
> dispose of the e-mail.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160906/4bcb4bb1/attachment.html 


More information about the Mne_analysis mailing list