Index exceeds matrix dimensions error during sourceanalysis

Inge Westmijse ingew at SOCSCI.RU.NL
Wed Apr 11 10:09:10 CEST 2007


Hi all,

I am trying to perform sourceanalysis, but get an error message I cannot
explain. It's probably something very basic, but I just don't get it!

Here's my code:

% Defining the dataset
cfg = [];
cfg.dataset = 'Ptn2_epilepsy_20060510_02-SWD-unfiltered.ds';
cfg.datatype = 'continuous';
cfg.trialfun = 'trialfun_ctf_continuous_withmarkers';
cfg = definetrial(cfg);

cfg.channel = 'MEG';
cfg.datatype = 'continuous';
cfg.bpfilter = 'yes';
cfg.bpfreq   = [300 1];

dataBroadBand = preprocessing(cfg);

cfg = [];
cfg.dataset = 'Ptn2_epilepsy_20060510_02-SWD-unfiltered.ds';
cfg.channel = 'MEG';
cfg.datatype = 'continuous';
cfg.trialfun = 'trialfun_ctf_continuous_withmarkers';

cfg.bpfilter = 'yes';
cfg.bpfreq   = [300 20];

dataBandPassed = preprocessing(cfg);

% Performing time-lock analysis on bp-filtered signal
cfg = [];
cfg.covariance = 'yes';
cfg.keeptrials = 'yes';

TLDataBandPassed = timelockanalysis(cfg,dataBandPassed);

% prepare_localspheres
hdr          = read_fcdc_header('Ptn2_epilepsy_20060510_02-SWD-unfiltered.ds');
cfg                        = [];
cfg.grad                   = hdr.grad;
cfg.headshape              = 'Ptn2b.shape';
[ft_headshape,cfg]         = prepare_localspheres(cfg);

% preparation of leadfields based on the local sphere model
cfg = [];
cfg.vol = ft_headshape;
hdr = read_fcdc_header('Ptn2_epilepsy_20060510_02-SWD-unfiltered.ds');
cfg.grid.resolution = 1;
cfg.grad = hdr.grad;
cfg.reducerank = 2;

Grid = prepare_leadfield(cfg,TLDataBandPassed);

% Source analysis with this broadband data
cfg = [];
cfg.method = 'lcmv';
cfg.vol = ft_headshape;
cfg.grid = Grid;
cfg.rawtrial = 'no';
cfg.keepfilter = 'yes';

SourceBP = sourceanalysis(cfg,TLDataBandPassed);

Everything goes fine until this last line, then I get the following error:
??? Index exceeds matrix dimensions.

Error in ==> sourceanalysis at 944
      data.cov = data.cov(seldata,seldata);

Error in ==> SAMimitation_v110407 at 64
SourceBP = sourceanalysis(cfg,TLDataBandPassed);

I hope someone can help me, thanks in advance! Inge Westmijse



-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/



More information about the fieldtrip mailing list