[FieldTrip] Registration of neuromag data

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Fri Nov 15 11:30:32 CET 2024


Hi Alex,

To be honest, I have the impression that what you plotted in ‘figure 3’ makes sense.

The other ones don’t make sense, because the sensors are expressed in neuromag space (I assume) so the ‘brain’ needs to be brought into neuromag space as well, which is what you do with your first call to ft_volumerealign. Unless I am missing something.


Best wishes,
Jan-Mathijs

On 14 Nov 2024, at 19:26, Alex Williams via fieldtrip <fieldtrip at science.ru.nl> wrote:

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:

<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:

<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.png>



-Alex

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20241115/04dd438a/attachment.htm>


More information about the fieldtrip mailing list