Back to the main page.

Bug 2744 - in ft_sourcedescriptives source.avg.csdlabel is not consistently updated resulting in an empty cell array

Reported 2014-10-22 14:12:00 +0200
Modified 2019-08-10 12:28:52 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Linux
Importance: P5 normal
Assigned to: Tzvetan Popov
Depends on:
See also:

Tzvetan Popov - 2014-10-22 14:12:47 +0200

The following results in an error cfg=[]; cfg.projectmom = 'yes'; source_proj=ft_sourcedescriptives(cfg,source); most likely due to the empty .csdlabel field. In today's meeting (22.10.14) we discussed to debug ft_sourcedescriptives line by line. Example data is also uploaded.

Tzvetan Popov - 2014-10-23 15:07:30 +0200

Example data is in: ~/fieldtrip/test/data_bug2744

Tzvetan Popov - 2014-10-23 15:14:20 +0200

Around line 229 .ori and .csd is computed only for the first source.inside voxel which causes problems later on around line 482 where the power is computed. Also around line 482 I have inserted: dipsel = find(strcmp(csdlabel{i}, 'scandip')); because dipsel was comming as empty structure from line 366 and subsequently caused an error in the next line.

Tzvetan Popov - 2014-10-23 15:15:27 +0200

The actual bug happened on line 448 I think.

Tzvetan Popov - 2014-10-27 14:01:28 +0100

bash-4.1$ svn commit ft_sourcedescriptives.m -m 'bugfix- all csdlabels are computed correctly see' Sending ft_sourcedescriptives.m Transmitting file data . Committed revision 9924.

Tzvetan Popov - 2014-10-27 14:02:52 +0100

resolved upon discussion and help from JM

Robert Oostenveld - 2019-08-10 12:28:52 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue describing the issue on