<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Dear FieldTrip Community,</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">I am writing from the University of Barcelona, attempting to implement EEG source reconstruction
 methods in my PhD project. </span></div>
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">I am experiencing some issues that neither the tutorials themselves nor the FAQs seem
 to help troubleshooting. I am therefore reaching out seeking for some useful hints or users that faced and overcame similar problems.</span></div>
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);"><br>
</span></div>
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">What I am trying to do:</span></div>
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">source localizing EEG activity through beamforming (DICS) making use of
<u>digitized 3D electrodes</u> location (Polhemus Fastrak) co-registered with <u>
individual MRI.</u></span></div>
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);"><br>
</span></div>
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">What issues I am experiencing:</span></div>
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);"><br>
</span></div>
<ol start="1" data-editing-info="{"orderedStyleType":2,"unorderedStyleType":1}" data-listchain="__List_Chain_1252" style="margin-top: 0px; margin-bottom: 0px;">
<li style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0); list-style-type: "1- ";">
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);"><b>alignment of the individual MRI to a common coordinate system</b> using fieldtrip
 function: using ft_volumerealing and manually marking relevant landmarks seem to effectively generate a transformation matrix and produce a partially aligned output; however, when I check the quality of the alignment, I can still see the head twisted (transversal
 view), reflecting (I assume) the position of the head in the scan. This twisting seems to be normalized only by ft_volumereslice, which however inclines forward the MRI in the sagittal view. </span></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0); list-style-type: "1- ";">
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">Why does this happen? Isn't the realignment step supposed adjust rotation and any other
 geometrical positioning related issues? Can we avoid the forward inclination produced by ft_volumereslice while still obtaining isometric voxels? </span></div>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0); list-style-type: "1- ";">
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">here's the code I used (note that it doesn't matter which landmarks and coord sys I
 choose, the problem persists) </span></div>
</div>
</li><ol start="1" style="margin-top: 0px; margin-bottom: 0px; list-style-type: lower-alpha;">
<li style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0); display: block;">
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">cfg          = [];</span></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<div><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">cfg.method   = 'interactive';</span></div>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">cfg.coordsys = 'ctf';</span></div>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">mri_aligned_fiducials = ft_volumerealign(cfg, mri);</span></div>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);"><br>
</span></div>
</div>
</li></ol>
<li style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0); list-style-type: "2- ";">
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);"><b>Alignement affination with head shape of the subject:</b> as suggested by some tutorials
 (i.e., <a href="https://www.fieldtriptoolbox.org/workshop/oslo2019/forward_modeling/" id="LPlnk887797" class="OWAAutoLink">
https://www.fieldtriptoolbox.org/workshop/oslo2019/forward_modeling/</a>)  I am trying to refine the alignment of the individual MRI (in order to improve the later co-registration with the electrodes) using the head shape points of the subject collected through
 the Polhemus. However, when I try this alignment, the head shape defined by the collected head points results way bigger and disproportioned as compared to the head shape generated by fieldtrip from the subject's MRI (I guess it'd correspond to the mesh of
 the scalp). Likewise, the position of the fiducials (e.g., nasion, l/r tragus) results challengingly inconsistent. This problem shows up also when later on I try to co-register the electrodes with the triangulated mesh of the scalp based on fiducials or manually,
 which as you can imagine does not provide a reliable accuracy. It seems the only way to overcome this aspect is changing the scaling of the MRI in the manual adjustment, which however leads to a loss in proportion consistency between x, y and z. Any idea of
 why this happens and how to find an effective solution? Here's the codes I tried to use</span></div>
</li></ol>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
           </div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
           % Alignment of MRI to headshape</div>
<div class="elementToProof" style="line-height: 1.2; margin-right: 80px; margin-left: 80px;">
<span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">cfg                                       = [];</span></div>
<div style="line-height: 1.2; margin-right: 80px; margin-left: 80px;"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">cfg.method                              =
 'headshape';</span></div>
<div style="line-height: 1.2; margin-right: 80px; margin-left: 80px;"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">cfg.headshape.headshape        = head;</span></div>
<div class="elementToProof" style="line-height: 1.2; margin-right: 80px; margin-left: 80px;">
<span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">cfg.coordsys                         = 'ctf';</span></div>
<div class="elementToProof" style="line-height: 1.2; margin-right: 80px; margin-left: 80px;">
<span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">cfg.headshape.icp                 = 'no';  % (automatic iteration leads to catastrophic results)</span></div>
<div class="elementToProof" style="line-height: 1.2; margin-right: 80px; margin-left: 80px;">
<span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">mri_aligned_headshape               = ft_volumerealign(cfg, mri_aligned_fiducials);</span></div>
<div class="elementToProof" style="line-height: 1.2; margin-right: 80px; margin-left: 80px;">
<span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);"><br>
</span></div>
<div class="elementToProof" style="line-height: 1.2; margin-right: 80px; margin-left: 80px;">
<span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">% Alignment of elec with headmodel based on fiducials (nasion, lpa and rpa - which are actually left and right traguses
 in both structures) </span></div>
<div class="elementToProof" style="margin-right: 80px; margin-left: 80px;"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 14.6667px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">cfg
           = [];</span></div>
<div class="elementToProof" style="margin-right: 80px; margin-left: 80px;"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">cfg.method     = 'fiducial';</span></div>
<div class="elementToProof" style="margin-right: 80px; margin-left: 80px;"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">cfg.target      = elec_mri; % ( this
 are manually pointed fiducials from the 'mri_realinged_headshape'</span></div>
<div class="elementToProof" style="margin-right: 80px; margin-left: 80px;"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">cfg.elec             = elec;</span></div>
<div class="elementToProof" style="margin-right: 80px; margin-left: 80px;"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">cfg.fiducial      = {'NAS', 'LPA', 'RPA'};</span></div>
<div style="margin-right: 80px; margin-left: 80px;"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">cfg.feedback = 'yes';</span></div>
<div class="elementToProof" style="margin-right: 80px; margin-left: 80px;"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">elec_realigned       = ft_electroderealign(cfg);</span></div>
<div class="elementToProof" style="margin-right: 40px; margin-left: 40px;"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);"><br>
</span></div>
<div id="Signature">
<ol start="3" data-editing-info="{"orderedStyleType":2,"unorderedStyleType":1}" data-listchain="__List_Chain_1252" style="margin-top: 0px; margin-bottom: 0px;">
<li style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: black; list-style-type: "3- ";">
<p style="background-color: rgb(255, 255, 255); margin: 0cm; font-family: Calibri, sans-serif; font-size: 11pt;">
<span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; color: black;"><b>Relevant artifacts on the headmodel scalp mesh:</b> many of the individual MRIs I am using are collected with the subject wearing digital
 goggles (part of active tasks fMRI sessions). Therefore, when I compute segmentation and mesh for the headmodel, the goggle shape results embedded in the scalp mesh.
<u>May you know if this can cause issue with the later on computation of the forward model and of the inverse solution, although there are not electrodes placed on the goggle area?</u> Actually I would need to exclude from the analysis the inferior and lateral
 electrodes, but it seems to me a more straighforward solution than using ft_defacevolume or ft_defacemesh, which based on my experience are flawly, not user-friendly, subjected to many errors and notsistematic (likewise for correcting parameters as cfg.scalpthreshold
 or cfg.scalpsmooth in ft_volumesegment). </span></p>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: black; list-style-type: "3- ";">
<p style="background-color: rgb(255, 255, 255); margin: 0cm; font-family: Calibri, sans-serif; font-size: 11pt;">
<span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; color: black;">If the answer to my question is yes, how would you suggest to troubleshoot the issue? Would it be better for me to use other MRI processing
 tools to exclude goggles with a more efficient mask setting (e.g., manual drawing)? </span></p>
</div>
</li></ol>
<p style="background-color: rgb(255, 255, 255); margin: 0cm; font-family: Calibri, sans-serif; font-size: 11pt; color: black;">
<span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;"><br>
</span></p>
<p style="background-color: rgb(255, 255, 255); margin: 0cm;"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: black;">I've been struggling for a while already, so that I would
 really appreciate any type of suggestion, a direct solution or  sources I can consult, whichever they may be!</span></p>
<p style="background-color: rgb(255, 255, 255); margin: 0cm;"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: black;"><br>
</span></p>
<p style="background-color: rgb(255, 255, 255); margin: 0cm;"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: black;">Your time and attention are very much appreciated.</span></p>
<p style="background-color: rgb(255, 255, 255); margin: 0cm;"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: black;">Best of luck with your work,</span></p>
<p style="background-color: rgb(255, 255, 255); margin: 0cm;"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: black;">Regards</span></p>
<p style="background-color: rgb(255, 255, 255); margin: 0cm; font-family: Calibri, sans-serif; font-size: 11pt;">
<span style="font-size: 10.5pt; color: black;"><b><br>
</b></span></p>
<p style="background-color: rgb(255, 255, 255); margin: 0cm; font-family: Calibri, sans-serif; font-size: 11pt;">
<span style="font-size: 10.5pt; color: black;"><b>Enrico Sozza</b></span><span style="font-size: 10pt; color: black;">,</span><span style="color: black;"> </span><span style="font-size: 10pt; color: black;"><i>PhD Student</i></span></p>
<p style="background-color: rgb(255, 255, 255); margin: 0cm; font-family: Calibri, sans-serif; font-size: 11pt;">
<span style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 9pt; color: rgb(0, 0, 0);">Brainlab – Cognitive Neuroscience Research Group</span></p>
<p style="background-color: rgb(255, 255, 255); margin: 0cm; font-family: Calibri, sans-serif; font-size: 11pt;">
<span style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 9pt; color: rgb(0, 0, 0);">Department of Clinical Psychology and Psychobiology</span></p>
<p style="background-color: rgb(255, 255, 255); margin: 0cm; font-family: Calibri, sans-serif; font-size: 11pt;">
<span style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 9pt; color: rgb(0, 0, 0);">Institute of Neurosciences</span></p>
<p style="background-color: rgb(255, 255, 255); margin: 0cm; font-family: Calibri, sans-serif; font-size: 11pt;">
<span style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 9pt; color: rgb(0, 0, 0);">University of Barcelona</span></p>
<p style="background-color: rgb(255, 255, 255); margin: 0cm; font-family: Calibri, sans-serif; font-size: 11pt;">
<span style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 9pt; color: rgb(0, 0, 0);">P. Vall d'Hebron 171, 08035 Barcelona, Catalonia-Spain</span><span style="font-family: "Calibri Light", sans-serif; font-size: 9pt; color: rgb(102, 102, 102);"><br>
</span><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 9pt; color: rgb(0, 0, 0);">Tel: +34 933 125 058 – Fax: +24 934 021 584</span></p>
<p style="background-color: rgb(255, 255, 255); margin: 0cm; font-family: Calibri, sans-serif; font-size: 11pt;">
<span style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 9pt; color: rgb(0, 0, 0);"><a href="http://www.ub.edu/brainlab" target="_blank" id="OWAa5b2a4d3-0dcd-a12c-bc46-f14450b7d4d0" class="OWAAutoLink" style="color: rgb(0, 0, 0); margin: 0px;">http://www.ub.edu/brainlab</a></span></p>
<p style="background-color: rgb(255, 255, 255); margin: 0cm; font-family: Calibri, sans-serif; font-size: 11pt;">
<span style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 9pt; color: rgb(0, 0, 0);"><a href="http://www.neurociencies.ub.edu/" id="OWA56ed576e-62c0-6d44-33b3-30853df8ae12" class="OWAAutoLink" style="color: rgb(0, 0, 0); margin: 0px;">http://www.neurociencies.ub.edu</a></span></p>
</div>
<br>
<br>
<font color="#999999" size="1" face="Arial">Aquest missatge, i els fitxers adjunts que hi pugui haver, pot contenir informació confidencial o protegida legalment i s’adreça exclusivament a la persona o entitat destinatària. Si no consteu com a destinatari final
 o no teniu l’encàrrec de rebre’l, no esteu autoritzat a llegir-lo, retenir-lo, modificar-lo, distribuir-lo, copiar-lo ni a revelar-ne el contingut. Si l’heu rebut per error, informeu-ne el remitent i elimineu del sistema tant el missatge com els fitxers adjunts
 que hi pugui haver.<br>
<br>
Este mensaje, y los ficheros adjuntos que pueda incluir, puede contener información confidencial o legalmente protegida y está exclusivamente dirigido a la persona o entidad destinataria. Si usted no consta como destinatario final ni es la persona encargada
 de recibirlo, no está autorizado a leerlo, retenerlo, modificarlo, distribuirlo o copiarlo, ni a revelar su contenido. Si lo ha recibido por error, informe de ello al remitente y elimine del sistema tanto el mensaje como los ficheros adjuntos que pueda contener.<br>
<br>
This email message and any attachments it carries may contain confidential or legally protected material and are intended solely for the individual or organization to whom they are addressed. If you are not the intended recipient of this message or the person
 responsible for processing it, then you are not authorized to read, save, modify, send, copy or disclose any part of it. If you have received the message by mistake, please inform the sender of this and eliminate the message and any attachments it carries
 from your account.</font>
<p></p>
</body>
</html>