Back to the main page.

Bug 1764 - speed up volumethreshold (used in ft_datatype_segmentation)

Status CLOSED FIXED
Reported 2012-10-03 23:55:00 +0200
Modified 2012-10-29 13:44:58 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Linux
Importance: P3 minor
Assigned to: Robert Oostenveld
URL:
Tags:
Depends on:
Blocks:
See also:

Robert Oostenveld - 2012-10-03 23:55:33 +0200

while looking at test_tutorial_beamformer20120321.m I noticed that the construction of the singleshell head model is very slow, whereas it is a rather simple one. I believe the following is sufficient to reveal the problem profile on load('/home/common/matlab/fieldtrip/data/ftp/tutorial/beamformer/segmentedmri.mat') cfg = []; vol = ft_prepare_singleshell(cfg, segmentedmri); profile report most time is spent in volumethreshold at a simple count of the number of voxels. However, in this case I expect there to be only one compartment, which means that all the complicated stuff in volumeythreshold is not needed.


Robert Oostenveld - 2012-10-04 00:08:46 +0200

(In reply to comment #0) it seems to be because it is trying to make a singleshell MEG model out of the sct, grey and white rathen than from the brain.


Robert Oostenveld - 2012-10-04 09:53:34 +0200

I added a test that is inspired by test test_tutorial_beamformer20120321 which uses a call to ft_prepare_singleshell without specifying any cfg options. The idea is of course to get a singleshell headmodel based on the brain. This should not take long. If it does, it might be because ft_prepare_mesh is meshing the complex gray, white and csf segmentations rather than the simple brain. roboos@mentat001> svn commit Adding test/test_bug1764.m Transmitting file data . Committed revision 6668. I also made a change to ft_prepare_mesh so that it has reasonable defaults (brain/3000) in case the input is gray/white/csf. I expect this to be useful for localspheres and singlesphere MEG models as well. roboos@mentat001> svn commit Sending ft_prepare_mesh.m Transmitting file data . Committed revision 6667 Finally I removed the deprecated sourceunits from ft_prepare_singleshell. roboos@mentat001> svn commit ft_prepare_singleshell.m Sending ft_prepare_singleshell.m Transmitting file data . Committed revision 6670.


Robert Oostenveld - 2012-10-29 13:44:58 +0100

changed the status of several bugs that were RESOLVED some time ago to CLOSED