single trial source signal

Sreenivasan Rajamoni Nadar sreenivasan.r.nadar at GMAIL.COM
Tue Dec 1 17:20:24 CET 2009


Dear Hanneke and FieldTripers,

Thank you Hanneke.

I extracted the single trial source signal using a time domain beamformer
Please find below the script:

clear all
ds = sprintf('/rajamoni/MEG_ds/AEDTPJOU_nback_20050422_01-f.ds')
cfg = [];
cfg.dataset = ds;
cfg.trialdef.eventtype  = '?';
definetrial(cfg);

cfg.trialdef.eventtype = 'r0';
cfg.trialdef.prestim  = 0.25;
cfg.trialdef.poststim = 0.25;
cfg = definetrial(cfg);
data = preprocessing(cfg);
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

cfg.channel         = {'MEG','-MRF43', '-MRO13'};
cfg.latency            = [-0.25 0.25];
cfg.covariance         = 'yes';
cfg.covariancewindow   = [-0.0 0.25];
cfg.keeptrials         = 'yes';
cfg.blcwindow          = [-0.25 0.25];
cfg.bpfreq             = [1 60];
[timelock] = timelockanalysis(cfg,data);

%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ctf_ss =
read_ctf_hdm('/rajamoni/AEDTPJOU_nback_20050422_01-f.ds/default.hdm');

cfg = [];
cfg.method   = 'lcmv'; %'rv'; %'mvl', % 'pcc'; 'loreta';  %'mne';
cfg.grid.pos = [7.3 -3.9 3.9; 7.7 1.8,4.0]; %arbitrary source location
cfg.singletrial = 'yes';
cfg.rawtrial    = 'no';
cfg.keepfilter  = 'yes';
cfg.keepmom     = 'yes';
%cfg.hdmfile = strcat(ds, '/default.hdm');
cfg.channel         = {'MEG','-MRF43', '-MRO13'};
cfg.vol = ctf_ss;
[source] = sourceanalysis(cfg, timelock);

% extraction of single trial source signals

%
%for trial all trials
for i=1:66
trial{i}=source.trial(i).mom{1};   % 1 for the 1st source location and |||ly
you could do for other source coord
trial{i}=sqrt((sum(trial{i}.*trial{i})));
end;

%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It seems to be working. I will report the other methods using freqanalysis
after play with the FieldTrip for a while!!

Any comments?

-Vasan


On Tue, Dec 1, 2009 at 4:28 AM, <Hanneke.vanDijk at med.uni-duesseldorf.de>wrote:

>  Dear Vasan,
>
> I also feel single-trial source-analysis does work, I have done it and
> published it J Neurosci (using pcc for just power data).
>
> The problem as you sent it in the mail below is that the cfg.grid.pos that
> you entered is not inside your headmodel:
>
> 0 dipoles inside, 1 dipoles outside brain
>
> There wil not be any data in there. You could try to plot the functional
> data interpolated on the mri with cfg.interactive = 'yes'; and then click on
> the location you want to do the single-trial analysis on. The coordinates
> will be printed in the workspace. These can be entered in cfg.grid.pos.
>
> If you have any more questions could you then send the cfg you used as
> well? This might give some hints as to what went wrong.
>
> It's just not the case that you can use some-one elses code and run your
> data through it. The choises you make for the data analysis depend a lot on
> the kind of data and what you want to do.
> But this mailing list is there to help you allong the way!
>
> Hope it helps,
>
> Best, Hanneke
>
>
>
> -----Oorspronkelijk bericht-----
> Van: Sreenivasan Rajamoni Nadar [mailto:sreenivasan.r.nadar at gmail.com<sreenivasan.r.nadar at gmail.com>
> ]
> Verzonden: ma 30.11.2009 16:21
> Aan: van Dijk, Hanneke
> Onderwerp: Re: [FIELDTRIP] single trial source signal
>
>
> Dear Hanneke,
>
> I did the freq analysis and source analysis as suggested by you. I get the
> following error:
>
> the input is freq data with 273 channels, 30 frequencybins and no timebins
> using headmodel specified in the configuration
> using gradiometers specified in the configuration
> creating dipole grid based on user specified dipole positions
> 0 dipoles inside, 1 dipoles outside brain
> ??? Error using ==> nearest>mbscalar at 47
> Argument to mbscalar must be scalar
>
> Error in ==> nearest at 15
> mbscalar(val);
>
> Error in ==> prepare_freq_matrices at 72
> fbin = nearest(freq.freq, cfg.frequency);
>
> Error in ==> sourceanalysis at 359
>     [Cf, Cr, Pr, Ntrials, tmpcfg] = prepare_freq_matrices(tmpcfg, data);
>
> ~~~~~~~~~~~~~~~~~~~~~~~
>
> Do you know the way to fix it?
>
> Thanks, Vasan
>
>
>
>
> On Sun, Nov 29, 2009 at 3:38 AM, Hanneke Van Dijk <
> Hanneke.vanDijk at med.uni-duesseldorf.de> wrote:
>
> > Dear Vasan,
> >
> > Since I don't know exactly how far you are in doing the analysis, I just
> > send you the basic script that shows the most important parameters. Don't
> > forget to do freqanalysis with cfg.output = 'fourier' and cfg.method =
> > 'mtmfft' for the specific frequency (cfg.foilim) you want to focus on.
> >
> > cfg                 = [];
> > cfg.grid.pos        = location of source coordinate;% [x y z] to fill in
> > cfg.frequency       = frequency of interest;
> > cfg.vol             = headmodel; %to make yourself see
> >
> http://fieldtrip.fcdonders.nl/example/make_leadfields_using_different_headmodels
> > cfg.projectnoise    = 'yes';%to compute the neural activity index using
> > sourcedescriptives
> > cfg.lambda          = '10%';%the amount of noice to estimate estimated
> > cfg.method          = 'pcc';
> > cfg.keeptrials      = 'yes';
> > Virtual_channeldata = sourceanalysis(cfg,freq);
> >
> > You can do sourcedescriptives after that.
> >
> > 'help freqanalysis', 'help sourceanalysis' and 'help sourcedescriptives'
> > should also help you further. Or you could have a look at the fieldtrip
> > website. There are a lot of options to taylor the analysis to your data.
> >
> > Hope this helps!
> >
> > Best,
> >
> > Hanneke van Dijk
> >
> > ------------------------------------------------------------
> > Institute for Clinical Neuroscience and Medical Psychology
> > Heinrich Heine Universitaet, Duesseldorf, Germany
> > ------------------------------------------------------------
> >
> > -----Oorspronkelijk bericht-----
> > Van: FieldTrip discussion list namens Rajamoni Nadar, Sreenivasan
> > (NIH/NIMH) [E]
> > Verzonden: do 26.11.2009 14:53
> > Aan: FIELDTRIP at NIC.SURFNET.NL
> > Onderwerp: [FIELDTRIP] single trial source signal
> >
> > FieldTrip Users,
> >
> > Is it possible to get single trial source signal using FieldTrip? I would
> > appreciate if anybody could provide code for the same.
> >
> > Thank you,
> > Vasan
> > ----------------------------------
> > The aim of this list is to facilitate the discussion between users of the
> > FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG
> > and EEG analysis. See also
> > http://listserv.surfnet.nl/archives/fieldtrip.html and
> > http://www.ru.nl/neuroimaging/fieldtrip.
> >
> >
> > ----------------------------------
> > The aim of this list is to facilitate the discussion between users of the
> > FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG
> > and EEG analysis. See also
> > http://listserv.surfnet.nl/archives/fieldtrip.html and
> > http://www.ru.nl/neuroimaging/fieldtrip.
> >
>
>
>

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20091201/c162430d/attachment-0002.html>


More information about the fieldtrip mailing list