Back to the main page.

Bug 2204 - ft_preprocessing demean with baselinewindow doesn't work

Status CLOSED DUPLICATE
Reported 2013-06-20 17:38:00 +0200
Modified 2019-08-10 12:04:02 +0200
Product: FieldTrip
Component: plotting
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 normal
Assigned to:
URL:
Tags:
Depends on:
Blocks:
See also:

Lilla Magyari - 2013-06-20 17:38:47 +0200

Created attachment 488 plotted ERP hi, When I am plotting the time-locked averaged data (baselined between -0.2 and 0), I get the attached image. The values plotted do not correspond to the values in avg. cfg=[]; cfg.channel = {'36'}; figure; ft_singleplotER(cfg,trialsnewavg); >> trialsnewavg.time(1) ans = -0.2000 >> trialsnewavg.avg(1) ans = 0 >> trialsnewavg.time(101) ans = -0.1000 >> trialsnewavg.avg(101) ans = -0.0860 >> trialsnewavg.time(201) ans = 0 >> trialsnewavg.avg(201) ans = -0.1837 You can find attached also the data. Lilla


Lilla Magyari - 2013-06-20 17:39:17 +0200

Created attachment 489 timelocked average


Lilla Magyari - 2013-06-20 17:52:46 +0200

sorry, I haven't looked at the data appropriately. I need to work on this further :)


Lilla Magyari - 2013-06-20 18:16:40 +0200

Hi, it seems to that the problem is that the ft_preprocessing function does not work as expected. I have done the following: cfg=[]; cfg.demean='yes'; cfg.baselinewindow=[-0.2 0]; trialsnew=ft_preprocessing(cfg,trialsnew2pre); sum(trialsnew.trial{1}(36,1:201))/201 ans = -55.3191 And when I plot for example channel 36, the singleplot function averages the data, and it results in the image which has been already attached (there is a deviation from 0 in the baseline). But something happened to the data, because the original has different values: sum(trialsnew2pre.trial{1}(36,1:201))/201 ans = -28.8082 But when I do cfg=[]; trialsnewavg = ft_timelockanalysis(cfg,trialsnew); cfg=[]; cfg.baseline = [-0.2 0]; cfg.parameter='avg'; trialsnewtb=ft_timelockbaseline(cfg,trialsnewavg); sum(trialsnewtb.avg(36,1:201))/201 ans = -3.1815e-16 And when I plot it, it looks fine. Lilla


Jan-Mathijs Schoffelen - 2013-07-15 11:11:19 +0200

This is the same as bug 2220. *** This bug has been marked as a duplicate of bug 2220 ***


Robert Oostenveld - 2019-08-10 12:04:02 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue describing the issue on https://github.com/fieldtrip/fieldtrip/issues.