<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=HU link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span lang=EN-GB>Dear colleagues,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>I am experiencing an issue with the ft_electroderealign.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>I would like to fit the electrode to the scalp because the initial alignment (see fieldtrip_start.png) is not optimal.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>(The attached diag.tiff is a MAT-file. You have to rename it to diag.mat before loading if you want to experiment with the data.)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>I have created a mesh of the scalp (<i>mesh</i>) and identified erroneous positions close to the edge of the FOV (<i>meshedge</i>).<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>I thought the following code should do the re-alignment:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-GB>cfg = [];<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-GB>cfg.method = 'headshape';<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-GB>cfg.warp = 'traditional';<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-GB>cfg.headshape = mesh.pos(~meshedge,:);<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-GB>elec  = ft_electroderealign(cfg, elec);<o:p></o:p></span></i></p><p class=MsoNormal><span lang=EN-GB>However, it barely moves the electrodes (see fieldtrip_traditional.png). I have also tried nonlinear warping, but it did not help.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>I have also tried manually, and by simply changing the scale of two axes (y and z) by 1.25 and shifting the electrodes backwards by 12.5mm worked (see fieldtrip_interactive.png).<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>I have ca. 200 participants, and I would prefer to have an automatic solution like the snippet above.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-GB'>Kind regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-GB'>Tibor <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-GB'><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-GB style='color:#222A35;mso-fareast-language:EN-GB'>Auer, Tibor M.D. Ph.D.<o:p></o:p></span></b></p><p class=MsoNormal><b><span lang=EN-GB style='color:#0066FF;mso-fareast-language:EN-GB'>Research Fellow<o:p></o:p></span></b></p><p class=MsoNormal><b><span lang=EN-GB style='color:#0066FF;mso-fareast-language:EN-GB'>School of Psychology, Faculty of Health and Medical Sciences</span></b><span lang=EN-GB style='color:#0066FF;mso-fareast-language:EN-GB'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-GB'>University of Surrey, Guildford GU2 7XH<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-GB'><a href="mailto:T.Auer@surrey.ac.uk"><span style='color:#0563C1'>T.Auer@surrey.ac.uk</span></a><u><span style='color:#0563C1'><o:p></o:p></span></u></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-GB'><a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2FTiborAuer&data=02%7C01%7Ct.auer%40surrey.ac.uk%7Cdb32da458c424eedef2908d7d4bd1421%7C6b902693107440aa9e21d89446a2ebb5%7C0%7C0%7C637211780868086968&sdata=zrT5%2FnGGsar14C3WartuU99tzsfLu30Peh9fuaqrAUg%3D&reserved=0"><span style='color:#0563C1'>@TiborAuer</span></a><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p></div></body></html>