Back to the main page.

Bug 2827 - ft_prepare_sourcemodel does not update 'inside' field with tight grid

Status CLOSED FIXED
Reported 2015-02-05 15:26:00 +0100
Modified 2015-02-11 10:40:46 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: Macintosh
Operating System: Mac OS
Importance: P5 normal
Assigned to: Robert Oostenveld
URL:
Tags:
Depends on:
Blocks:
See also:

nno - 2015-02-05 15:26:31 +0100

When running the beam former tutorial data with the latest FT from github, I get the following error: Index exceeds matrix dimensions. Error in ft_prepare_leadfield (line 221) grid.leadfield{thisindx} = ft_compute_leadfield(grid.pos(thisindx,:), sens, vol, 'reducerank', cfg.reducerank, 'normalize', cfg.normalize, 'normalizeparam', cfg.normalizeparam, 'backproject', cfg Error in tut_source_ana (line 39) [grid] = ft_prepare_leadfield(cfg, freqPost); This seems to be caused by ft_prepare_sourcemodel. My script for reproducing the issue is included below. I sent a PR [2] that tries to fix this issue.. [1] http://fieldtrip.fcdonders.nl/tutorial/beamformer [2] https://github.com/fieldtrip/fieldtrip/pull/55 ---------------------------------- Code to reproduce the issue: load dataFIC cfg = []; cfg.toilim = [-0.5 0]; dataPre = ft_redefinetrial(cfg, dataFIC); cfg.toilim = [0.8 1.3]; dataPost = ft_redefinetrial(cfg, dataFIC); %% cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 4; cfg.foilim = [18 18]; freqPre = ft_freqanalysis(cfg, dataPre); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 4; cfg.foilim = [18 18]; freqPost = ft_freqanalysis(cfg, dataPost); %% prepare head model load segmentedmri cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, segmentedmri); %% compute leadfield cfg = []; %cfg.grad = freqPost.grad; cfg.vol = vol; cfg.reducerank = 2; cfg.channel = {'MEG','-MLP31', '-MLO12'}; cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution cfg.grid.unit = 'cm'; [grid] = ft_prepare_leadfield(cfg, freqPost);


Robert Oostenveld - 2015-02-05 17:49:21 +0100

thanks for reporting. I hope that my response on github already resolved it. If so, please close this issue. I think that the problem was also caught by other test scripts already, so I won't make the suggested code into a new test script.


nno - 2015-02-05 18:21:33 +0100

Thanks Robert for fixing this. For future reference, this issue has been resolved by commit [1]. I closed the associated PR [2] on github. [1] https://github.com/fieldtrip/fieldtrip/commit/75f7493ef8257104d894e8b86e7497dc34eb8368 [2] https://github.com/fieldtrip/fieldtrip/pull/55


Robert Oostenveld - 2015-02-11 10:40:46 +0100

Closed several bugs that were recently resolved. Please reopen if you are not happy with the resolution.