[FieldTrip] Beamformer Tutorial, ft_prepare_headmodel Error

Simon Homolle s.homolle at donders.ru.nl
Wed May 11 09:17:00 CEST 2016


Dear Lindsey,

The error lies in the way the data is loaded.
> segmentedmri = load('C:\Users\EEG1\Documents\Data\segmentedmri.mat’);

produces this:

segmentedmri = 

    segmentedmri: [1x1 struct]

The solution is quite easy, just replace the line by this:
>  load('C:\Users\EEG1\Documents\Data\segmentedmri.mat’);


and it should look like this:
segmentedmri = 

          dim: [256 256 256]
    transform: [4x4 double]
     coordsys: 'ctf'
         unit: 'mm'
         gray: [256x256x256 double]
        white: [256x256x256 double]
          csf: [256x256x256 double]
          cfg: [1x1 struct]


Bests,

Simon Homölle
PhD Candidate
Donders Institute for Brain, Cognition and Behaviour
Centre for Cognitive Neuroimaging
Radboud University Nijmegen
Phone: +31-(0)24-36-65059

> On 11 May 2016, at 07:11, Tate, Lindsey R. <lindseyrtate at ou.edu> wrote:
> 
> Hello FieldTrip community,
> 
> 
> I'm working through the Beamformer tutorial on this page (http://www.fieldtriptoolbox.org/tutorial/beamformer <http://www.fieldtriptoolbox.org/tutorial/beamformer>) using MEG data from a saccade task. <http://www.fieldtriptoolbox.org/tutorial/beamformer>
> 
>  <http://www.fieldtriptoolbox.org/tutorial/beamformer>
> 
> This code for constructing the head model, copied from the page, is giving me an error: 
>     % forward model mri
>     segmentedmri = load('C:\Users\EEG1\Documents\Data\segmentedmri.mat');
>     cfg = [];
>     cfg.method = 'singleshell';
>     headmodel = ft_prepare_headmodel(cfg, segmentedmri);
> 
> 
> This is the complete text of the error: 
> Error using ft_convert_units (line 150)
> cannot determine geometrical units
> 
> Error in ft_checkdata (line 543)
>   data = ft_convert_units(data);
> 
> Error in ft_prepare_headmodel (line 203)
>   data = ft_checkdata(data, 'hasunit', 'yes');
> 
> Error in LindseysBF (line 48)
>     headmodel = ft_prepare_headmodel(cfg, segmentedmri);
> 
> 
> When I check the struct segmentedmri, it has a field called unit with a value of 'mm.' Because this code is using a file downloaded from the tutorial (i.e., segmentedmri, which can be downloaded from the link above) and is copy/pasted from the tutorial page, I can't figure out what's wrong or what to investigate. Can someone tell me if I'm making an error in the code, if there's something I could change about the code to make it work, or if this is a bug? Any help would be greatly appreciated.
> 
> 
> Thank you,
> 
> Lindsey Tate
> Graduate Research Assistant 
> Brian and Biomarker Lab
> University of Oklahoma
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl <mailto:fieldtrip at donders.ru.nl>
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip <http://mailman.science.ru.nl/mailman/listinfo/fieldtrip>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160511/9d52e318/attachment-0002.html>


More information about the fieldtrip mailing list