[FieldTrip] beamforming tutorial problem

Magyari, Lilla Lilla.Magyari at mpi.nl
Wed Oct 26 11:21:16 CEST 2011


hi Tom,

I've just got the same error on my own data, I filed it as a bug.

But I could do the same with
cfg=[];
cfg.method = 'singleshell';
vol = ft_prepare_headmodel(cfg,seg);

Best,

Lilla

Marshall, T.R. (Tom) wrote:
> 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
> 

-- 
PhD student
Language and Cognition Group
research assistant
Neurobiology of Language Group

Max Planck Institute for Psycholinguistics
Nijmegen, P.O. Box 310, 6500AH, the Netherlands
Phone: 0031 24 3521561




More information about the fieldtrip mailing list