<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 style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
Dear mailinglist,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
I noticed that the function ft_prepare_mesh seems to change the order of the<span style="font-size:11.0pt;line-height:107%;font-family:"Calibri",sans-serif;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:"Times New Roman";mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA"> segmentation
 layers to alphabetical, rather than keeping the order chosen during ft_volumesegment.
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span style="font-size:11.0pt;line-height:107%;font-family:"Calibri",sans-serif;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:"Times New Roman";mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA">This
 seems like it could potentially lead to a <span style="font-size:11.0pt;line-height:107%;font-family:"Calibri",sans-serif;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:"Times New Roman";mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA">to
 a mismatch with the conductivity values chosen during ft_prepare_headmodel, which uses the layer order from ft_prepare_mesh.</span></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span style="font-size:11.0pt;line-height:107%;font-family:"Calibri",sans-serif;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:"Times New Roman";mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA"><span style="font-size:11.0pt;line-height:107%;font-family:"Calibri",sans-serif;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:"Times New Roman";mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA"><br>
</span></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span style="font-size:11.0pt;line-height:107%;font-family:"Calibri",sans-serif;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:"Times New Roman";mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA"><span style="font-size:11.0pt;line-height:107%;font-family:"Calibri",sans-serif;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:"Times New Roman";mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA">For
 example, I run </span></span></div>
<div>
<blockquote itemscope="" itemtype="https://schemas.microsoft.com/QuotedText" style="border-left: 3px solid rgb(200, 200, 200); border-top-color: rgb(200, 200, 200); border-right-color: rgb(200, 200, 200); border-bottom-color: rgb(200, 200, 200); padding-left: 1ex; margin-left: 0.8ex;">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
cfg                       = [];
<div class="elementToProof">cfg.output          = {'gray','white','csf','skull','scalp'};</div>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
mri_segmented = ft_volumesegment(cfg, mri_resliced);<br>
</div>
</blockquote>
<div style="color: rgb(0, 0, 0);" class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">​followed by </span><br>
</div>
<blockquote itemscope="" itemtype="https://schemas.microsoft.com/QuotedText" style="border-left: 3px solid rgb(200, 200, 200); border-top-color: rgb(200, 200, 200); border-right-color: rgb(200, 200, 200); border-bottom-color: rgb(200, 200, 200); padding-left: 1ex; margin-left: 0.8ex;">
<div style="color: rgb(0, 0, 0);" class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">cfg                 = [];
<div class="elementToProof">cfg.shift        = 0.3; </div>
<div class="elementToProof">cfg.method  = 'hexahedral'; </div>
</span></div>
<div style="color: rgb(0, 0, 0);" class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">mesh            = ft_prepare_mesh(cfg,mri_segmented);<br>
</span></div>
</blockquote>
<div style="color: rgb(0, 0, 0);" class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">​When I then look at mesh.tissuelabel the order has changed
 to: {'csf'}    {'gray'}    {'scalp'}    {'skull'}    {'white'}</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"><br>
</span></div>
<div style="color: rgb(0, 0, 0);" class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"><br>
</span></div>
<div style="color: rgb(0, 0, 0);" class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">And if I continue to run </span></div>
<blockquote itemscope="" itemtype="https://schemas.microsoft.com/QuotedText" style="border-left: 3px solid rgb(200, 200, 200); border-top-color: rgb(200, 200, 200); border-right-color: rgb(200, 200, 200); border-bottom-color: rgb(200, 200, 200); padding-left: 1ex; margin-left: 0.8ex;">
<div style="color: rgb(0, 0, 0);" class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">cfg                          = [];</span></div>
<div style="color: rgb(0, 0, 0);" class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<div>cfg.method          = 'simbio';</div>
<div>cfg.conductivity  = [0.33 0.14 1.79 0.01 0.43];  % {'gray'  'white'  'csf'  'skull'  'scalp'}</div>
<div><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">headmodel_eeg = ft_prepare_headmodel(cfg, mesh_fem);</span><br>
</div>
</span></div>
</blockquote>
<div class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">headmodel_eeg.tissuelabel has the same order as the mesh: <span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;"><span> </span>{'csf'}
    {'gray'}    {'scalp'}    {'skull'}    {'white'}</span></span></div>
<div class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;">And I assume this means the conductivity values are mismatched.</span></span></div>
<div class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;"><br>
</span></span></div>
<div class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;">Can someone check this?</span></span></div>
<div class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;"><br>
</span></span></div>
<div class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;">I use the fieldtrip version from 1<span><sup>st</sup> </span>of April 2022.</span></span></div>
<div class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;"><br>
</span></span></div>
<div class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;">Best regards,</span></span></div>
<div class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;">Martin</span></span></div>
<div class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;"><br>
</span></span></div>
<div id="Signature">
<div>
<div></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<p style="color: rgb(32, 31, 30); font-family: Tahoma; font-size: 13px; text-align: start; background-color: rgb(255, 255, 255); margin-top: 0px; margin-bottom: 0px;">
<font color="#333333" size="1" style=""><span lang="en-US" style="margin:0px"><span style="color: rgb(118, 113, 113); font-family: Calibri, sans-serif; font-size: 12px; text-align: left; background-color: rgb(255, 255, 255); display: inline !important;">------------</span><br>
</span></font></p>
<p style="color: rgb(32, 31, 30); font-family: Tahoma; font-size: 13px; text-align: start; background-color: rgb(255, 255, 255); margin-top: 0px; margin-bottom: 0px;">
<font color="#333333" size="1" style=""><span lang="en-US" style="margin:0px"><b>Martin Schaefer | </b></span></font><span style="font-family:Tahoma; font-size:x-small">PhD Student</span></p>
<p style="color: rgb(32, 31, 30); font-family: Tahoma; font-size: 13px; text-align: start; background-color: rgb(255, 255, 255); margin-top: 0px; margin-bottom: 0px;">
<font color="#333333" size="1" style=""><span style="font-family: Tahoma; font-size: x-small; background-color: rgb(255, 255, 255); display: inline !important;"><a href="https://www.perceptionlab.se/">https://www.perceptionlab.se/</a><br>
</span></font></p>
<p style="color: rgb(32, 31, 30); font-family: Tahoma; font-size: 13px; text-align: start; background-color: rgb(255, 255, 255); margin-top: 0px; margin-bottom: 0px;">
<font color="#333333" size="1" style="">Department of Clinical Neuroscience (CNS), K8</font></p>
<p style="color: rgb(32, 31, 30); font-family: Tahoma; font-size: 13px; text-align: start; background-color: rgb(255, 255, 255); margin-top: 0px; margin-bottom: 0px;">
<font color="#333333" size="1" style="">Karolinska Institutet | 17 177 Stockholm | Nobels väg 9</font></p>
<p style="color: rgb(32, 31, 30); font-family: Tahoma; font-size: 13px; text-align: start; background-color: rgb(255, 255, 255); margin-top: 0px; margin-bottom: 0px;">
<span lang="en-US" style="margin:0px"><font color="gray" size="1" style=""><a href="mailto:artin.arshamian@ki.se" target="_blank" rel="noopener noreferrer" style="margin:0px">martin.schaefer@ki.se</a></font></span></p>
<p style="color: rgb(32, 31, 30); font-family: Tahoma; font-size: 13px; text-align: start; background-color: rgb(255, 255, 255); margin-top: 0px; margin-bottom: 0px;">
<span lang="en-US" style="margin:0px"><font color="gray" size="1" style="">______________________________________<br>
Karolinska Institutet – a Medical University</font></span></p>
<br>
</div>
</div>
</div>
</div>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1561.6">
<style type="text/css">
    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 12.0px Times; color: #000000; -webkit-text-stroke: #000000; min-height: 14.0px}
    p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 12.0px Times; color: #000000; -webkit-text-stroke: #000000}
    span.s1 {font-kerning: none}
    span.s2 {text-decoration: underline ; font-kerning: none; color: #0000ee; -webkit-text-stroke: 0px #0000ee}
  </style>
<p class="p1"><span class="s1"></span><br>
</p>
<p class="p1"><span class="s1"></span><br>
</p>
<p class="p2"><span class="s1"><i>När du skickar e-post till Karolinska Institutet (KI) innebär detta att KI kommer att behandla dina personuppgifter.
</i><a href="https://ki.se/medarbetare/integritetsskyddspolicy"><span class="s2">Här finns information om hur KI behandlar personuppgifter</span></a>.<span class="Apple-converted-space"> </span></span></p>
<p class="p1"><span class="s1"></span><br>
</p>
<p class="p2"><span class="s1"><i>Sending email to Karolinska Institutet (KI) will result in KI processing your personal data.</i>
<a href="https://ki.se/en/staff/data-protection-policy"><span class="s2">You can read more about KI’s processing of personal data here</span></a>.<span class="Apple-converted-space"> </span></span></p>
</body>
</html>