[FieldTrip] ft_prepare_sourcemodel from localspheres

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Tue Jun 28 08:50:46 CEST 2022


Hi Kirandeep,

It seems that there’s something not entirely right with the computation of the localspheres model. Is there a particular reason why you want to use a localspheres forward solution, rather than the singleshell?

Best wishes,
Jan-Mathijs


On 27 Jun 2022, at 20:28, Kirandeep Kaur via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Dear all, I am relatively new to fieldtrip, so any help would be greatly appreciated!
I am trying to construct a source model using the following code from a MEG co-registered MRI.

------------------------------------------------------
%% starting from segmentation
%% segment mri
cfg = [];
cfg.tissue = 'brain';
cfg.spmversion = 'spm12';
seg = ft_volumesegment(cfg, mri_realigned);



save ('seg');



% cfg = [];
cfg.tissue = 'brain';
cfg.spmversion = 'spm12';
brain_mesh = ft_prepare_mesh(cfg, seg);



cfg = [];
cfg.method = 'localspheres';
cfg.grad = data.grad;
headmodel = ft_prepare_headmodel(cfg, brain_mesh);



save ('headmodel')
clear seg



%% construction of source model
cfg = [];
cfg.resolution = 0.005;
cfg.unit = 'm';
cfg.headmodel = headmodel;
cfg.grad = data.grad;
sourcemodel = ft_prepare_sourcemodel(cfg);



save ('sourcemodel')

------------------------------------------------------


This code runs well up to the construction of the head model, but I get the following error while trying to make the source-model (a screenshot of the same is attached). When I run this code using 'singleshell' head model instead of 'localsheres' it works just fine.


----------------------------------------------------------
Error using headsurface (line 155)
there should be just as many spheres as coils

Error in ft_prepare_sourcemodel (line 380)
        pos = headsurface(headmodel, sens);
-----------------------------------------------------------

Could anyone suggest how to resolve this. Thanks a lot!

Kind regards
Kirandeep Kaur



<Screenshot 2022-06-26 at 11.45.21 PM.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!-ZkFWN2k_XU-ZKk-twSjUFZwKLjqktQkF__tncr3uGYMmdD1Kc1LvgYjvBM4JcXb-ioVqhGGZg4aPJ2kG2HUZUgEFccamw_gawzILw$

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20220628/86e09ea4/attachment.htm>


More information about the fieldtrip mailing list