[FieldTrip] bug with localizing

Kanal Eliezer ekanal at cmu.edu
Tue Sep 13 22:04:38 CEST 2011


Hello folks -

I'm trying to localize some activity I recorded, and I'm having a problem with the scripts. Following the instructions in the beamformer tutorial [1], I have the following code, which results in the following error:

~~~~~~~~~~~
...
mri = ft_read_mri('MR.1.3.12.2.1107.5.2.32.35216.20110517110054966038966');

% segment the brain
cfg             = [];
cfg.write       = 'no';
cfg.coordsys    = 'DICOM';
segmentedmri    = ft_volumesegment(cfg, mri);

% prepare head model
vol = ft_prepare_singleshell([],segmentedmri);


??? Reference to non-existent field 'seg'.

Error in ==> prepare_mesh_segmentation at 63
[mrix, mriy, mriz] = ndgrid(1:size(mri.seg,1), 1:size(mri.seg,2), 1:size(mri.seg,3));

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);

Error in ==> dots_sourceLocalization at 41
vol = ft_prepare_singleshell([],segmentedmri);
~~~~~~~~~~~

It looks like the source of this error is in a recently commented-out line (line 25) in the prepare_mesh_segmentation.m file (build 4120, off the svn):

~~~~~~~~~~~
...
cfg = ft_checkconfig(cfg, 'forbidden', 'numcompartments');
% if ~isfield(mri, 'tissue') && any(ismember(fieldnames(mri), {'gray' 'brain' 'scalp'})), cfg.tissue = 1; end
if ~isfield(cfg, 'threshold'), cfg.threshold = 0; end
...
~~~~~~~~~~~

The comment for that commit is "bugfix". Any ideas how to work around this problem? Thanks -

Elli Kanal


--------------------
Eliezer Kanal, Ph.D.
Postdoctoral Fellow
Center for the Neural Basis of Cognition
Carnegie Mellon University
4400 Fifth Ave, Suite 110A
Pittsburgh PA 15213
P: 412-268-4115
F: 412-268-5060



[1] http://fieldtrip.fcdonders.nl/tutorial/beamformer#the_forward_model_and_lead_field_matrix



More information about the fieldtrip mailing list