<div dir="ltr">Dear all, I am working with Mag4Health OPM data, We are using the polhemus system to create the headshape (which is separately co-registered with opm sensors). <div><br></div><div>Therefore, we are creating a 'headshape' structure from scratch, and trying to co-register this 'headshape' with mri (.nii format). However, when I try to do this, the polhemus cloud is ~400mm away from the mri surface, and is oriented at 90 degrees to the MRI (in the plottted figure-mri is facing MATLAB's x -axis, polhemus cloud is facing y-axis).</div><div>We have already taken steps to ensure that coordinate system/orientation is in 'neuromag' system for both polhemus and mri (+x= right, +y= anterior, <a class="gmail_plusreply" id="plusReplyChip-1">+z=superior).</a> So I am quite confused about what is going on. </div><div><br></div><div>Shared my code here below: </div><div>----------------------------------------------------------------------------------------<br>% The headshape struct in fieldtrip consiststs of the following fields: <br>%         pos: [N×3 double]  #in cm to begin with<br>%         fid: [1×1 struct] # to be left empty for now<br>%       label: {N×1 cell} <br>%    coordsys: 'neuromag'<br>%        unit: 'cm' % converted to mm before coregistration<br><br>% From the dopm_calib_coreg.m, we are importing the following fields in<br>% headshape_H2.mat file: pos [NX3], coordsys, unit. <br><br>%% Create the headsape struct<br>headshape = headshape_H2; <br><br>% add dummy labels to the polhemus points<br>headshape.label = cell(size(headshape.pos, 1),1); <br>for i = 1:size(headshape.pos, 1)<br>    headshape.label{i}= sprintf('extra_%d', i);<br>end<br><br>% check once <br>ft_plot_headshape(headshape)<br><br>%% re-align the volume <br>% re-align the volume to neuromag coordinates as a first step<br>%mark the n,l,r points, then press q to escape<br>close all force<br>cfg=[]; <br>cfg.method='interactive'; <br>cfg.coordsys='neuromag'; <br>mri_neuromag=ft_volumerealign(cfg,mri_orig);<br><br>% re-align using the headshape <br>headshape=ft_convert_units(headshape, 'mm');<br>cfg=[]; <br>cfg.method='headshape'; <br>cfg.headshape.headshape=headshape; <br>cfg.headshape.icp='yes'; <br>cfg.headshape.interactive='yes'; <br>cfg.coordsys= 'neuromag'; <br>mri_realigned=ft_volumerealign(cfg, mri_neuromag); <br>close all force<br><div><br></div></div></div>