Back to the main page.

Bug 249 - problem in local sphere handling

Status CLOSED FIXED
Reported 2010-11-29 10:06:00 +0100
Modified 2011-01-26 15:38:37 +0100
Product: FieldTrip
Component: forward
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P1 normal
Assigned to: Vladimir Litvak
URL:
Tags:
Depends on:
Blocks:
See also:

Robert Oostenveld - 2010-11-29 10:06:59 +0100

There is a problem in the local sphere handling, which manifests itself as holes in the beamformer volume (i.e. indicating an inside/outside problem). ----- On 26 Nov 2010, at 13:21, Vladimir Litvak wrote: The vol is modified by the call to prepare_headmodel (line 145 of ft_prepare_leadfield). If you do load prep_ls_input ft_plot_mesh(cfg.headshape, 'vertexcolor', 'k'); vol = ft_prepare_localspheres(cfg) sens = cfg.grad; [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', ft_channelselection('MEG', sens.label), 'order', 10); [bnd.pnt, bnd.tri] = headsurface(vol, sens, 'inwardshift', 0, 'surface', 'skin'); figure;ft_plot_mesh(bnd) Then you can reproduce the problem.


Robert Oostenveld - 2010-11-29 10:07:46 +0100

the problem can be reproduced by ---- load prep_ls_input % ft_plot_mesh(cfg.headshape, 'vertexcolor', 'k'); vol = ft_prepare_localspheres(cfg); sens = cfg.grad; [vol_all, sens_all] = ft_prepare_vol_sens(vol, sens, 'channel', ft_channelselection('all', sens.label), 'order', 10); [vol_meg, sens_meg] = ft_prepare_vol_sens(vol, sens, 'channel', ft_channelselection('MEG', sens.label), 'order', 10); [bnd.pnt, bnd.tri] = headsurface(vol_all, sens_all, 'inwardshift', 0, 'surface', 'skin'); figure;ft_plot_mesh(bnd) [bnd.pnt, bnd.tri] = headsurface(vol_meg, sens_meg, 'inwardshift', 0, 'surface', 'skin'); figure;ft_plot_mesh(bnd) % the output sens is the same, except that all has the additional ref % channels at the end % the difference is in the fitted spheres, which differ for the last (ref) coils figure plot(vol_meg.r-vol_all.r, 'r.')


Robert Oostenveld - 2010-11-29 10:08:45 +0100

Created attachment 12 imagesc(sens.tra)


Robert Oostenveld - 2010-11-29 10:09:29 +0100

I have spotted the bug by comparing the situation with all versus meg as channelselection. If you consider the original (G3BR) sens.tra, you would have something like in attached screenshot. If you select MEG channels, the bottom 40 rows are removed (but not the last 40 columns). The consequence is that the sphere selection for those coils is based on the max contribution to one of the MEG channels, whereas it should be on the respective REF channel (the REF spheres are global spheres, not local). So that is the difference, which then causes a difference in the estimated head surface, which is then used for the inside/outside detection. But the consequence is also that the MEG leadfield is suboptimal (because of the suboptimal sphere) for the REF coils and hence that the G3BR correction is suboptimal. The solution is that channel and coil selection have to be postponed until after the sphere-shuffling.


Robert Oostenveld - 2010-11-29 10:12:06 +0100

I fixed it in revision 2218, can you please confirm that it works for you?


Vladimir Litvak - 2010-11-29 12:10:26 +0100

Seems to work. No holes any more.


Robert Oostenveld - 2011-01-26 15:37:17 +0100

I closed all bugs that were resolved prior and including 2011-01-25. All resolved bugs should have been discussed by now, therefore we don't want to see them again in the next meeting. Instead, in the next meeting we want to see the recent improvements and fixes.


Robert Oostenveld - 2011-01-26 15:38:37 +0100

I closed all bugs that were resolved prior and including 2011-01-25. All resolved bugs should have been discussed by now, therefore we don't want to see them again in the next meeting. Instead, in the next meeting we want to see the recent improvements and fixes.