<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><font size="2"><font face="Victor Mono">Hi Lau</font></font></p>
    <p><font size="2"><font face="Victor Mono">You could try something
          like this</font></font></p>
    <p><font size="2"><font face="Victor Mono">----<br>
        </font></font></p>
    <p><font size="2"><font face="Victor Mono">from simnibs.msh.hmutils
          import mesh_load<br>
          import mne<br>
          <br>
          fname_in = '/path/to/filename.stl'<br>
          fname_out '/path/to/filename.surf'<br>
          <br>
          v, f = mesh_load(fname_in)<br>
          # v, f = mne.surface.decimate_surface(v, f, n_triangles=5000)
          # or whatever<br>
          mne.surface.write_surface(fname_out, v, f)</font></font></p>
    <p><font size="2"><font face="Victor Mono">----<br>
        </font></font></p>
    <p><font size="2"><font face="Victor Mono">In my experience, the BEM
          implementation in MNE does not like the high density surfaces
          from simnibs so you may want to decimate them. I included a
          possible way of doing it.</font></font></p>
    <p><font size="2"><font face="Victor Mono">Best,</font></font></p>
    <p><font size="2"><font face="Victor Mono">Jesper</font></font></p>
    <div class="moz-cite-prefix">On 6/22/2022 13:34, Lau Møller Andersen
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:62e77733-7e16-f566-4af5-2c841e9a21b4@cfin.au.dk">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <p>Dear SimNIBS list</p>
      <p>Thank you for a great tool.</p>
      <p>I looked through the archive and couldn't find an answer for my
        question. I have used your headreco algorithm, and I created
        impressive looking renderings of the head and the brain of a
        subject. These are in the stl.format, and I was wondering
        whether there's a way to convert it to the .surf format found in
        FreeSurfer?</p>
      <p>Specifically, I need this to specify the boundaries between
        layers when specifying the BEM-model in MNE-Python.</p>
      <p>All the best wishes</p>
      <p>Lau Møller Andersen<br>
      </p>
      <div class="moz-signature">-- <br>
        <font size="2">Lau Møller Andersen<br>
          Ph.D. | Assistant Professor<br>
          <br>
          AIAS-COFUND Fellow (Aarhus Institute of Advanced Studies) <a
            href="aias.au.dk" class="moz-txt-link-freetext"
            moz-do-not-send="true">
            aias.au.dk</a><br>
          Høegh-Guldbergs Gade 6B<br>
          8000 Aarhus C<br>
          Denmark<br>
          &<br>
          Department of Linguistics, Cognitive Science and Semiotics <a
href="https://cc.au.dk/en/about-the-school/subjects/cognitive-science/"
            moz-do-not-send="true">
            cognitive science</a><br>
          School of Communication and Culture<br>
          Faculty of Arts<br>
          Aarhus University<br>
          Building 1485, Room 524<br>
          Jens Christian Skous Vej 2<br>
          8000 Aarhus C<br>
          Denmark<br>
          &<br>
          Center of Functionally Integrative Neuroscience <a
            href="cfin.au.dk" class="moz-txt-link-freetext"
            moz-do-not-send="true">
            cfin.au.dk</a><br>
          Department of Clinical Medicine<br>
          Faculty of Health<br>
          Aarhus University<br>
          Building 1710<br>
          Universitetsbyen 3<br>
          8000 Aarhus C<br>
          Denmark<br>
          <br>
          Website: <a href="http://laumollerandersen.org"
            moz-do-not-send="true">laumollerandersen.org</a><br>
          Mail: <a href="mailto:lmandersen@cfin.au.dk"
            class="moz-txt-link-freetext" moz-do-not-send="true">lmandersen@cfin.au.dk</a>
          and
          <a href="mailto:lmandersen@aias.au.dk"
            class="moz-txt-link-freetext" moz-do-not-send="true">lmandersen@aias.au.dk</a><br>
          GitHub: <a href="https://github.com/ualsbombe"
            moz-do-not-send="true">github.com/ualsbombe</a><br>
          Twitter: <a href="https://twitter.com/ualsbombe"
            moz-do-not-send="true">twitter.com/ualsbombe</a><br>
          Google Scholar: <a
href="https://scholar.google.dk/citations?user=3lZ_qo8AAAAJ&hl=da&oi=ao"
            moz-do-not-send="true">
            User Profile</a><br>
        </font></div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Simnibs-discuss mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Simnibs-discuss@drcmr.dk">Simnibs-discuss@drcmr.dk</a>
<a class="moz-txt-link-freetext" href="https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss">https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss</a>
</pre>
    </blockquote>
  </body>
</html>