[FieldTrip] fieldtrip Digest, Vol 61, Issue 7

Anne Mickan amickan1990 at gmail.com
Sat Dec 12 16:12:57 CET 2015


Dear Nick and Jan-Mathijs,

thanks for your emails. Here is the part of the code that details the cfg
inputs. I basically stuck to what was in the tutorial:

cfg = [];
cfg.channel = 'all';

% prepare neighbouring channels

cfg_neighb = [];
cfg_neighb.method = 'distance';
cfg.channel = 'all';
cfg_neighb.feedback = 'yes';
cfg_neighb.layout = 'easycapM3.mat';

neighbours = ft_prepare_neighbours(cfg_neighb, Correct{1});

% settings for statistics

cfg = [];
cfg.channel = {'EEG'};
cfg.latency = [0 1];

cfg.method = 'montecarlo';
cfg.statistic = 'depsamplesT';
cfg.correctm = 'cluster';
cfg.clusteralpha = 0.05;
cfg.clusterstatistic = 'maxsum';
cfg.minnbchan = 2;
cfg.neighbours = neighbours;
cfg.tail = 0;
cfg.clustertail = 0;
cfg.alpha = 0.5;
cfg.numrandomization = 500;

% prepare design
subj = 24;
design = zeros(2,2*subj);
for i = 1:subj
  design(1,i) = i;
end
for i = 1:subj
  design(1,subj+i) = i;
end
design(2,1:subj)        = 1;
design(2,subj+1:2*subj) = 2;

cfg.design = design;
cfg.uvar  = 1;
cfg.ivar  = 2;

Best,
Anne

On Fri, Dec 11, 2015 at 12:00 PM, <fieldtrip-request at science.ru.nl> wrote:

> Send fieldtrip mailing list submissions to
>         fieldtrip at science.ru.nl
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> or, via email, send a message with subject or body 'help' to
>         fieldtrip-request at science.ru.nl
>
> You can reach the person managing the list at
>         fieldtrip-owner at science.ru.nl
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of fieldtrip digest..."
>
>
> Today's Topics:
>
>    1. Stats matrix incomplete - cluster-based permutation test
>       (Anne Mickan)
>    2. Re: Stats matrix incomplete - cluster-based permutation   test
>       (Nicholas A. Peatfield)
>    3. Re: Stats matrix incomplete - cluster-based       permutation
>  test
>       (Schoffelen, J.M. (Jan Mathijs))
>    4. Re: filed trip (aishwarya selvaraj)
>    5. Re: filed trip (Pelt, S. van (Stan))
>    6. possible bug in tutorial code for creating sourcemodel (Juan)
>    7. Re: possible bug in tutorial code for creating sourcemodel
>       (Schoffelen, J.M. (Jan Mathijs))
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 10 Dec 2015 18:14:10 +0100
> From: Anne Mickan <amickan1990 at gmail.com>
> To: fieldtrip at science.ru.nl
> Subject: [FieldTrip] Stats matrix incomplete - cluster-based
>         permutation test
> Message-ID:
>         <
> CANX43OJN4h_1jEuDKMNwQC4sHeW+E2_StnS3WLkEbOkVpMerQA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Dear all,
>
> I'm just starting to work on a cluster-based permutation test script based
> on the tutorial for within-subject designs on the fieldtrip website. I ran
> into an issue when computing the [stat] matrix. I used the code as it was
> on the website:
>
> [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:});
>
> with the Correct and Incorrect matrices looking as follows:
>
> Correct{1}
>
>         avg: [34x600 double]
>        time: [1x600 double]
>     fsample: '500'
>       label: {34x1 cell}
>      dimord: 'chan_time'
>         dof: [34x600 double]
>         var: [34x600 double]
>
> The function runs without problems, i.e I don't get any error messages.
> However, the result seems incomplete.
>
> stat =
>                    prob: [25x1 double]
>             posclusters: []
>     posclusterslabelmat: [25x1 double]
>         posdistribution: [1x500 double]
>             negclusters: [1x1 struct]
>     negclusterslabelmat: [25x1 double]
>         negdistribution: [1x500 double]
>                 cirange: [25x1 double]
>                    mask: [25x1 logical]
>                    stat: [25x1 double]
>                     ref: [25x1 double]
>                  dimord: 'chan_time'
>                   label: {25x1 cell}
>                    time: 0
>                     cfg: [1x1 struct]
>
> Specifically, I later run into trouble with the stat.posclusterslabelmat
> and stat.negclusterslabelmat matrices which should apparantly contain far
> more values something more like 25x500 instead of 25x1. When calling
> neg_int = all(neg(:, m(k):m(k+1)), 2)
> I get the "Index exceeds matrix dimensions" error message which I assume
> has to do with the fact that "neg" does not have the appropriate matrix
> dimensions
> (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); )
>
> Where is the error / where should I look for the error?
>
> Some further design details:
> Nsubj = 24
> 2 conditions = Correct, Incorrect
> Within-subject design
> sampling rate = 500
> 34 channels
>
> I hope I gave enough / the necessary information for someone to help me
> out.
>
> Thanks in advance!
>
> Best,
> Anne
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151210/6dea45e9/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Thu, 10 Dec 2015 11:13:10 -0800
> From: "Nicholas A. Peatfield" <nick.peatfield at gmail.com>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] Stats matrix incomplete - cluster-based
>         permutation     test
> Message-ID:
>         <CADzq99=
> 3Ew0_4-mB9CxchT0CSQSKDo4e1JCkEtmdCxp-CWhYtQ at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Anne,
>
> To get an answer/suggestion you should provide the part of your script
> detailing your cfg inputs.
>
> Cheers,
>
> Nick
>
> On 10 December 2015 at 09:14, Anne Mickan <amickan1990 at gmail.com> wrote:
>
> > Dear all,
> >
> > I'm just starting to work on a cluster-based permutation test script
> based
> > on the tutorial for within-subject designs on the fieldtrip website. I
> ran
> > into an issue when computing the [stat] matrix. I used the code as it was
> > on the website:
> >
> > [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:});
> >
> > with the Correct and Incorrect matrices looking as follows:
> >
> > Correct{1}
> >
> >         avg: [34x600 double]
> >        time: [1x600 double]
> >     fsample: '500'
> >       label: {34x1 cell}
> >      dimord: 'chan_time'
> >         dof: [34x600 double]
> >         var: [34x600 double]
> >
> > The function runs without problems, i.e I don't get any error messages.
> > However, the result seems incomplete.
> >
> > stat =
> >                    prob: [25x1 double]
> >             posclusters: []
> >     posclusterslabelmat: [25x1 double]
> >         posdistribution: [1x500 double]
> >             negclusters: [1x1 struct]
> >     negclusterslabelmat: [25x1 double]
> >         negdistribution: [1x500 double]
> >                 cirange: [25x1 double]
> >                    mask: [25x1 logical]
> >                    stat: [25x1 double]
> >                     ref: [25x1 double]
> >                  dimord: 'chan_time'
> >                   label: {25x1 cell}
> >                    time: 0
> >                     cfg: [1x1 struct]
> >
> > Specifically, I later run into trouble with the stat.posclusterslabelmat
> > and stat.negclusterslabelmat matrices which should apparantly contain far
> > more values something more like 25x500 instead of 25x1. When calling
> > neg_int = all(neg(:, m(k):m(k+1)), 2)
> > I get the "Index exceeds matrix dimensions" error message which I assume
> > has to do with the fact that "neg" does not have the appropriate matrix
> > dimensions
> > (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); )
> >
> > Where is the error / where should I look for the error?
> >
> > Some further design details:
> > Nsubj = 24
> > 2 conditions = Correct, Incorrect
> > Within-subject design
> > sampling rate = 500
> > 34 channels
> >
> > I hope I gave enough / the necessary information for someone to help me
> > out.
> >
> > Thanks in advance!
> >
> > Best,
> > Anne
> >
> >
> > _______________________________________________
> > fieldtrip mailing list
> > fieldtrip at donders.ru.nl
> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> >
>
>
>
> --
> Nicholas Peatfield, PhD
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151210/6503aa5f/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 3
> Date: Thu, 10 Dec 2015 19:36:45 +0000
> From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] Stats matrix incomplete - cluster-based
>         permutation     test
> Message-ID: <7CAF2781-D756-4C0B-9B56-F05642437AF9 at fcdonders.ru.nl>
> Content-Type: text/plain; charset="windows-1252"
>
> Hi Anne,
>
> I agree with Nick, some more information would be helpful. At this stage
> my wild guess (assuming that you did not constrain your ?search space?,
> using cfg.channel and cfg.latency before calling ft_timelockstatistics)
> would be that there?s a major discrepancy in the descriptive dimensions of
> your data (i.e. the ?labels? and the time points) across the input
> arguments. FieldTrip does an explicit check on the labels and time points,
> it only proceeds to do calculations on the channels and time points that
> are present in each and every input argument. With respect to time points:
> this could even mean that numerical inaccuracies are the showstopper here.
> These inaccuracies could be easily introduced when e.g. downsampling.
>
> Best,
> Jan-Mathijs
>
>
> On Dec 10, 2015, at 8:13 PM, Nicholas A. Peatfield <
> nick.peatfield at gmail.com<mailto:nick.peatfield at gmail.com>> wrote:
>
> Hi Anne,
>
> To get an answer/suggestion you should provide the part of your script
> detailing your cfg inputs.
>
> Cheers,
>
> Nick
>
> On 10 December 2015 at 09:14, Anne Mickan <amickan1990 at gmail.com<mailto:
> amickan1990 at gmail.com>> wrote:
> Dear all,
>
> I'm just starting to work on a cluster-based permutation test script based
> on the tutorial for within-subject designs on the fieldtrip website. I ran
> into an issue when computing the [stat] matrix. I used the code as it was
> on the website:
>
> [stat] = ft_timelockstatistics(cfg, Correct{:}, Incorrect{:});
>
> with the Correct and Incorrect matrices looking as follows:
>
> Correct{1}
>
>         avg: [34x600 double]
>        time: [1x600 double]
>     fsample: '500'
>       label: {34x1 cell}
>      dimord: 'chan_time'
>         dof: [34x600 double]
>         var: [34x600 double]
>
> The function runs without problems, i.e I don't get any error messages.
> However, the result seems incomplete.
>
> stat =
>                    prob: [25x1 double]
>             posclusters: []
>     posclusterslabelmat: [25x1 double]
>         posdistribution: [1x500 double]
>             negclusters: [1x1 struct]
>     negclusterslabelmat: [25x1 double]
>         negdistribution: [1x500 double]
>                 cirange: [25x1 double]
>                    mask: [25x1 logical]
>                    stat: [25x1 double]
>                     ref: [25x1 double]
>                  dimord: 'chan_time'
>                   label: {25x1 cell}
>                    time: 0
>                     cfg: [1x1 struct]
>
> Specifically, I later run into trouble with the stat.posclusterslabelmat
> and stat.negclusterslabelmat matrices which should apparantly contain far
> more values something more like 25x500 instead of 25x1. When calling
> neg_int = all(neg(:, m(k):m(k+1)), 2)
> I get the "Index exceeds matrix dimensions" error message which I assume
> has to do with the fact that "neg" does not have the appropriate matrix
> dimensions
> (neg = ismember(stat.negclusterslabelmat, neg_signif_clust); )
>
> Where is the error / where should I look for the error?
>
> Some further design details:
> Nsubj = 24
> 2 conditions = Correct, Incorrect
> Within-subject design
> sampling rate = 500
> 34 channels
>
> I hope I gave enough / the necessary information for someone to help me
> out.
>
> Thanks in advance!
>
> Best,
> Anne
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>
>
> --
> Nicholas Peatfield, PhD
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151210/deacc96c/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 4
> Date: Fri, 11 Dec 2015 12:00:39 +0530
> From: aishwarya selvaraj <aishwaryaselvaraj1708 at gmail.com>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] filed trip
> Message-ID:
>         <
> CACWTKSojvkrwtTLFGpsh2H6CtHXY7-krT7C5-NBjqXdHPs1Ljg at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> do you still have that   m file with you??
> could you share ??
>
> On Fri, Nov 20, 2015 at 12:18 PM, Ashutosh Mishra <mishra408 at gmail.com>
> wrote:
>
> > Hi Aishwarya,
> >
> > I faced the similar problem. You are supposed to change your data
> > (.mat format) in a data structure that is read by fieldtrip. For that
> > you need at least following information
> > 1. Channel label and their location (If you don't have this file you
> > can use standard file available in Fieldtrip and you can include only
> > those electrode that you have been using in your experiment)
> > 2. sampling rate of the data (that you would have done while recording
> the
> > data)
> > 3. time vector
> > 4. no. of trials
> >
> > You can create them in MATLAB and put them together in a structure
> > along with your recorded data. This worked for me.
> >
> > --
> > Ashutosh Mishra
> > 5th year Integrated BS-MS student
> > Department of Physical Sciences
> > Indian Institute of Science Education and Research, Kolkata
> > _______________________________________________
> > fieldtrip mailing list
> > fieldtrip at donders.ru.nl
> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> >
>
>
>
> --
> Regards,
> Aishwarya Selvaraj
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151211/0e2bdbaf/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 5
> Date: Fri, 11 Dec 2015 08:09:14 +0000
> From: "Pelt, S. van (Stan)" <stan.vanpelt at donders.ru.nl>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] filed trip
> Message-ID:
>         <7CCA2706D7A4DA45931A892DF3C2894C2A2801E0 at exprd03.hosting.ru.nl>
> Content-Type: text/plain; charset="utf-8"
>
> Dear Aishwarya,
>
> The data structure should look something like this:
>
> % 1. Load data
> load EEGdata.mat
>
> % 2. Make FieldTrip structure, manually
> data.label={'Channel1Name?,?Channel2Name?,?Channel3Name?}; %your channel
> names
> data.trial{1}=[Channel1Data; Channel2Data; Channel3Data]'; % do for each
> trial: channelsxtimepoints data
> data.fsample=500; %your recording sampling frequency
> data.time{1}=[Trial1Timepoints]; % for each trial: timepoints per data
> sample (e.g: [0 0.02 0.04 0.06 etc])
>
> Going through the Walktrough Tutorial will be the best starting point when
> you just started to use FieldTrip:
> http://www.fieldtriptoolbox.org/walkthrough
> After that, you may go through the other Tutorial documentation or Example
> Matlab scripts.
>
> Best,
> Stan
>
> --
> Stan van Pelt, PhD
> Donders Institute for Brain, Cognition and Behaviour
> Radboud University
> Montessorilaan 3, B.01.34
> 6525 HR Nijmegen, the Netherlands
> tel: +31 24 3616288
>
> From: fieldtrip-bounces at science.ru.nl [mailto:
> fieldtrip-bounces at science.ru.nl] On Behalf Of aishwarya selvaraj
> Sent: vrijdag 11 december 2015 7:31
> To: FieldTrip discussion list
> Subject: Re: [FieldTrip] filed trip
>
> do you still have that   m file with you??
> could you share ??
>
> On Fri, Nov 20, 2015 at 12:18 PM, Ashutosh Mishra <mishra408 at gmail.com
> <mailto:mishra408 at gmail.com>> wrote:
> Hi Aishwarya,
>
> I faced the similar problem. You are supposed to change your data
> (.mat format) in a data structure that is read by fieldtrip. For that
> you need at least following information
> 1. Channel label and their location (If you don't have this file you
> can use standard file available in Fieldtrip and you can include only
> those electrode that you have been using in your experiment)
> 2. sampling rate of the data (that you would have done while recording the
> data)
> 3. time vector
> 4. no. of trials
>
> You can create them in MATLAB and put them together in a structure
> along with your recorded data. This worked for me.
>
> --
> Ashutosh Mishra
> 5th year Integrated BS-MS student
> Department of Physical Sciences
> Indian Institute of Science Education and Research, Kolkata
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>
>
> --
> Regards,
> Aishwarya Selvaraj
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151211/5309b65c/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 6
> Date: Fri, 11 Dec 2015 11:43:05 +0100
> From: Juan <juangpc at gmail.com>
> To: fieldtrip at science.ru.nl
> Subject: [FieldTrip] possible bug in tutorial code for creating
>         sourcemodel
> Message-ID:
>         <CAPO7YL+ufEwMRmBZk=
> XT8P5jeAp7-C4TDBNN1Aoe8X_mtYLh8w at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Dear Community,
>
> My name is Juan Garcia-Prieto and I am working in Madrid's MEG Lab.
> Currently I am learning to do beamforming source analysis using Fieldtrip.
>
> While following the tutorial: "Creating a sourcemodel for
> source-reconstruction of MEG or EEG data <http://goog_2124598831>
> ?"
> ??
>
> ? ?when I reach "
> Subject-specific grids that are equivalent across subjects in normalized
> space
> ?" procedure , there is an example code. This code throws an error when I
> execute it with a version of Fieldtrip I downloaded yesterday. I think I
> have downloaded correctly all the required info (Subject01.zip).
>
> ?Code:
>
> % NOTE: the path to the template file is user-specific
> template =
> ft_read_mri('~/matlab/fieldtrip/external/spm8/templates/T1.nii');
> template.coordsys = 'spm'; % so that FieldTrip knows how to interpret
> the coordinate system
>  % segment the template brain and construct a volume conduction model
> (i.e. head model): % this is needed to describe the boundary that
> define which dipole locations are 'inside' the brain.
> cfg          = [];
> template_seg = ft_volumesegment(cfg, template);
>
> cfg          = [];
> cfg.method   = 'singleshell';
> template_headmodel = ft_prepare_headmodel(cfg, template_seg);
> template_headmodel = ft_convert_units(template_headmodel, 'cm'); %
> Convert the vol to cm, because the CTF convenction is to express
> everything in cm.
>  % construct the dipole grid in the template brain coordinates% the
> negative inwardshift means an outward shift of the brain surface for
> inside/outside detection
> cfg = [];
> cfg.grid <
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html
> >.resolution
> = 1;
> cfg.grid <
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html>.tight
>  = 'yes';
> cfg.inwardshift = -1.5;
> ??
> cfg.headmodel   = template_headmodel;
>
> The problem occurs when I execute ?this line:
>
> ?
> ?
> ?
> ?
> template_grid   = ft_prepare_sourcemodel(cfg);
>
> Matlab's output:
> ?
> >> template_grid   = ft_prepare_sourcemodel(cfg);
> creating dipole grid based on automatic 3D grid with specified resolution
> Error using ft_prepare_sourcemodel (line 317)
> creating a 3D-grid sourcemodel this way requires sensor position
> information to estimate the extent of the brain
> ?
>
>
> I have managed to look around and found that you can specify the required
> "sensor position information" by executing this code just before
> (considering the folder with the information downloaded for this subject is
> located just there:
>
> ?cfg.gradfile='Subject01\Subject01.ds\Subject01.res4';
>
> Then the rest of the sample code in the tutorial can be executed with no
> issues.
>
> template_grid   = ft_prepare_sourcemodel(cfg);
>  % make a figure with the template head model and dipole gridfigure
> <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/figure.html
> >hold
> <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/hold.html>
> on
> ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor',
> 'none');alpha 0.5; camlight
> <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/camlight.html>;
> ft_plot_mesh(template_grid.pos(template_grid.inside,:));
>
>
> My questions:
>
> ?Is there a better solution for this problem? Maybe I can learn a little
> bit more about the toolbox with your answers.
>
> I didn't want to correct the wiki because? my solution depends on where one
> is placing the downloaded subject's data, and it is platform dependent.
> Should I add something to the tutorial anyway?
> ? I figure this can be interesting to other people.?
> ?
> ?
>
> Best,
>
>
> Juan
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151211/fee4d5ef/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 7
> Date: Fri, 11 Dec 2015 10:54:54 +0000
> From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] possible bug in tutorial code for creating
>         sourcemodel
> Message-ID: <93DA3667-0D6E-45A6-8387-1C01B51D7925 at fcdonders.ru.nl>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Juan,
>
> We?ll look into this specific issue soon, it should work without
> specifying sensor positions. However, for now and in general I would
> recommend just using a pre-cooked template grid. These can be found in
> fieldtrip/template/sourcemodel. This is mentioned in the tutorial, and I
> will make this more explicit shortly.
>
> Best,
>
> Jan-Mathijs
>
> On Dec 11, 2015, at 11:43 AM, Juan <juangpc at gmail.com<mailto:
> juangpc at gmail.com>> wrote:
>
> Dear Community,
>
> My name is Juan Garcia-Prieto and I am working in Madrid's MEG Lab.
> Currently I am learning to do beamforming source analysis using Fieldtrip.
>
> While following the tutorial: "Creating a sourcemodel for
> source-reconstruction of MEG or EEG data<http://goog_2124598831/>
> ?<http:/>"
> ??
>
> ? ?when I reach "
> Subject-specific grids that are equivalent across subjects in normalized
> space
> ?" procedure , there is an example code. This code throws an error when I
> execute it with a version of Fieldtrip I downloaded yesterday. I think I
> have downloaded correctly all the required info (Subject01.zip).
>
> ?Code:
>
>
> % NOTE: the path to the template file is user-specific
> template =
> ft_read_mri('~/matlab/fieldtrip/external/spm8/templates/T1.nii');
> template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the
> coordinate system
>
> % segment the template brain and construct a volume conduction model (i.e.
> head model):
> % this is needed to describe the boundary that define which dipole
> locations are 'inside' the brain.
> cfg          = [];
> template_seg = ft_volumesegment(cfg, template);
>
> cfg          = [];
> cfg.method   = 'singleshell';
> template_headmodel = ft_prepare_headmodel(cfg, template_seg);
> template_headmodel = ft_convert_units(template_headmodel, 'cm'); % Convert
> the vol to cm, because the CTF convenction is to express everything in cm.
>
> % construct the dipole grid in the template brain coordinates
> % the negative inwardshift means an outward shift of the brain surface for
> inside/outside detection
> cfg = [];
> cfg.grid<
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html>.resolution
> = 1;
> cfg.grid<
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html>.tight
> = 'yes';
> cfg.inwardshift = -1.5;
>
> ??
> cfg.headmodel   = template_headmodel;
>
>
> The problem occurs when I execute ?this line:
>
>
> ?
> ?
> ?
> ?
> template_grid   = ft_prepare_sourcemodel(cfg);
>
> Matlab's output:
> ?
> >> template_grid   = ft_prepare_sourcemodel(cfg);
> creating dipole grid based on automatic 3D grid with specified resolution
> Error using ft_prepare_sourcemodel (line 317)
> creating a 3D-grid sourcemodel this way requires sensor position
> information to estimate the extent of the brain
> ?
>
>
> I have managed to look around and found that you can specify the required
> "sensor position information" by executing this code just before
> (considering the folder with the information downloaded for this subject is
> located just there:
>
>
> ?cfg.gradfile='Subject01\Subject01.ds\Subject01.res4';
>
>
>
> Then the rest of the sample code in the tutorial can be executed with no
> issues.
>
>
> template_grid   = ft_prepare_sourcemodel(cfg);
>
> % make a figure with the template head model and dipole grid
> figure<
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/figure.html>
> hold<http://www.mathworks.com/access/helpdesk/help/techdoc/ref/hold.html>
> on
> ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor',
> 'none');alpha 0.5; camlight<
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/camlight.html>;
> ft_plot_mesh(template_grid.pos(template_grid.inside,:));
>
> My questions:
>
> ?Is there a better solution for this problem? Maybe I can learn a little
> bit more about the toolbox with your answers.
>
> I didn't want to correct the wiki because? my solution depends on where
> one is placing the downloaded subject's data, and it is platform dependent.
> Should I add something to the tutorial anyway?
> ? I figure this can be interesting to other people.?
> ?
> ?
>
> Best,
>
>
> Juan
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151211/346949fd/attachment-0001.html
> >
>
> ------------------------------
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
> End of fieldtrip Digest, Vol 61, Issue 7
> ****************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151212/f05960d2/attachment-0001.html>


More information about the fieldtrip mailing list