[FieldTrip] lcmv beamform with common filter
Ninja Katja Horr
ninja78278 at aol.com
Thu Jan 24 17:11:33 CET 2013
Dear Fieldtrip-Users,
I am trying to do lcmv beamform sourceanalysis with a common filter for all conditions (same session, different trials defined with ft_preprocessing belong to different conditions,sequence of conditions randomly intermixed for each block).
However if I use the common filter calculated from one block (consisting of 57 trials) ft_sourceplot doesn't show any activity anymore (if I run each condition separately without common filters it is working).
Here is how I proceed:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MAKE TIMELOCKANALYSIS FOR COMPLETE BLOCK
cfg = [];
cfg.channel='MEG';
cfg.keeptrials='yes';
cfg.blc='yes';
cfg.blcwindow = [-0.2 0]
data = ft_timelockanalysis(cfg,data);
cfg = [];
cfg.channel = 'MEG'
cfg.covariance ='yes';
cfg.covariancewindow = [0 0.2];
cfg.removemean = 'no';
cfg.keeptrials = 'yes';
timelock_post = ft_timelockanalysis(cfg,data);
cfg.covariancewindow = [-0.2 0];
timelock_pre = ft_timelockanalysis(cfg,data);
%MAKE SOURCEANALYSIS FOR COMPLETE BLOCK AND KEEP FILTER
cfg = [];
cfg.method = 'lcmv';
cfg.grid = grid.grid;
cfg.vol = vol.vol;
cfg.grad = grad.grad;
cfg.keeptrials='yes';
cfg.lcmv.lamda = '5%';
cfg.lcmv.keepfilter = 'yes';
source_post = ft_sourceanalysis(cfg,timelock_post);
source_pre = ft_sourceanalysis(cfg,timelock_pre);
source_post.avg.nai = source_post.avg.pow./source_pre.avg.pow;
%MAKE TIMELOCKANALYSIS OF SPECIFIC CONDITIONS
cfg = [];
cfg.trials=cond1; %this picks out the trials belonging to condition1
cfg.channel ='MEG';
cfg.keeptrials='yes';
cfg.blc = 'yes';
cfg.blcwindow = [-02 0];
data=ft_timelockanalysis(cfg,data);
cfg =[];
cfg.channel='MEG';
cfg.covariance='yes';
cfg.covariancewindow=[0 0.2];
cfg.removemean ='no';
cfg.keeptrials='yes';
timelock_post_cond1 = ft_timelockanalysis(cfg,data);
timelock_pre_cond1 = ft_timelockanalysis(cfg,data);
%MAKE SOUCEANALYSIS OF SPECIFIC CONDITION USING THE COMMON FILTER OF THE BLOCK
cfg = [];
cfg.method = 'lcmv';
cfg.grid = grid.grid;
cfg.grid.filter=source_post.avg.filter;
cfg.lcmv.keepfilter='no';
cfg.keeptrials = 'yes';
cfg.vol = vol.vol;
cfg.grad=grad.grad;
cfg.lcmv.lambda='5%';
source_post_cond1 = ft_sourceanalysis (cfg,timelock_post_cond1);
source_pre_cond1 = ft_sourceanalysis (cfg,timelock_pre_cond1);
source_post_cond1.avg.nai = source_post_cond1.avg.pow./source_pre_cond1.avg.pow;
%PLOT
source_post_cond1.pos = template.pos;
source_post_cond1.dim = template.dim;
source_post_cond1.xgrid = template.xgrid;
source_post_cond1.ygrid = template.ygrid;
source_post_cond1.zgrid = template.zgrid;
cfg = [];
cfg.parameter =' avg.nai';
interp_cond1 = ft_sourceinterpolate (cfg,source_post_cond1,mri);
cfg = [];
cfg.funparameter = 'nai';
cfg.method = 'ortho';
cfg.location = 'max';
cfg.funcolorlim = [1.5 2.0];
ft_sourceplot (cfg,interp_cond1);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I also tried it using rawtrials, but with the same outcome (no activation visible in sourceplot).
As I said, doing the same thing for cond1 without using the common filter works perfectly fine.
Does anybody have an idea what might be my mistake?.
Thank you a lot for your help!
Ninja
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130124/f70c8871/attachment-0001.html>
More information about the fieldtrip
mailing list