[FieldTrip] Registration of neuromag data

Alex Williams alexanderwil2024 at my.fit.edu
Thu Nov 14 19:26:27 CET 2024


Hi there FieldTrip community,

  I was curious if anyone would be familiar with an issue I came across
within my study. I'm currently using an lcmv beamformer for source
reconstruction of several subjects within the CamCan data set using their
MEEG data. Right now, I'm currently looking back into the process of
coregistration once more. The meeg data and headshape data I have use
neuromag coordinates and I believe the coordinates of the fiducials are in
voxel-coordinates. For all of the subjects, I get a coregistered
orientation that seems to be tilted relative to the sensor array.

 I'm unsure if this would be the correct orientation based on what I've
seen from previous head model orientations. However, since I'm unfamiliar
with how the head would be oriented within a neuromag system, I was
wondering if there was any way to confirm that this orientation would be
correct or if there may be something that needs to be rectified in the code
for proper orientation.

Here is the code I used for coregistration to acquire the image above:

%% Realign Coord Sys.
function mrialign=coregistration(Path1,Path2,mriread,S,job)
addpath /Users/alexanderwil2024/MATLAB-Drive/Research/MATLAB
code/Beamformer Pipeline
cfg=[];
headshape=ft_read_headshape([Path1 Path2]);
headshape=ft_convert_coordsys(headshape,'neuromag');
vox2vox = inv(mriread.transform);
nas_voxel_mriread = ft_warp_apply(vox2vox, headshape.fid.pos(2,:),
'homogenous'); % nasion
lpa_voxel_mriread = ft_warp_apply(vox2vox, headshape.fid.pos(1,:),
'homogenous'); % Left preauricular
rpa_voxel_mriread = ft_warp_apply(vox2vox, headshape.fid.pos(3,:),
'homogenous'); % Right preauricular

cfg=[];
nas1=nas_voxel_mriread;
lpa1=lpa_voxel_mriread;
rpa1=rpa_voxel_mriread;
cfg.fiducial.nas=nas1;
cfg.fiducial.lpa=lpa1;
cfg.fiducial.rpa=rpa1;
cfg.coordsys='neuromag';
cfg.method='fiducial';
mrialign = ft_volumerealign(cfg, mriread);
ft_sourceplot([],mrialign);

cfg=[];
cfg.method='headshape';
cfg.spmversion='spm12';
cfg.headshape.headshape=headshape;
cfg.headshape.interactive = 'no';
mrialign=ft_volumerealign(cfg, mrialign);

% ********FOR VISUALIZING CO-REGISTRATION: IMPORTANT FOR FIDUCIALS!!!
% cfg=[];
% cfg.method='headshape';
% cfg.spmversion='spm12';
% cfg.headshape.headshape=headshape;
% cfg.headshape.interactive = 'yes';
% ft_volumerealign(cfg, mrialign);

cfg=[];
cfg.parameter='anatomy';
cfg.filename=['/Volumes/My Book/coreg_mri_niftis/mrialign ',S,' for job '
,job];
cfg.filetype='nifti';
ft_volumewrite(cfg,mrialign);
close all
o=1;
end
  In this code, mriread refers to the subject's raw MRI nifti data after
being read in. tably, after the first use of volumerealign within the code
to apply the fiducials from the mri nifti (mrialign = ft_volumerealign(cfg,
mriread)), I use it again to apply a headshape-based method. I obtain this
sagitally tilted positioning when using this setup:

[image: Both volumerealigns.png]

  For additional reference, if I were to only use the first instance of the
volumerealign function to apply the fiducials to mriread without using the
second instance to apply the headshape method, I would obtain this
coregistered model, which seem properly oriented but slightly removed from
the sensor array:

[image: Only fiducial volumerealign.png]
Additionally, the vox2vox transform matrix inverts mriread's transform
matrix to create the following coregistered positions. However, when the
vox2vox transform doesn't use the inverted transform (vox2vox
=mriread.transform) and applies the full code with both
volumerealign methods, it leads to a coronally tilted positioning:

[image: image.png]



-Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20241114/616a22ef/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Only fiducial volumerealign.png
Type: image/png
Size: 129047 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20241114/616a22ef/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Both volumerealigns.png
Type: image/png
Size: 128564 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20241114/616a22ef/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 143317 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20241114/616a22ef/attachment-0005.png>


More information about the fieldtrip mailing list