[FieldTrip] beamforming tutorial problem

Micheli, C. c.micheli at fcdonders.ru.nl
Wed Oct 26 12:54:41 CEST 2011


Dear Tom

It seems there was an error in the call to one of the low level functions. Thanks for reporting. The bug has been fixed and now your instructions (with some modifications - see below) should run.

The forward module is undergoing heavy restructuring in these days and some of the functionality could be affected. 

To summarize how to derive a volumetric description of your head surface, let's say that if you start from a volumetric image (anatomy of the subjects) you have to perform a series of steps on the images (realign/segment) before creating the headmodel.

For this please refer to the following tutorial:
http://fieldtrip.fcdonders.nl/tutorial/headmodel

Once you have your segmented mri correctly in place you can call 

cfg = [];
cfg.method = 'singleshell';
cfg.tissue = { 'skull' }; % or whatever you want to create a boundary for
vol = ft_prepare_headmodel(cfg, segmentedmri);

I hope it helps,
Cristiano



----- "T.R. Marshall (Tom)" <t.marshall at fcdonders.ru.nl> schreef:

> Van: "T.R. Marshall (Tom)" <t.marshall at fcdonders.ru.nl>
> Aan: "fieldtrip" <fieldtrip at donders.ru.nl>
> Verzonden: Dinsdag 25 oktober 2011 15:16:35
> Onderwerp: [FieldTrip] beamforming tutorial problem
>
> Hi 'trippers,
> 
> I've been making my way through the tutorial on the fieldtrip website
> in an effort to teach myself about source localisation using
> beamforming. I tried - unsuccessfully - to adapt the code to my own
> MEG data, and have now resorted to copypasting my way through the
> tutorial and seeing what each function does to the sample data, in an
> attempt to build my own analysis pipeline.
> 
> I get as far as creating the head model from the segmented brain
> surface and then I get the following error.
> 
> (Note that I've just been copypasting the tutorial commands without
> altering them, so I've not specified anything else in my workspace. It
> should be clear what's there.)
> 
> %%%
> 
> (I input)
> 
> cfg = [];
> vol = ft_prepare_singleshell(cfg, segmentedmri);
> 
> 
> (fieldtrip's response)
> 
> not downsampling csf
> not downsampling gray
> not downsampling white
> the call to "ft_volumedownsample" took 0 seconds and an estimated 0
> MB
> using the segmentation approach
> using the segmented MRI
> including gray matter in segmentation for brain compartment
> including white matter in segmentation for brain compartment
> including CSF in segmentation for brain compartment
> smoothing the segmentation with a 5-pixel FWHM kernel
> triangulating the boundary of compartment 1
> 
> 
> (nasty red matlab response)
> 
> ??? Attempted to access cfg.numvertices(1); index out of bounds
> because
> numel(cfg.numvertices)=0.
> 
> Error in ==> prepare_mesh_segmentation at 75
>   [pnt, tri] = triangulate_seg(seg, cfg.numvertices(i), ori);
> 
> Error in ==> ft_prepare_mesh at 124
>   bnd = prepare_mesh_segmentation(cfg, mri);
> 
> Error in ==> ft_prepare_singleshell at 89
>   vol.bnd = ft_prepare_mesh(cfg, mri);
> 
> %%%
> 
> Now, matlab is right about one thing: numel(cfg.numvertices) is indeed
> zero, as the tutorial doesn't specify *anything* in the cfg structure
> to pass to ft_prepare_singleshell. However, the documentation for
> ft_prepare_singleshell states that when no value is given for
> numvertices, a default value of 3000 is used. So, what's going on
> here?
> 
> Update: I also tried specifying cfg.numvertices=3000 and passing that
> to ft_prepare_singleshell, since that's supposed to be the default
> value. This was the result:
> 
> %%%
> 
> ??? Error using ==> cgprechecks at 35
> Data points containing Inf or NaN are not supported.
> 
> Error in ==> convhulln at 42
> cgprechecks(x, nargin, cg_opt);
> 
> Error in ==> ksphere at 49
> tri = convhulln(pnt);
> 
> Error in ==> triangulate_seg at 44
> [pnt, tri] = ksphere(npnt);
> 
> Error in ==> prepare_mesh_segmentation at 75
>   [pnt, tri] = triangulate_seg(seg, cfg.numvertices(i), ori);
> 
> Error in ==> ft_prepare_mesh at 124
>   bnd = prepare_mesh_segmentation(cfg, mri);
> 
> Error in ==> ft_prepare_singleshell at 89
>   vol.bnd = ft_prepare_mesh(cfg, mri);
> 
> %%%
> 
> I don't know where to begin with this. Can somebody advise?
> 
> Best,
> Tom
> 
> -- 
> Tom Marshall, MSc.
> Neuronal Oscillations Group, Donders Centre for Cognitive
> Neuroimaging
> tel: +31(0)243668487
> email: t.marshall at fcdonders.ru.nl
> postal: PO Box 9101, 6500HB, Nijmegen, The Netherlands
> visiting: Kapittelweg 29, 6525EN, Nijmegen, The Netherlands
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip



More information about the fieldtrip mailing list