Back to the main page.

Bug 2085 - ft_senstype needs to be made faster

Status CLOSED FIXED
Reported 2013-03-30 08:49:00 +0100
Modified 2013-12-09 11:16:37 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P3 normal
Assigned to: Robert Oostenveld
URL:
Tags:
Depends on:
Blocks:
See also:

Robert Oostenveld - 2013-03-30 08:49:43 +0100

I just noticed in the test script for bug 1775 that ft_senstype and ft_senslabel were taking most of the CPU time when computing some simple leadfields. This needs to be improved.


Jan-Mathijs Schoffelen - 2013-03-30 08:59:44 +0100

moet jij geen eieren schilderen?


Robert Oostenveld - 2013-03-30 09:00:23 +0100

I created a test script in the master branch, fieldtrip/test/test_bug2085.m commit 0f59d16f973bf714fb459a5d3c534df4f79087ad Date: Sat Mar 30 08:57:31 2013 +0100 enhancement - created test script for timing the leadfield computation To my surprise they both run very slowly (~1 leadfield per second). The profiler shows that in both cases most time is spent in ft_senstype, ft_senslabel and strmatch.


Robert Oostenveld - 2013-03-30 09:01:33 +0100

(In reply to comment #1) zolang onze dochter nog lekker ligt uit te slapen (waarschijnlijk te lezen) gebruik ik even de tijd voor mezelf. En ik dacht: laat ik eens even een bug fixen, maar ja, dan kom je weer andere tegen...


Robert Oostenveld - 2013-03-30 09:11:01 +0100

(In reply to comment #2) de paastakken zitten in de knoop, het script staat niet in master maar in branch bug2085.


Robert Oostenveld - 2013-04-01 09:59:58 +0200

I made some changes, notably that ft_compute_leadfield does not update the grad/elec on every call. Somehow ft_sourceparcellate.m got involved in this as well, it should have been in bug 1775. mbp> git merge bug2085 Updating f2ce7dd..508286b Fast-forward forward/ft_compute_leadfield.m | 7 +- ft_sourceparcellate.m | 291 ++++++++++++++++++++++++++++++++++++++++ test/test_bug1775.m | 61 +++++++++ test/test_bug2085.m | 9 +- 4 files changed, 364 insertions(+), 4 deletions(-) create mode 100644 ft_sourceparcellate.m create mode 100644 test/test_bug1775.m mbp> git push oostenveld master Total 0 (delta 0), reused 0 (delta 0) To git@github.com:oostenveld/fieldtrip.git f2ce7dd..508286b master -> master mbp> git pull fieldtrip master From github.com:fieldtrip/fieldtrip * branch master -> FETCH_HEAD Already up-to-date. mbp> git push fieldtrip master Counting objects: 30, done. Delta compression using up to 2 threads. Compressing objects: 100% (21/21), done. Writing objects: 100% (21/21), 5.77 KiB, done. Total 21 (delta 13), reused 0 (delta 0) To git@github.com:fieldtrip/fieldtrip.git f2ce7dd..508286b master -> master


Robert Oostenveld - 2013-04-23 12:06:02 +0200

closed various bugs


Robert Oostenveld - 2013-04-23 12:06:31 +0200

closed various bugs


Jörn M. Horschig - 2013-12-09 11:04:41 +0100

the test script fails on a mentat because the lf computation time 'takes too long') the maximum ratio in the test script is 1.5, on a mentat the actual ratio is 1.65 (on my windows machine it is 1.01) I don't know what the ratio represents and what it should be and why, so I won't fix this and just report here ;)


Robert Oostenveld - 2013-12-09 11:16:37 +0100

(In reply to comment #8) the ratio represents the time it takes to perform the same computation, but once with grad.type unknown and once with it known. When unknown, there is additional overhead, which makes the time longer. The overhead should not be too large, since we don't want to spend to time on that.