Back to the main page.

Bug 1834 - Impossibility to use ft_volumewrite using the data and code from the tutorial

Status CLOSED FIXED
Reported 2012-11-15 16:30:00 +0100
Modified 2018-03-10 21:58:42 +0100
Product: FieldTrip
Component: preproc
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P3 normal
Assigned to: Lilla Magyari
URL:
Tags:
Depends on:
Blocks:
See also:

MRC - 2012-11-15 16:30:03 +0100

Hi, My name is Marco Curado and I just started using Fieldtrip, aiming at source reconstruction of MEG event-related fields data using MNE. I tried using the fieldtrip tutorial available at the link: http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate Specifically the part: --- load mri_tal; load seg; % ensure that the skull-stripped anatomy is expressed in the same coordinate system as the anatomy seg.transform = mri_tal.transform; % save both the original anatomy, and the masked anatomy in a freesurfer compatible format cfg = []; cfg.filename = 'Subject01'; cfg.filetype = 'mgz'; cfg.parameter = 'anatomy'; ft_volumewrite(cfg, mri_tal); cfg.filename = 'Subject01masked'; ft_volumewrite(cfg, seg); --- but unfortunately using Subject01 data and the pieces of code provided by the tutorial this step 6 - "save to disk" - was impossible to complete because the following message appears: "Index exceeds matrix dimensions. Error in ft_volumewrite (line 124) cfg.parameter = cfg.parameter{1};" Indeed, cfg.parameter is "anatomy" in the first loop at the volumewrite function, but at the second it becomes an empty cell. So, impossible to identify what is cfg.parameter{1}. Can anyone help me with that? I would like first to try this tutorial with fieldtrip data and then use my own. Many many greetings and thanks in advance, Marco Curado PS: attached, the seg.mat and mri_tal.mat used from Subject01.


MRC - 2012-11-15 16:31:19 +0100

Created attachment 373 seg file used in the commented issue


Robert Oostenveld - 2012-11-16 12:32:23 +0100

Hi Lilla, could you have a look at this?


Lilla Magyari - 2012-11-20 15:37:38 +0100

Hi Marco, Thanks a lot for your email. You get an errror message at ft_volumewrite because it doesn't find the 'anatomy' field in the input (i.e. seg). It is because there is no anatomy field in the seg that you have sent me. In an earlier version of fieldtrip, there was a bug in ft_volumesegment. When {'skullstrip' 'brain'} was requested as output fields from ft_volumesegment the output (seg) structure did not contain the anatomy field anymore. This bug was fixed since then, and I suspect that your seg structure is missing the anatomy field because you are using an earlier version of fieldtrip which contained this bug. I think if you download the latest fieldtrip version, and do the analysis again from creating the seg structure with ft_volumesegment, it will probably work out. Please, let me know if you experience further problems. Best, Lilla


Lilla Magyari - 2013-01-11 15:01:46 +0100

This bug got fixed.