Back to the main page.

Bug 1748 - read_neurosim_spikes is slow

Status CLOSED FIXED
Reported 2012-09-27 10:15:00 +0200
Modified 2019-08-10 11:56:08 +0200
Product: FieldTrip
Component: fileio
Version: unspecified
Hardware: PC
Operating System: Linux
Importance: P3 normal
Assigned to: Bart Gips
URL:
Tags:
Depends on:
Blocks:
See also:

Bart Gips - 2012-09-27 10:15:45 +0200

Created attachment 328 spike data The reading of spike data from neurosim is very inefficient. It reads the file line by line. My suggestion is to replace 'read_neurosim_spikes' (in /fileio/private/) with the attached function. It uses the matlab function 'textscan' and is a lot faster, since textscan has the built-in functionality to skip comment lines and irrelevant columns in the data. tic spike = ft_read_spike('/.'); toc reading a reasonably large datafile (~34000 lines, ~4MB, added as attachment) takes 31.6 seconds on my mentat node using the old 'read_neurosim_spikes'. whereas the new version only takes 0.56 seconds


Bart Gips - 2012-09-27 10:17:06 +0200

Created attachment 329 The improved read_neurosim_spikes function


Bart Gips - 2012-10-11 09:49:54 +0200

(In reply to comment #1) I have commited the improved function.


Bart Gips - 2012-10-11 09:50:29 +0200

I have commited the improved function.


Robert Oostenveld - 2019-08-10 11:52:13 +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 https://github.com/fieldtrip/fieldtrip/issues.


Robert Oostenveld - 2019-08-10 11:56:08 +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 https://github.com/fieldtrip/fieldtrip/issues.