<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
Hi Alex,
<div><br>
</div>
<div>Now I must confess that I am confused. Also, Konstantinos actually has pointed out - I think - the answer that you are looking for.</div>
<div><br>
</div>
<div>Let’s step away from the figures in your e-mail, and the code that you pasted in, and the mapping between executed steps and the exact figures.</div>
<div><br>
</div>
<div>if you read in an MRI file into FieldTrip, the code typically cannot determine what world coordinate system is attached to the MRI image. This is something that requires user input (e.g. by using ft_determine_coordsys, or by explicitly adding a field mri.coordsys
 to the structure, provided that you know what it is). The mri.transform matrix maps from voxel space to world space, and the inverse of this matrix clearly goes into the opposite direction.</div>
<div><br>
</div>
<div>Now, if your headshape is defined in the way I think it has been defined, i.e. the coordinates are in ’neuromag’ space, which means that the 3D coordinates of the fiducials are already in the neuromag coordinate system.</div>
<div><br>
</div>
<div>The MRI image - on the other hand - can be in any coordinate system, which is either 1) in neuromag coordinates, or 2) not. Note that we - the readers of the list - don’t necessarily know this.</div>
<div><br>
</div>
<div>If 1), then the MRI image is already in register with the headshape, so no ft_volumerealign will be needed</div>
<div><br>
</div>
<div>if 2), then a procedure that maps the headshape’s fiducials back into voxel space, using a totally wrong matrix (i.e. the inverse of matrix that goes from the MRI’s voxels to (another than neuromag) coordinate system) will yield voxel coordinates for the
 fiducials that don’t make sense.</div>
<div><br>
</div>
<div>This is exactly what Konstantinos wrote earlier today.</div>
<div><br>
</div>
<div>The solution for situation 2) is indeed to ‘manually’ define the locations of the fiducials in the mri image (using ft_volumerealign with the method ‘interactive’). This step will bring the mri in register with the coordinate system of the MEG data. Optionally,
 you can try to refine the coregistration after this step by using the ‘headshape’ method.</div>
<div><br>
</div>
<div>I hope this helps,</div>
<div>Jan-Mathijs</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>
<blockquote type="cite">
<div>On 15 Nov 2024, at 15:48, Alex Williams via fieldtrip <fieldtrip@science.ru.nl> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<div dir="ltr">
<div dir="auto">Oh I see! I truly apologize for that. I didn't catch that you were referring to the figure name in the image. Thanks so much again for clarifying again. So figure 3 (i.e. the model with the sagittal tilt) uses the inverted transform and then
 uses the resulting transformed fiducial coordinates with volumerealign's fiducial method to obtain the coregistered model within a neuromag coordinate system (mrialign). But then, it takes that obtained mrialign variable and applies the volumerealign function once
 more using the headshape method to obtain the model in figure 3. Due to using volumerealign a second time using the headshape method after the model is brought into neuromag space using the first volumerealign, would the use of the second volumerealign in
 figure 3 be necessary? I only ask because figure 4 (i.e. the model with a larger axial distance from the sensor array) also uses the inverted transform but only uses the volumerealign function once to apply the fiducials, completely eschewing the use of the
 second volumerealign that applies a headshape method.</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Fri, Nov 15, 2024, 07:31 Schoffelen, J.M. (Jan Mathijs) via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" target="_blank">fieldtrip@science.ru.nl</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>Sorry if I was unclear Alex, with ‘figure 3’ I meant the first figure in your e-mail, i.e. the one which correctly uses the inverse of the transformation matrix, to express the fiducials in voxel coordinates, and then correctly updates the mri’s transformation
 matrix.
<div><br>
</div>
<div>Best wishes,</div>
<div>Jan-Mathijs</div>
<div><br id="m_-2203616593515442559m_2505750936046952785lineBreakAtBeginningOfMessage">
<div><br>
<blockquote type="cite">
<div>On 15 Nov 2024, at 13:13, Alex Williams <<a href="mailto:alexanderwil2024@my.fit.edu" rel="noreferrer" target="_blank">alexanderwil2024@my.fit.edu</a>> wrote:</div>
<br>
<div>
<div>
<table border="0" cellspacing="0" cellpadding="0" width="100%" style="background:revert;color:revert;direction:revert;font-size:revert;height:revert;letter-spacing:revert;line-height:revert;margin:revert;opacity:revert;outline:revert;overflow:revert;padding:revert;text-align:revert;text-indent:revert;text-orientation:revert;text-overflow:revert;text-transform:revert;vertical-align:revert;white-space:revert;word-break:revert;word-spacing:revert;writing-mode:revert;zoom:revert;border:0px;display:table;width:100%;table-layout:fixed;float:none;border-spacing:0px" align="left">
<tbody style="background:revert;border:revert;color:revert;direction:revert;font-size:revert;height:revert;letter-spacing:revert;line-height:revert;margin:revert;opacity:revert;outline:revert;overflow:revert;padding:revert;table-layout:revert;text-align:revert;text-indent:revert;text-orientation:revert;text-overflow:revert;text-transform:revert;vertical-align:revert;white-space:revert;width:revert;word-break:revert;word-spacing:revert;writing-mode:revert;zoom:revert;display:block">
<tr style="background:revert;border:revert;color:revert;direction:revert;display:revert;font-size:revert;height:revert;letter-spacing:revert;line-height:revert;margin:revert;opacity:revert;outline:revert;overflow:revert;padding:revert;table-layout:revert;text-align:revert;text-indent:revert;text-orientation:revert;text-overflow:revert;text-transform:revert;vertical-align:revert;white-space:revert;width:revert;word-break:revert;word-spacing:revert;writing-mode:revert;zoom:revert">
<td valign="middle" width="1px" bgcolor="#A6A6A6" cellpadding="7px 2px 7px 2px" style="background-image:revert;background-position:revert;background-size:revert;background-repeat:revert;background-origin:revert;background-clip:revert;border:revert;color:revert;direction:revert;display:revert;font-size:revert;height:revert;letter-spacing:revert;line-height:revert;margin:revert;opacity:revert;outline:revert;overflow:revert;table-layout:revert;text-align:revert;text-indent:revert;text-orientation:revert;text-overflow:revert;text-transform:revert;vertical-align:revert;white-space:revert;word-break:revert;word-spacing:revert;writing-mode:revert;zoom:revert;padding:7px 2px;background-color:rgb(166,166,166);width:0px">
</td>
<td valign="middle" width="100%" bgcolor="#EAEAEA" cellpadding="7px 5px 7px 15px" style="background-image:revert;background-position:revert;background-size:revert;background-repeat:revert;background-origin:revert;background-clip:revert;border:revert;direction:revert;display:revert;height:revert;letter-spacing:revert;line-height:revert;margin:revert;opacity:revert;outline:revert;overflow:revert;table-layout:revert;text-indent:revert;text-orientation:revert;text-overflow:revert;text-transform:revert;vertical-align:revert;white-space:revert;word-break:revert;word-spacing:revert;writing-mode:revert;zoom:revert;width:100%;background-color:rgb(234,234,234);padding:7px 5px 7px 15px;font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:12px;font-weight:normal;color:rgb(33,33,33);text-align:left">
<div style="background:revert;border:revert;color:revert;direction:revert;display:revert;font-size:revert;height:revert;letter-spacing:revert;line-height:revert;margin:revert;opacity:revert;outline:revert;overflow:revert;padding:revert;table-layout:revert;text-align:revert;text-indent:revert;text-orientation:revert;text-overflow:revert;text-transform:revert;vertical-align:revert;white-space:revert;width:revert;word-break:revert;word-spacing:revert;writing-mode:revert;zoom:revert">
You don't often get email from <a href="mailto:alexanderwil2024@my.fit.edu" rel="noreferrer" target="_blank">
alexanderwil2024@my.fit.edu</a>. <a href="https://aka.ms/LearnAboutSenderIdentification" style="background:revert;color:revert;direction:revert;display:revert;font-size:revert;opacity:revert" rel="noreferrer" target="_blank">
Learn why this is important</a> </div>
</td>
<td valign="middle" align="left" width="75px" bgcolor="#EAEAEA" cellpadding="7px 5px 7px 5px" style="background-image:revert;background-position:revert;background-size:revert;background-repeat:revert;background-origin:revert;background-clip:revert;border:revert;direction:revert;display:revert;height:revert;letter-spacing:revert;line-height:revert;margin:revert;opacity:revert;outline:revert;overflow:revert;table-layout:revert;text-indent:revert;text-orientation:revert;text-overflow:revert;text-transform:revert;vertical-align:revert;white-space:revert;word-break:revert;word-spacing:revert;writing-mode:revert;zoom:revert;width:75px;background-color:rgb(234,234,234);padding:7px 5px;font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:12px;font-weight:normal;color:rgb(33,33,33);text-align:left">
</td>
</tr>
</tbody>
</table>
<div>
<div dir="auto">
<div>Hi Jan-Mathijs,
<div dir="auto"><br>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">   Thanks so much for your response! So the third image uses both volumerealigns but uses a non-inverted transform from mriread. The only image that uses only one call to volumerealign applying the fiducial method is image two, but it applies
 an inverted transform from mriread. But was hoping to confirm that the third image would be the best for coregistration in this case. </div>
<div dir="auto"><br>
</div>
<div dir="auto">-Alex</div>
<div dir="auto"><br>
</div>
<br>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Fri, Nov 15, 2024, 05:32 Schoffelen, J.M. (Jan Mathijs) via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" rel="noreferrer" target="_blank">fieldtrip@science.ru.nl</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>Hi Alex,
<div><br>
</div>
<div>To be honest, I have the impression that what you plotted in ‘figure 3’ makes sense.</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div><br>
</div>
<div>Best wishes,</div>
<div>Jan-Mathijs<br id="m_-2203616593515442559m_2505750936046952785m_8005329100694820415lineBreakAtBeginningOfMessage">
<div><br>
<blockquote type="cite">
<div>On 14 Nov 2024, at 19:26, Alex Williams via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" rel="noreferrer noreferrer" target="_blank">fieldtrip@science.ru.nl</a>> wrote:</div>
<br>
<div>
<div dir="ltr">Hi there FieldTrip community,
<div><br>
</div>
<div>  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.</div>
<div><br>
</div>
<div> 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. </div>
<div><br>
</div>
<div>Here is the code I used for coregistration to acquire the image above:<br>
<br>
<div style="padding:30px">
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap"><span style="color:rgb(0,128,19)">%% Realign Coord Sys.</span></span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
</div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
</div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap"><span style="color:rgb(14,0,255)">function </span>
mrialign=coregistration(Path1,Path2,mriread,S,job)</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
</div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">addpath <span style="color:rgb(167,9,245)">/Users/alexanderwil2024/MATLAB-Drive/Research/MATLAB code/Beamformer Pipeline</span></span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
</div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">cfg=[];</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">headshape=ft_read_headshape([Path1 Path2]);</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">headshape=ft_convert_coordsys(headshape,<span style="color:rgb(167,9,245)">'neuromag'</span>);</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
</div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
</div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">vox2vox = inv(mriread.transform);</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">nas_voxel_mriread = ft_warp_apply(vox2vox, headshape.fid.pos(2,:),
<span style="color:rgb(167,9,245)">'homogenous'</span>); <span style="color:rgb(0,128,19)">
% nasion</span></span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">lpa_voxel_mriread = ft_warp_apply(vox2vox, headshape.fid.pos(1,:),
<span style="color:rgb(167,9,245)">'homogenous'</span>); <span style="color:rgb(0,128,19)">
% Left preauricular</span></span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">rpa_voxel_mriread = ft_warp_apply(vox2vox, headshape.fid.pos(3,:),
<span style="color:rgb(167,9,245)">'homogenous'</span>); <span style="color:rgb(0,128,19)">
% Right preauricular</span></span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
</div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
</div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
</div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap"><br>
</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">cfg=[];</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">nas1=nas_voxel_mriread; </span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">lpa1=lpa_voxel_mriread; </span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">rpa1=rpa_voxel_mriread;</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">cfg.fiducial.nas=nas1; </span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">cfg.fiducial.lpa=lpa1;</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">cfg.fiducial.rpa=rpa1; </span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">cfg.coordsys=<span style="color:rgb(167,9,245)">'neuromag'</span>;</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">cfg.method=<span style="color:rgb(167,9,245)">'fiducial'</span>;</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">mrialign = ft_volumerealign(cfg, mriread);</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">ft_sourceplot([],mrialign);</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap"><br>
</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
</div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">cfg=[];</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">cfg.method=<span style="color:rgb(167,9,245)">'headshape'</span>;</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">cfg.spmversion=<span style="color:rgb(167,9,245)">'spm12'</span>;</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">cfg.headshape.headshape=headshape;</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">cfg.headshape.interactive = <span style="color:rgb(167,9,245)">
'no'</span>;</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">mrialign=ft_volumerealign(cfg, mrialign);</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap"><br>
</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
</div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
</div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap"><span style="color:rgb(0,128,19)">% ********FOR VISUALIZING CO-REGISTRATION: IMPORTANT FOR FIDUCIALS!!!</span></span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap"><span style="color:rgb(0,128,19)">% cfg=[];</span></span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap"><span style="color:rgb(0,128,19)">% cfg.method='headshape';</span></span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap"><span style="color:rgb(0,128,19)">% cfg.spmversion='spm12';</span></span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap"><span style="color:rgb(0,128,19)">% cfg.headshape.headshape=headshape;</span></span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap"><span style="color:rgb(0,128,19)">% cfg.headshape.interactive = 'yes';</span></span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap"><span style="color:rgb(0,128,19)">% ft_volumerealign(cfg, mrialign);</span></span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap"><span style="color:rgb(0,128,19)"><br>
</span></span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
</div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
</div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
</div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">cfg=[];</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">cfg.parameter=<span style="color:rgb(167,9,245)">'anatomy'</span>;</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">cfg.filename=[<span style="color:rgb(167,9,245)">'/Volumes/My Book/coreg_mri_niftis/mrialign '</span>,S,<span style="color:rgb(167,9,245)">' for job '</span>,job];</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">cfg.filetype=<span style="color:rgb(167,9,245)">'nifti'</span>;</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">ft_volumewrite(cfg,mrialign);</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
</div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
</div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">close <span style="color:rgb(167,9,245)">all</span></span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap">o=1;</span></div>
<div style="font-size:13px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre-wrap"><span style="color:rgb(14,0,255)">end</span></span></div>
</div>
  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:</div>
<div><br>
</div>
<div><span id="m_-2203616593515442559m_2505750936046952785m_8005329100694820415cid:ii_m3hm5z504"><Both volumerealigns.png></span><br>
</div>
<div><br>
</div>
<div>  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:<br>
<br>
<span id="m_-2203616593515442559m_2505750936046952785m_8005329100694820415cid:ii_m3hlls3j3"><Only fiducial volumerealign.png></span></div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div>
<div>
<blockquote type="cite">
<div>
<div dir="ltr">
<div><br>
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:<br>
<br>
<span id="m_-2203616593515442559m_2505750936046952785m_8005329100694820415cid:ii_m3hmjvov5"><image.png></span><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>-Alex</div>
<div><br>
</div>
</div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cc48db74617f141790fb808dd05930a0b%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638672851280232142%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=7JZEWoba6HU53P9Qv5Eis6i8bzon3ZU0zXKv5JGfj6U%3D&reserved=0" originalsrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" shash="LYo/cujk5gHv5dQkOsRbS/c/gOeGaMRO1f8vl7jDarAZC+AlFp+ZIcOulsKUQqhimLDPnnX1HnQrvqqhJFEkpWQXiz6MPTvYfwLiNcXJaQvAMDIaZdcTyMImG3UhP71KzdmuWNuOXSCgPT3dOTs47uMND0+u/QUfoGOTElQamns=" originalsrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" shash="nsqHuI+BFEXPeklG0Q01EkVft2ncWV1i+WC4sIJK/eq/R2XByklCof83zQRjFuhFKM+nPjVx+dEjGcCUeJKO5wYJQaJlSEC1xXdX/m2iww8Wk+qiSyq2ARmaX6XOBclqbmByYVTBzuRer/flX2cWHVD//fmi+SBTHCX0OldIL7k=" rel="noreferrer noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cc48db74617f141790fb808dd05930a0b%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638672851280388392%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=5y3gsNkFbGjylm%2BiGdiqXmE9%2FV0WAmHcXdm8ye6fxgk%3D&reserved=0" originalsrc="https://doi.org/10.1371/journal.pcbi.1002202" shash="UTSt9yaSfOaCULpdk0RH9Py3zNQ5djMmN0my+5k1N3HfRakvNrtz/GwmzMSVdEiM/ALZ/w6Q5OSZ9p/61cYQJNjG2yaCSs7ii7TzSIq9zbuhYNr5AMHnYJlK0Yzn41qevzIUFjnK+WTeY53m2tkPb3GGOiZ1CsxmpgH8FYv4P3w=" originalsrc="https://doi.org/10.1371/journal.pcbi.1002202" shash="N9babwZqSAJNXXvx9D+b+yVjp3EXbRtIRU7bFAnMnWQOsg5x6NpaBkwzpHbHiWnBs5j/ZzypiWFLri2aJpemoT0Kmlah0PivKJ9+Ns4etJFe0wxJDFpjQJB8KLq5Tm+SHY8ptpdxQj4wDJpwfOWXG2WhwlH1uXUZoxuS/Nb67gQ=" rel="noreferrer noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cc48db74617f141790fb808dd05930a0b%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638672851280388392%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=r26oN6RwTYy7jVCmlJyMdw%2BfWh%2B%2FrvqvnV%2BfUebdXHM%3D&reserved=0" originalsrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" shash="HbUi2C6wScS7aw9Vng8DBRHxxz/Q0OzLtWFPX33rsgeqD+P2hn0P8U83hG7OT4/rgKKIPfHEI+xcDk/mh43lUiUYG6u8Q7meQPPB3s1juvo+QmwDhSlKBLJLgJ3HVKWhuRv2NWJiFjMFwlWLCvzAw2axwUtLYsgVJx+z221MTEI=" originalsrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" shash="kDLoIO0CfS01zMFEeQVSA3MwuVl2gqOjkMhSsIW74Yofak0MNuVgb63hhRxzxh01R+Yij+xB0fLLoyeQP5IektdGtrwxxVIP2A5x+6EQPGLzBN1xo/C2/80dZGDwuTSFAK71vHxR89vGiKGVHQMTRVzUOhsuH8FDmEtll3OIQ7Y=" rel="noreferrer noreferrer noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cc48db74617f141790fb808dd05930a0b%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638672851280388392%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=5y3gsNkFbGjylm%2BiGdiqXmE9%2FV0WAmHcXdm8ye6fxgk%3D&reserved=0" originalsrc="https://doi.org/10.1371/journal.pcbi.1002202" shash="UTSt9yaSfOaCULpdk0RH9Py3zNQ5djMmN0my+5k1N3HfRakvNrtz/GwmzMSVdEiM/ALZ/w6Q5OSZ9p/61cYQJNjG2yaCSs7ii7TzSIq9zbuhYNr5AMHnYJlK0Yzn41qevzIUFjnK+WTeY53m2tkPb3GGOiZ1CsxmpgH8FYv4P3w=" originalsrc="https://doi.org/10.1371/journal.pcbi.1002202" shash="QZ55tz93k0fZVCF9utLcS3gn5PclgnE/ulpOOCqu0DD0YSpn9PbKKAB/60RqjDxaB8GdNaZqLUX0ul10WYi0O+6at2OnAm6lmCC00uFZuj3hPCVMuUHpq7Bl2gGMdsUfvYx4jPb3eInEI6ycPdKq7lSMSkHH5vVysug6a5rKKM0=" rel="noreferrer noreferrer noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cc48db74617f141790fb808dd05930a0b%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638672851280544705%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=5liniOtS%2FIcG4LuzAegGQrFZfTN9F0ygeyS%2BPIuBpgY%3D&reserved=0" originalsrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" shash="X/Q80fqiXItV/qOoMML0q4ewCZgpqYV14KG2A0b/Jm7X+Hv6krnlyA0L1m44wJ/9oTyVlEfL1Q+rViSu2go+6eqUW4e492i49XXOpGV1Qzq4cJMCHz/LJtTNDlHPeWppjKANgrJhgBMJgvcw1rUbpFhDQzHlNSyPWdERmEVqIlM=" originalsrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" shash="htCVEkiLEGvnzVIoYQDXY6fAZ88xExJP0X2VTdUm6g1bVp/vSdl1WSRLrM6CYLO5IJlKph7gIGri5Od+zhXD/LQtm6iCmkgIqe6SXh1WsfdrVPosEk0mNk0D0/x/pdGnVDzHNqFlQ+dwoHznLqcsGXqztLfWPrU671w8B2H3Zcc=" rel="noreferrer noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cc48db74617f141790fb808dd05930a0b%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638672851280544705%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=Rrr%2FFHuMRlYrrRfSkZ9nOVxiXZ9zLrM7JXmKqkskw7w%3D&reserved=0" originalsrc="https://doi.org/10.1371/journal.pcbi.1002202" shash="koRVSGXUnmGY8+dERrHA1R1CBplNs82Im5mJRtEDsyOcG88uwX6xgmB+/vZx/cInXs4c9xSv7y9BzXHMYcQfKIV95IrRP+c+4j3uuyPLoR2FefOViXjM+tS/DPeP5hYmoRpqsg0Pk/anuWF1AM5onuzTtDAmEmZLWtH7f2ba/lc=" originalsrc="https://doi.org/10.1371/journal.pcbi.1002202" shash="vJyIJC2vg4Op4GdjU8KY4Rwj5S9Ia3HIFHmpyHDccVWmasu3LML5BGFbyRKv7yYl/z0o9G63iR6eEWXp4UazjZSCQyomfF7lzG4fEktHjvj0vOeb6DeEJBXdbD2lUPGOkkgT0VrXqVY6KMoHJmLzbdQMIrFcBrblzmOnfwlcUu8=" rel="noreferrer noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote>
</div>
_______________________________________________<br>
fieldtrip mailing list<br>
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<br>
https://doi.org/10.1371/journal.pcbi.1002202<br>
</div>
</blockquote>
</div>
<br>
</div>
</body>
</html>