<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body>
<div dir="auto"><span style="font-size: 12pt;">If it helps, I preprocessed the EEG data with eeglab and converted them with eeglab2fieltrip.</span></div>
<div dir="auto">Cfg.rotate in the latest fieldtrip version does not work with any of the data I use ( files with different number of channels/eeg model).</div>
<div dir="auto">It gives no error but does not rotate.</div>
<div dir="auto">The old fieldtrip version rotates the axis but the channel position seems off anyway.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Thank you again for  your support.</div>
<div dir="auto">Elisa</div>
<div><br>
</div>
<div id="ms-outlook-mobile-signature" dir="auto">Sent from <a href="https://urldefense.com/v3/__https://aka.ms/AAb9ysg__;!!HJOPV4FYYWzcc1jazlU!9BPuMJSimL_2nwrPyFSa8MJGzLs5f9IRYosUU5sKWMEk1kr1doYITQidtlXexaR6XbrtkQwaexoA-6fdnItUUQ$">
Outlook for Android</a></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Elisa Tatti <elisatatti@msn.com><br>
<b>Sent:</b> Wednesday, March 29, 2023 12:40:46 PM<br>
<b>To:</b> FieldTrip discussion list <fieldtrip@science.ru.nl><br>
<b>Cc:</b> Schoffelen, J.M. (Jan Mathijs) <janmathijs.schoffelen@donders.ru.nl><br>
<b>Subject:</b> Re: ft_prepare_layout rotate axis does not work in the new Fieldtrip release</font>
<div> </div>
</div>
<div>
<div dir="auto" style="">Please, read my message carefully, as it provides all the details about the issue. I asked two questions, one about the latest fieldtrip version, one with the layout created with a previous version (since rotation does not work with
 the new one).</div>
<div dir="auto" style=""><br>
</div>
<div dir="auto"></div>
<div dir="auto"></div>
<div dir="auto"></div>
<div dir="auto" style=""> The figure was done with the old fieldtrip version and, despite the rotation works, the channels are not place correctly on the scalp anyway (they are all concentrated in the center of the scalp). Compare it with the layout obtained
 with eeglab.</div>
<div dir="auto" style=""><br>
</div>
<div style=""><br>
</div>
<div dir="auto" id="x_ms-outlook-mobile-signature" style="">Sent from <a href="https://urldefense.com/v3/__https://aka.ms/AAb9ysg__;!!HJOPV4FYYWzcc1jazlU!9BPuMJSimL_2nwrPyFSa8MJGzLs5f9IRYosUU5sKWMEk1kr1doYITQidtlXexaR6XbrtkQwaexoA-6fdnItUUQ$">
Outlook for Android</a>
<div id="x_mail-editor-reference-message-container" dir="auto"><br>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" style="font-size:11pt"><strong>From:</strong> fieldtrip <fieldtrip-bounces@science.ru.nl> on behalf of Schoffelen, J.M. (Jan Mathijs) via fieldtrip <fieldtrip@science.ru.nl><br>
<strong>Sent:</strong> Wednesday, March 29, 2023, 12:27 PM<br>
<strong>To:</strong> fieldtrip@science.ru.nl <fieldtrip@science.ru.nl><br>
<strong>Cc:</strong> Schoffelen, J.M. (Jan Mathijs) <janmathijs.schoffelen@donders.ru.nl><br>
<strong>Subject:</strong> Re: [FieldTrip] ft_prepare_layout rotate axis does not work in the new Fieldtrip release<br>
</div>
<br>
Hi Elisa,
<div class=""><br class="">
</div>
<div class="">Can you point us to the ‘rotation problem’ in the figure you attached? I don’t see it. Both figures have the electrodes placed in the same orientation (in the figure), relative to the ‘head’. Given that the distribution left/right is more or less
 symmetric, it seems to me that everything went according to plan. The onlly difference I see is how the positions are scaled with respect to the size of the circle. So, I don’t understand what you think is wrong. Also, you did not provide us with any additional
 details with respect to the cfg used to call ft_prepare_layout, nor what type of data you are using etc. </div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 29 Mar 2023, at 17:10, Elisa Tatti <<a href="mailto:elisatatti@msn.com" class="">elisatatti@msn.com</a>> wrote:</div>
<br class="x_Apple-interchange-newline">
<div class="">
<div id="x_divRplyFwdMsg" dir="ltr" class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<div class=""><br class="x_Apple-interchange-newline">
 </div>
</div>
<div dir="ltr" class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<div class="x_x_elementToProof" style="font-family:Arial,Helvetica,sans-serif; font-size:12pt; background-color:rgb(255,255,255)">
Dear Fieldtrip community,<span class="x_Apple-converted-space"> </span><br class="">
</div>
<div class="x_x_elementToProof" style="font-family:Arial,Helvetica,sans-serif; font-size:12pt; background-color:rgb(255,255,255)">
I am writing to ask for help with creating the channel layout using the function ft_prepare_layout. I have two questions:<br class="">
</div>
<div class="x_x_elementToProof" style="font-family:Arial,Helvetica,sans-serif; font-size:12pt; background-color:rgb(255,255,255)">
<br class="">
</div>
<div class="x_x_elementToProof" style="font-family:Arial,Helvetica,sans-serif; font-size:12pt; background-color:rgb(255,255,255)">
<ol class="">
<li class="x_x_elementToProof x_elementToProof"><span class="">In the past, I successfully used the option cfg.rotate to rotate the axis of 90 degrees due to the differences in orientation between eeglab and fieldtrip. In the latest Fieldtrip (20230118) version,
 the option cfg.rotate does not work anymore. It does not give any error and it creates the layout but it does not rotate the axis. I ran the function with cfg.rotate both as default [] (which should automatically rotate the axis) and with different rotations
 (90,180). I checked the output and it seems it is not rotating the axis at all.<span class="x_Apple-converted-space"> </span><br class="">
</span>
<div class="x_x_elementToProof x_elementToProof"><span class="x_ContentPasted1">I compared it with a previous version (20200607) (where it works perfectly) and noticed that parts of the code have been changed. Specifically, in ft_prepare_layout in Fieldtrip
 20200607 the section that rotates the axis using ft_warp_apply (lines 1291-1307, see below) in the subfunction sens2lay has been changed in Fieldtrip 20230118. I can see the function ft_warp_apply for the subfunction opto2lay but it is not there for sens2lay<span class="x_Apple-converted-space"> </span><span class="x_ContentPasted1 x_ContentPasted3">anymore</span>.
 I am unsure if that is actually what it was meant to be done and it is okay like this but may this be the reason why it does not rotate anymore?<br class="">
</span></div>
</li></ol>
<div class="x_elementToProof">Old Fieldtrip function:<span class="x_Apple-converted-space"> </span><br class="">
</div>
<div class="x_elementToProof"><br class="">
</div>
<div class="x_ContentPasted2 x_elementToProof"><span class="" style="font-size:9pt">% apply rotation, but only if viewpoint is not used specifically</span>
<div class="x_ContentPasted2"><span class="" style="font-size:9pt">if isempty(viewpoint)</span></div>
<div class="x_ContentPasted2"><span class="" style="font-size:9pt">  if isempty(rotatez)</span></div>
<div class="x_ContentPasted2"><span class="" style="font-size:9pt">    switch ft_senstype(sens)</span></div>
<div class="x_ContentPasted2"><span class="" style="font-size:9pt">      case {'ctf151', 'ctf275', 'bti148', 'bti248', 'ctf151_planar', 'ctf275_planar', 'bti148_planar', 'bti248_planar', 'yokogawa160', 'yokogawa160_planar', 'yokogawa64', 'yokogawa64_planar',
 'yokogawa440', 'yokogawa440_planar', 'magnetometer', 'meg'}</span></div>
<div class="x_ContentPasted2"><span class="" style="font-size:9pt">        rotatez = 90;</span></div>
<div class="x_ContentPasted2"><span class="" style="font-size:9pt">      case {'neuromag122', 'neuromag306'}</span></div>
<div class="x_ContentPasted2"><span class="" style="font-size:9pt">        rotatez = 0;</span></div>
<div class="x_ContentPasted2"><span class="" style="font-size:9pt">      case 'electrode'</span></div>
<div class="x_ContentPasted2"><span class="" style="font-size:9pt">        rotatez = 90;</span></div>
<div class="x_ContentPasted2"><span class="" style="font-size:9pt">      otherwise</span></div>
<div class="x_ContentPasted2"><span class="" style="font-size:9pt">        rotatez = 0;</span></div>
<div class="x_ContentPasted2"><span class="" style="font-size:9pt">    end</span></div>
<div class="x_ContentPasted2"><span class="" style="font-size:9pt">  end</span></div>
<div class="x_ContentPasted2"><span class="" style="font-size:9pt">  sens.chanpos = ft_warp_apply(rotate([0 0 rotatez]), sens.chanpos, 'homogenous');</span></div>
<span class="" style="font-size:9pt">end</span><br class="">
</div>
<div class="x_elementToProof"><br class="">
</div>
<div class="x_elementToProof">Fieldtrip 20230118</div>
<div class="x_elementToProof"><br class="">
</div>
<div class="x_ContentPasted4 x_elementToProof">
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">% apply rotation, but only if viewpoint is not used specifically</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">if isempty(viewpoint) && isempty(rotatez)</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">  if isfield(sens, 'coordsys')</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">    % the x-axis to the right of the screen and the y-axis is to the top of the screen</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">    % the nose is usually plotted toward the top of the screen</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">    sens = ft_convert_coordsys(sens, 'ras', 0);</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">  elseif isfield(sens, 'type') && startsWith(sens.type, 'ctf')</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">    sens.coordsys = 'ctf';</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">    sens = ft_convert_coordsys(sens, 'ras', 0);</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">  elseif isfield(sens, 'type') && startsWith(sens.type, 'bti')</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">    sens.coordsys = 'bti';</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">    sens = ft_convert_coordsys(sens, 'ras', 0);</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">  elseif isfield(sens, 'type') && startsWith(sens.type, '4d')</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">    sens.coordsys = '4d';</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">    sens = ft_convert_coordsys(sens, 'ras', 0);</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">  elseif isfield(sens, 'type') && startsWith(sens.type, 'yokogawa')</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">    sens.coordsys = 'yokogawa';</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">    sens = ft_convert_coordsys(sens, 'ras', 0);</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">  elseif isfield(sens, 'type') && startsWith(sens.type, 'neuromag')</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">    sens.coordsys = 'neuromag';</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">    sens = ft_convert_coordsys(sens, 'ras', 0);</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">  elseif isfield(sens, 'type') && startsWith(sens.type, 'itab')</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">    sens.coordsys = 'itab';</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">    sens = ft_convert_coordsys(sens, 'ras', 0);</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">  else</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">    ft_warning('use cfg.rotate to specify the correct rotation of the sensors');</span></div>
<div class="x_ContentPasted4"><span class="" style="font-size:9pt">  end</span></div>
<span class="" style="font-size:9pt">end</span><br class="">
</div>
<span class=""></span>
<div class="x_elementToProof"><span class=""><br class="">
</span></div>
<div class="x_elementToProof"><span class="">If anyone has information about it, please share it with the community. Thank you!</span></div>
<ol start="2" class="">
<li class="x_x_elementToProof x_elementToProof"><span class="x_x_ContentPasted2 x_x_ContentPasted0 x_ContentPasted0">Using the old Fieldtrip version, I created the layout using ft_prepare_layout and 90 degrees rotation to have the frontal channels oriented
 toward the nose. However, when I plot the channels with the function ft_plot_layout, they look too centered in the middle (see the attached image with a comparison between<span class="x_Apple-converted-space"> </span><span class="x_x_ContentPasted1 x_x_ContentPasted0">the
 EEGLAB</span><span class="x_Apple-converted-space"> </span>channel layout and the output of ft_prepare_layout. What can I do to fix them?</span></li></ol>
<div class="x_x_elementToProof">Thank you in advance for your help!</div>
<div class="x_x_elementToProof"><br class="">
</div>
<div class="x_x_elementToProof">Best.</div>
<div class="x_x_elementToProof"><br class="">
</div>
<div class="x_x_elementToProof">Elisa<br class="">
</div>
<div class="x_x_elementToProof"><br class="">
</div>
</div>
<div class="x_x_elementToProof" style="font-family:Arial,Helvetica,sans-serif; font-size:12pt; background-color:rgb(255,255,255)">
<br class="">
</div>
<div class="x_x_elementToProof" style="font-family:Arial,Helvetica,sans-serif; font-size:12pt; background-color:rgb(255,255,255)">
<br class="">
</div>
<div class="x_x_elementToProof">
<div class="" style="font-family:Arial,Helvetica,sans-serif; font-size:12pt"><br class="">
</div>
<div id="x_x_Signature" class="">
<div class="">
<div class="" style="font-family:Arial,Helvetica,sans-serif; font-size:12pt">
<div class="" style="margin-top:0px; margin-bottom:0px; text-align:start; font-family:Calibri,Arial,Helvetica,sans-serif; background-color:rgb(255,255,255)">
<font size="2" face="Arial, Helvetica, sans-serif" class=""><span class="" style="margin:0px; color:rgb(102,102,102)">Elisa Tatti, Ph.D.</span></font></div>
<div class="" style="margin-top:0px; margin-bottom:0px; text-align:start; font-family:Calibri,Arial,Helvetica,sans-serif; background-color:rgb(255,255,255)">
<font size="2" face="Arial, Helvetica, sans-serif" class=""><br class="">
</font></div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; margin:0px; text-align:start; background-color:rgb(255,255,255)">
<div class="" style="margin:0px">
<div class="" style="margin-top:0px; margin-bottom:0px"><font size="2" face="Arial, Helvetica, sans-serif" class=""><span class="" style="margin:0px; color:rgb(102,102,102)">Research Associate</span></font></div>
<div class="" style="margin-top:0px; margin-bottom:0px"><font size="2" face="Arial, Helvetica, sans-serif" class=""><span class="" style="margin:0px; color:rgb(102,102,102)">Research Foundation of the City University of New York</span></font></div>
<div class="" style="margin-top:0px; margin-bottom:0px"><font size="2" face="Arial, Helvetica, sans-serif" class=""><span class="" style="margin:0px; color:rgb(102,102,102)">CUNY, School of Medicine </span></font></div>
<div class="" style="margin-top:0px; margin-bottom:0px"><font size="2" face="Arial, Helvetica, sans-serif" class=""><span class="" style="margin:0px; color:rgb(102,102,102)">160 Convent ave</span></font></div>
<div class="" style="margin-top:0px; margin-bottom:0px"><font size="2" face="Arial, Helvetica, sans-serif" class=""><span class="" style="margin:0px; color:rgb(102,102,102)">New York City, NY, 10031 </span></font><font size="2" face="Arial, Helvetica, sans-serif" class=""><span class="" style="margin:0px; color:rgb(102,102,102)"><br class="">
</span></font></div>
<div class="" style="margin-top:0px; margin-bottom:0px"><font size="2" face="Arial, Helvetica, sans-serif" class=""><span class="" style="margin:0px; color:rgb(102,102,102)"><br class="">
</span></font></div>
<div class="" style="margin-top:0px; margin-bottom:0px"><font size="2" face="Arial, Helvetica, sans-serif" class=""><span class="" style="margin:0px; color:rgb(102,102,102)">Adjunct Assistant Professor </span></font></div>
<div class="" style="margin-top:0px; margin-bottom:0px"><font size="2" face="Arial, Helvetica, sans-serif" class=""><span class="" style="margin:0px; color:rgb(102,102,102)">College of Staten Island,</span></font></div>
<div class="" style="margin-top:0px; margin-bottom:0px"><font size="2" face="Arial, Helvetica, sans-serif" class=""><span class="" style="margin:0px; color:rgb(102,102,102)">2800 Victory Blvd, Staten Island, NY 10314 </span></font></div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px; font-family:Calibri,Helvetica,sans-serif,Helvetica,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<span class="" style="margin:0px; color:rgb(102,102,102); font-size:11pt">Tel. +1 3472043952</span></div>
</div>
</div>
<br class="">
</div>
</div>
</div>
</div>
</div>
<span id="x_cid:702901C0-9CF8-403C-98EA-ED43381F74A3"><Screen Shot 2023-03-28 at 3.27.08 PM.png></span></div>
</blockquote>
</div>
<br class="">
</div>
<br>
</div>
</div>
</div>
</body>
</html>