Back to the main page.

Bug 2144 - Invalid precision error in loreta2fieldtrip

Reported 2013-04-26 20:14:00 +0200
Modified 2019-08-10 12:29:00 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 normal
Assigned to: Eelke Spaak
Depends on:
See also:

Ingrid Nieuwenhuis - 2013-04-26 20:14:05 +0200

Created attachment 471 loreta-key output file that should be read in using loreta2fieldtrip When Using loreta2fieldtrip to read in a source produced with Loreta-key program I get the following error: Error using fread Invalid precision. Error in loreta2fieldtrip (line 89) activity = fread(fid, [voxnumber 1], 'float = >single'); I've attached a loreta file so you can replicate this. The loreta website is here: I've tried the following: activity = fread(fid, [voxnumber 1]); It does run, but the source looks all wrong, so I think the numbers are not translated correctly. Thanks! Would be so great if we can get this to work again, I'd like to use clusterstats on loreta source, but can't get it in FieldTrip.

Ingrid Nieuwenhuis - 2013-04-26 21:35:25 +0200

I have now implemented a fix so that loreta2fieldtrip can also read text files. This is slower, so preferably the fread should be fixed, but now I can read the Loreta sources in!! Whoohoo :)

Jan-Mathijs Schoffelen - 2013-05-01 13:33:14 +0200

did you commit this to svn? if so, please change this bug's status to fixed. thanks for your contribution.

Ingrid Nieuwenhuis - 2013-05-01 20:12:45 +0200

Yes I did commit this "patch" to svn. I call it patch because it is a work around not a fix of the bug. The patch is that now a text file can be read in, and Loreta-key lets you export text files. However these text files are big, and reading them in is much slower than fread the binary file. But it works. The problem with the binary file read in is still there. It errors on: activity = fread(fid, [voxnumber 1], 'float = >single'); So apparently the numbers aren't floats? is there a way to find out how the numbers are in the binary file (I attached one previously to this thread). I think Robert has had contact with the developer of Loreta-Key (pasted contact below). Maybe he knows in which way the data is put in the binary file. I don't know how these binary files thingies work, and how to find out what the correct way of reading them in is. I did try: activity = fread(fid, [voxnumber 1]); it does not error then, but numbers are all wrong. ---------------------------- Roberto Domingo Pascual-Marqui, Ph.D. The KEY Institute for Brain-Mind Research University Hospital of Psychiatry Lenggstr. 31, CH-8029 Zurich, Switzerland Tel.:+41-1-3884934 ; Fax:+41-1-3803043

Eelke Spaak - 2014-01-29 15:44:33 +0100

I think I fixed this, simply by changing the fread precision argument to 'float=>single', so removing the excess spaces :) Apologies for taking so long to get around to this. bash-4.1$ svn commit loreta2fieldtrip.m Sending loreta2fieldtrip.m Transmitting file data . Committed revision 9155.

Robert Oostenveld - 2019-08-10 12:29:00 +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