Back to the main page.

Bug 2067 - No unit conversion in ft_prepare_headmodel

Reported 2013-03-18 14:47:00 +0100
Modified 2014-03-12 12:21:36 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 normal
Assigned to: Jörn M. Horschig
Depends on:
See also:

- 2013-03-18 14:47:13 +0100

Hi all, I found that in the latest version of FT (@ DCCN "H:\common\matlab\fieldtrip" used today on 18th of March 2013), the function ft_prepare_headmodel doesn't do the automatic conversion from mm to cm for a 'ctf' layout. It says in the tutorial that it should do that, and also in an earlier version of FT ('fieldtrip-20120222') it did do the conversion. Now you end up with sensor locations in cm and brain volume in mm. Best, Erik te Woerd

Robert Oostenveld - 2013-03-18 15:39:46 +0100

Hi Erik Do you have a small script and/or mat file that demonstrates it (and shows your usage)? Thanks

- 2013-03-18 16:12:56 +0100

Created attachment 438 SegmentedMRI (output of ft_volumesegment) This is then the next step (this should do the automatic conversion from mm to cm): % Create head model cfg = []; cfg.method='singleshell'; vol = ft_prepare_headmodel(cfg, segmentedmri);

Jörn M. Horschig - 2013-03-18 16:46:30 +0100

not sure if it should be in 'cm', since units are arbitrary anyways, but imho it would be good to ft_functions return them returned in consistent units. Just in case you did not know, for now you can use ft_convert_units to get the headmodel in 'cm'

Lilla Magyari - 2013-07-23 21:14:28 +0200

Hi all and Robert, No conversation is happening indeed, but I am wondering if it is really a bug. I thought it was due to a new decision on the unit handling in Fieldtrip. I assign this to the joint development user because I won't be around for while. Best, Lilla

Jörn M. Horschig - 2014-01-29 17:02:47 +0100

I'm gonna look into this. Even if this is not a real bug, the code and the documentation on the wiki (tutorial&example script) should be consistent

Jörn M. Horschig - 2014-03-12 07:59:01 +0100

Hi Erik, the conversion does not take place, because the segmentedmri is in 'mm' and FieldTrip nowadays does not do unnecessary/arbitrary conversions but keeps the input units. The 'beamformer' tutorial is not explicit about this, but explicitly defines the leadfield computation with cfg.grid.unit = 'cm'. The 'beamformingextended' tutorial explicitly mentions that the headmodel needs to be converted from 'mm' to 'cm' if you want to plot it together with the sensor positions. Probably it was a lack of communication from our side leading to this inconsistency from earlier to newer FT versions, sorry for that. At least, it might be good for you to know that we will keep it that and that ft_convert_units is the way to transform to other units :)