[FieldTrip] MEG fiducial points creating error in volume alignment

Barnett, Benjy benjy.barnett.20 at ucl.ac.uk
Tue Mar 21 20:45:13 CET 2023


Hey Guys,

I am trying to create a head model using a template anatomical MRI and the fiducial points included in my CTF MEG data. However, when I include the fiducial points as returned by ft_read_heashape, it causes the head model and sensors to be completely misaligned (see attached photo). I have tried with and without converting them both into mm units using ft_convert_units but this did not help. The process works if I use the interactive method in ft_volumerealign so I’m sure the error is coming at this point. The reason I do not want to use the interactive method is because if I do that I will end up with one head model for all subjects (as I would just be clicking on the same fiducial points for each subject). I want to use the fiducial points measured by the MEG system per subject, to improve the fit of the head model for each subject. I’ve included my code below.

Would you be able to help me figure out how to use subject specific, MEG-measured fiducial points in the volume realignment step of the forward-model process? Thank you.

mri = ft_read_mri(‘~\template\anatomy\single_subj_T1.nii');



%get fiducial points
raw_data_dir = fullfile(‘~\data\Raw',subject,'meg','raw');
dataSets = str2fullfile(raw_data_dir,’*wildcard*');
ds = dataSets(1);
head = ft_read_headshape(ds);
head = ft_convert_units(head,'mm');



%align to ctf
cfg = [];
cfg.method = 'fiducial';
cfg.coordsys = 'ctf';
cfg.fiducial.nas = head.fid.pos(1,:);
cfg.fiducial.lpa = head.fid.pos(2,:);
cfg.fiducial.rpa = head.fid.pos(3,:);
mri_realigned = ft_volumerealign(cfg,mri);


%And then the rest of the code to create the head model, which I believe is correct.

%segment brain from skull
cfg           = [];
cfg.output    = 'brain';
segmentedmri  = ft_volumesegment(cfg, mri_realigned);

% Build volume conduction model from geometry of brain
cfg = [];
cfg.method='singleshell';
vol = ft_prepare_headmodel(cfg, segmentedmri);

% Visualise
vol = ft_convert_units(vol, 'cm');
sens = ft_read_sens(ds{1}, 'senstype', 'meg');
figure
ft_plot_sens(sens, 'coilshape','point','style', 'r+');

hold on
ft_plot_headmodel(vol);
[cid:0A5F1B61-897A-45A3-8BFF-B7E25928C878 at cust.communityfibre.co.uk]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20230321/632a3d8d/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2023-03-21 at 7.36.36 PM.png
Type: image/png
Size: 146864 bytes
Desc: Screenshot 2023-03-21 at 7.36.36 PM.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20230321/632a3d8d/attachment-0001.png>


More information about the fieldtrip mailing list