[FieldTrip] beamforming tutorial problem

Marshall, T.R. (Tom) t.marshall at fcdonders.ru.nl
Tue Oct 25 15:16:35 CEST 2011


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



More information about the fieldtrip mailing list