Back to the main page.

Bug 2511 - ft_read_headshape error in line 888 since last change to function

Reported 2014-03-25 12:44:00 +0100
Modified 2014-06-30 14:06:04 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 minor
Assigned to: Robert Oostenveld
Depends on:
See also:

Vitoria Piai - 2014-03-25 12:44:34 +0100

When using ft_sourceplot for my beamformer results, I'm getting an error in line 888 of ft_read_headshape ("unknown" file format is unknown). The function from FT version 2013/12/31 plots the results without any errors, but the current mentat version gives the error (last change to ft_read_headshape is from February 27th).

Robert Oostenveld - 2014-03-25 14:13:53 +0100

Hi Vitoria see for change details. the change from 27 Feb only pertains to adding a line shape = ft_struct2double(shape); to the bottom, i.e. not to line 888. also the change before that does not explain it. Can you provide a bit more details, i.e. which file are you trying to read (or which file is ft_sourceplot trying to read)?

Vitoria Piai - 2014-03-25 14:49:41 +0100

Hi Robert, I'm copying a test file + data to common/temporary. You should be able to find out the details needed in there. If not, please let me know. Groetjes, Vitória

Robert Oostenveld - 2014-03-25 15:19:42 +0100

for reference, I have copied the data file to /home/common/matlab/fieldtrip/data/test/bug2511.mat and the script to test_bug2511.m roboos@mentat001> svn commit test_bug2511.m Adding test_bug2511.m Transmitting file data . Committed revision 9311.

Robert Oostenveld - 2014-03-25 15:32:40 +0100

the full data is not needed to reproduce, this is enough: >> ft_read_headshape('surface_l4_both.mat') Error using ft_read_headshape (line 888) unknown fileformat "unknown" for head shape information >> ft_filetype('surface_l4_both.mat') Warning: could not determine filetype of surface_l4_both.mat > In fileio/private/warning_once at 158 In ft_filetype at 1189 ans = unknown >> load('surface_l4_both.mat') Error using load Unable to read file surface_l4_both.mat: No such file or directory. it turns out that in the file was removed. I.e. the file does not exist, and hence ft_read_headshape cannot read it. The error message is a bit cryptic, though. I have improved the warning/error message: mac001> svn commit ft_filetype.m Sending ft_filetype.m Transmitting file data . Committed revision 9312. The remaining question is: why was the file removed from fieldtrip?

Robert Oostenveld - 2014-03-25 15:34:35 +0100

(In reply to Robert Oostenveld from comment #4) > The remaining question is: why was the file removed from fieldtrip? The page suggests that other files are to be used for this type of visualization.

Robert Oostenveld - 2014-04-06 13:40:50 +0200

(In reply to Robert Oostenveld from comment #5) The following documentation should still be updated and the following test scripts roboos@mentat001> grep -l surface_l4 *.m test_bug2511.m test_tutorial_beamformer20120321.m test_tutorial_beamformer20131122.m test_tutorial_beamformer.m test_tutorial_beamforming_extended.m @JM, you changed the mat files, could you also do these?

Robert Oostenveld - 2014-04-11 19:58:41 +0200

I completed the test script, replacing the surface file with the correct one. It runs fine and the result looks nice. Another fix needed in the test script was that it was not reading the actual data from the mat file. Now it does. roboos@mentat001> svn commit test_bug2511.m Sending test_bug2511.m Transmitting file data . Committed revision 9400.

Jan-Mathijs Schoffelen - 2014-04-15 13:48:20 +0200

updated test functions and wiki, and changed occurrences of _l4_ into _white_

Robert Oostenveld - 2014-05-14 20:08:56 +0200

closed several of my bugs that have been resolved

Robert Oostenveld - 2014-06-30 09:41:53 +0200

For reference: Jan-Mathijs pruned the variables in the file to a more manageable size. Subsequently, I copied the pruned version to home/common, keeping the original with a different name. The original is interesting because of the large amount of provenance details. roboos@mentat003> mv bug2511.mat bug2511_orig.mat roboos@mentat003> mv bug2511_02.mat bug2511.mat

Jan-Mathijs Schoffelen - 2014-06-30 09:44:25 +0200

OK, I don't think disk space is an issue, but we could still consider only to keep one of the 3 variables in the file. Each of the variables seems equally big and contains the same amount of (15) previous cfg's. I suspect the only way in which they differ is the numeric data (and of course by consequence some of the cfg details).

Jan-Mathijs Schoffelen - 2014-06-30 14:06:04 +0200

bash-4.1$ svn commit -m "bugfix - fixed bug that was introduced by recent change to ft_sourceinterpolate/ft_sourceplot, cause test_bug2511 to break" test/test_bug2511.m ft_sourceinterpolate.m ft_sourceplot.m Sending ft_sourceinterpolate.m Sending ft_sourceplot.m Sending test/test_bug2511.m Transmitting file data ... Committed revision 9680.