<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div id="divRplyFwdMsg" dir="ltr"><br>
<div> </div>
</div>
<div dir="ltr">
<div class="x_elementToProof" style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Dear Fieldtrip community, <br>
</div>
<div class="x_elementToProof" style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); 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>
</div>
<div class="x_elementToProof" style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div class="x_elementToProof" style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<ol>
<li class="x_elementToProof elementToProof"><span>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. <br>
</span>
<div class="x_elementToProof elementToProof" style=""><span class="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="ContentPasted1 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>
</span></div>
</li></ol>
<div class="elementToProof">Old Fieldtrip function: <br>
</div>
<div class="elementToProof"><br>
</div>
<div class="elementToProof ContentPasted2"><span style="font-size: 9pt;">% apply rotation, but only if viewpoint is not used specifically</span>
<div class="ContentPasted2"><span style="font-size: 9pt;">if isempty(viewpoint)</span></div>
<div class="ContentPasted2"><span style="font-size: 9pt;">  if isempty(rotatez)</span></div>
<div class="ContentPasted2"><span style="font-size: 9pt;">    switch ft_senstype(sens)</span></div>
<div class="ContentPasted2"><span 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="ContentPasted2"><span style="font-size: 9pt;">        rotatez = 90;</span></div>
<div class="ContentPasted2"><span style="font-size: 9pt;">      case {'neuromag122', 'neuromag306'}</span></div>
<div class="ContentPasted2"><span style="font-size: 9pt;">        rotatez = 0;</span></div>
<div class="ContentPasted2"><span style="font-size: 9pt;">      case 'electrode'</span></div>
<div class="ContentPasted2"><span style="font-size: 9pt;">        rotatez = 90;</span></div>
<div class="ContentPasted2"><span style="font-size: 9pt;">      otherwise</span></div>
<div class="ContentPasted2"><span style="font-size: 9pt;">        rotatez = 0;</span></div>
<div class="ContentPasted2"><span style="font-size: 9pt;">    end</span></div>
<div class="ContentPasted2"><span style="font-size: 9pt;">  end</span></div>
<div class="ContentPasted2"><span style="font-size: 9pt;">  sens.chanpos = ft_warp_apply(rotate([0 0 rotatez]), sens.chanpos, 'homogenous');</span></div>
<span style="font-size: 9pt;">end</span><br>
</div>
<div class="elementToProof"><br>
</div>
<div class="elementToProof">Fieldtrip 20230118</div>
<div class="elementToProof"><br>
</div>
<div class="elementToProof ContentPasted4">
<div class="ContentPasted4"><span style="font-size: 9pt;">% apply rotation, but only if viewpoint is not used specifically</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">if isempty(viewpoint) && isempty(rotatez)</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">  if isfield(sens, 'coordsys')</span></div>
<div class="ContentPasted4"><span 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="ContentPasted4"><span style="font-size: 9pt;">    % the nose is usually plotted toward the top of the screen</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">    sens = ft_convert_coordsys(sens, 'ras', 0);</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">  elseif isfield(sens, 'type') && startsWith(sens.type, 'ctf')</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">    sens.coordsys = 'ctf';</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">    sens = ft_convert_coordsys(sens, 'ras', 0);</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">  elseif isfield(sens, 'type') && startsWith(sens.type, 'bti')</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">    sens.coordsys = 'bti';</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">    sens = ft_convert_coordsys(sens, 'ras', 0);</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">  elseif isfield(sens, 'type') && startsWith(sens.type, '4d')</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">    sens.coordsys = '4d';</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">    sens = ft_convert_coordsys(sens, 'ras', 0);</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">  elseif isfield(sens, 'type') && startsWith(sens.type, 'yokogawa')</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">    sens.coordsys = 'yokogawa';</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">    sens = ft_convert_coordsys(sens, 'ras', 0);</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">  elseif isfield(sens, 'type') && startsWith(sens.type, 'neuromag')</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">    sens.coordsys = 'neuromag';</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">    sens = ft_convert_coordsys(sens, 'ras', 0);</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">  elseif isfield(sens, 'type') && startsWith(sens.type, 'itab')</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">    sens.coordsys = 'itab';</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">    sens = ft_convert_coordsys(sens, 'ras', 0);</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">  else</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">    ft_warning('use cfg.rotate to specify the correct rotation of the sensors');</span></div>
<div class="ContentPasted4"><span style="font-size: 9pt;">  end</span></div>
<span style="font-size: 9pt;">end</span><br>
</div>
<span></span>
<div class="elementToProof"><span><br>
</span></div>
<div class="elementToProof"><span>If anyone has information about it, please share it with the community. Thank you!</span></div>
<ol start="2">
<li class="x_elementToProof elementToProof"><span class="x_ContentPasted0 x_ContentPasted2 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_ContentPasted0 x_ContentPasted1">the EEGLAB</span> channel layout and the output of ft_prepare_layout. What can I do to fix them?</span></li></ol>
<div class="x_elementToProof">Thank you in advance for your help!</div>
<div class="x_elementToProof"><br>
</div>
<div class="x_elementToProof">Best.</div>
<div class="x_elementToProof"><br>
</div>
<div class="x_elementToProof">Elisa<br>
</div>
<div class="x_elementToProof"><br>
</div>
</div>
<div class="x_elementToProof" style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div class="x_elementToProof" style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div class="x_elementToProof">
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="x_Signature">
<div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<p style="text-align: start; margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">
<font size="2" face="Arial, Helvetica, sans-serif"><span style="margin: 0px; color: rgb(102, 102, 102);">Elisa Tatti, Ph.D.</span></font></p>
<p style="text-align: start; margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">
<font size="2" face="Arial, Helvetica, sans-serif"><br>
</font></p>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; margin: 0px; text-align: start; background-color: rgb(255, 255, 255);">
<div style="margin:0px">
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<font size="2" face="Arial, Helvetica, sans-serif"><span style="margin: 0px; color: rgb(102, 102, 102);">Research Associate</span></font></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<font size="2" face="Arial, Helvetica, sans-serif"><span style="margin: 0px; color: rgb(102, 102, 102);">Research Foundation of the City University of New York</span></font></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<font size="2" face="Arial, Helvetica, sans-serif"><span style="margin: 0px; color: rgb(102, 102, 102);">CUNY, School of Medicine </span></font></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<font size="2" face="Arial, Helvetica, sans-serif"><span style="margin: 0px; color: rgb(102, 102, 102);">160 Convent ave</span></font></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<font size="2" face="Arial, Helvetica, sans-serif"><span style="margin: 0px; color: rgb(102, 102, 102);">New York City, NY, 10031 </span></font><font size="2" face="Arial, Helvetica, sans-serif"><span style="margin: 0px; color: rgb(102, 102, 102);"><br>
</span></font></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<font size="2" face="Arial, Helvetica, sans-serif"><span style="margin: 0px; color: rgb(102, 102, 102);"><br>
</span></font></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<font size="2" face="Arial, Helvetica, sans-serif"><span style="margin: 0px; color: rgb(102, 102, 102);">Adjunct Assistant Professor </span></font></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<font size="2" face="Arial, Helvetica, sans-serif"><span style="margin: 0px; color: rgb(102, 102, 102);">College of Staten Island,</span></font></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<font size="2" face="Arial, Helvetica, sans-serif"><span style="margin: 0px; color: rgb(102, 102, 102);">2800 Victory Blvd, Staten Island, NY 10314 </span></font></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;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 style="margin: 0px; color: rgb(102, 102, 102); font-size: 11pt;">Tel. +1 3472043952</span></p>
</div>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>