<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Joel,</p>
    <p>I'd be interested to look at cases 1) and 2). I didn't have any
      subjects with severe atrophy to test on so I think these can
      certainly be improved. Also having the cortical GM pushed all the
      way up to the CSF surface sounds strange.</p>
    <p>W.r.t. fixing the affine: there are examples on how to do this in
      the documentation. If you click through tutorial -> Creating
      Head Models and then go all the way down on that page and click on
      "Fixing the Affine Registration". This should give you some
      pointers on how to do that. I'll also implement a flag for passing
      a registration matrix and skipping the optimization. <br>
    </p>
    <p>Best,</p>
    <p>Oula</p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 8/10/22 17:56, Joel Upston wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:6883EDE5-361C-4697-A1CA-430194520691@unm.edu">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      Oula,
      <div><br>
      </div>
      <div>Thank you for the explanation and I found as you said that
        “mni” is faster but does seem to fail more than “atlas”. However
         after more testing with these settings it looks like it is
        still having issues about 40% of the time, this is over about 20
        subjects I have tested some with T1 and T2 others with just T1.
        Some of the issues are summarized as follows:</div>
      <div><br>
      </div>
      <div>1) The template appears to be registered correctly and the
        tissue types are correctly segmented except the gray matter
        which as I mentioned before is “pushed” right to the edge of the
        csf inner layer. In these cases running the same scan through
        headreco with cat12 seems to generate the correct gm surface but
        then have to use outside programs to combine the two
        segmentations via editing, use the add_tissues_to_upsampling and
        then rerun the meshing. </div>
      <div><br>
      </div>
      <div>2) Some of the population of this dataset is above 50, with
        some atrophy and large ventricles. The ventricles that are often
        large, fail in the charm segmentation. My solution is to again
        use the headreco segmentation ventricles in the charm
        segmentation.</div>
      <div><br>
      </div>
      <div>3) The probabilistic atlas is still not in registration with
        the T1, or could be improved. Would it be possible to add in a
        12 parameter registration matrix (similar to the init transform)
        that it is forced to used, that way if another outside program
        such as AFNI or spm gets a better registration I can use that? I
        have noticed that using the init transform with the proper
        alignment ends up finding the same incorrect minimum in the
        registration optimization.  </div>
      <div><br>
      </div>
      <div>Overall I am happy to share some of this data as well to help
        with some of these issues. Thank you for all your help and all
        your contributions to automate a more accurate head model for
        the field. </div>
      <div><br>
        <br>
        <div dir="ltr">Thank you,
          <div><br>
          </div>
          <div>Joel Upston</div>
        </div>
        <div dir="ltr"><br>
          <blockquote type="cite">On Aug 8, 2022, at 12:30 AM, Oula
            <a class="moz-txt-link-rfc2396E" href="mailto:oulap@drcmr.dk"><oulap@drcmr.dk></a> wrote:<br>
            <br>
          </blockquote>
        </div>
        <blockquote type="cite">
          <div dir="ltr">
            <p class="MsoNormal"
              style="line-height:12.0pt;background:#FF6666"><b><span
                  style="font-size:10.0pt;color:white">  [EXTERNAL]</span></b></p>
            <div>
              <p>Hi Joel,</p>
              <p>The standard init_type ("mni") does a registration
                between the T1w MNI template and the input scan using a
                correlation metric. This assumes that the tissue
                intensities of the input scan and the MNI template are
                more or less the same, and it can sometimes fail if
                that's not the case (even if the input is a T1w scan). <br>
              </p>
              <p>Init_type="atlas" does a registration between the input
                and a probabilistic atlas using a mutual
                information-based metric (similar to what SPM12 does).
                This metric doesn't care about the specific tissue
                intensities of the input, so you could, for example,
                feed in a T2w scan and it should still work.</p>
              <p>The reason I set "mni" as default is that it's faster
                and seemed to work well on the cases I tested it. I'll
                try to do more testing on different T1w scans to see if
                we should set the "atlas"-option as default.</p>
              <p>Best,</p>
              <p>Oula</p>
              <p>  <br>
              </p>
              <div class="moz-cite-prefix">On 8/5/22 18:12, Joel Upston
                wrote:<br>
              </div>
              <blockquote type="cite"
                cite="mid:194A1B83-E82B-4B57-AE1A-00517C2FF857@unm.edu">
                <div dir="ltr"> Oula,
                  <div><br>
                  </div>
                  <div>Thank you for the quick response. Yes the
                    template alignment seems to be a bit better from the
                    affine from headreco, than that of what is given
                    through the charm optimization. I tried the noneck
                    which didn’t change it but just tried the “atlas”
                    init_type parameter and that worked. How exactly is
                    it different? <br>
                    <div><br>
                      <div dir="ltr">Thank you,
                        <div><br>
                        </div>
                        <div>Joel Upston</div>
                      </div>
                      <div dir="ltr"><br>
                        <blockquote type="cite">On Aug 5, 2022, at 5:18
                          AM, Oula <a class="moz-txt-link-rfc2396E"
                            href="mailto:oulap@drcmr.dk"
                            moz-do-not-send="true">
                            <oulap@drcmr.dk></a> wrote:<br>
                          <br>
                        </blockquote>
                      </div>
                      <blockquote type="cite">
                        <div dir="ltr">
                          <p class="MsoNormal"
                            style="line-height:12.0pt;background:#FF6666"><b><span
                                style="font-size:10.0pt;color:white"> 
                                [EXTERNAL]</span></b></p>
                          <div>
                            <p>Hi Joel,</p>
                            <p>Did you check the template alignment
                              after forcing the affine from headreco?
                              You can also try switching the init_type
                              from "mni" to "atlas" in the [samseg]
                              section of the settings file. It also
                              looks like the scans don't have neck so
                              please include the --noneck flag if that's
                              the case.</p>
                            <p>If you've tried all these things already,
                              I'm happy to have a look if you're allowed
                              to share a scan or two from the data set.</p>
                            <p>Best,<br>
                              Oula</p>
                            <p><br>
                            </p>
                            <div class="moz-cite-prefix">On 8/5/22
                              12:32, Joel Upston wrote:<br>
                            </div>
                            <blockquote type="cite"
                              cite="mid:222E2ED5-F642-4E69-84BB-1131664D4FE8@unm.edu">
                              <div dir="ltr">
                                <div style="font-family: Calibri, Arial,
                                  Helvetica, sans-serif; font-size:
                                  12pt; color: rgb(0, 0, 0);"
                                  class="elementToProof">
                                  Hi there,</div>
                                <div style="font-family: Calibri, Arial,
                                  Helvetica, sans-serif; font-size:
                                  12pt; color: rgb(0, 0, 0);"
                                  class="elementToProof">
                                  <br>
                                </div>
                                <div style="font-family: Calibri, Arial,
                                  Helvetica, sans-serif; font-size:
                                  12pt; color: rgb(0, 0, 0);"
                                  class="elementToProof">
                                  I have worked with the Simnibs 3.2.6
                                  headreco to do segmentation and now
                                  trying out the charm segmentation
                                  routine in the Simnibs 4 Beta release.
                                  I have multiple subjects (about 10
                                  subjects tried so far) that have
                                  looked good in the headreco
                                  segmentation in terms of the brain
                                  segmentation <span
                                    style="background-color:rgb(255,
                                    255, 255);display:inline !important">
                                    especially </span>using the T1 and
                                  T2 but when I try this with the charm
                                  segmentation, I run into a problem
                                  about 50% of the time. The problem is
                                  that the cortical surface is smooth
                                  and pushed up right next to the csf
                                  boundary layer, but the wm surface
                                  looks good. I have attached an image
                                  of what is happening to show a better
                                  description. I have made sure that the
                                  template is aligned by forcing in the
                                  code to use the Simnibs 3 warp from
                                  MNI2Conform 12 parameter alignment,
                                  where the previous headmodel seemed to
                                  be  accurate. I also try to change
                                  some of the settings in the
                                  settings.ini file such as all
                                  parameters in the segment section and
                                  th_initial in the surface section with
                                  no avail. As I run the same subject in
                                  the Simnibs 3.2.6 the headmodel looks
                                  good, I have tried to edit via
                                  switching out the brain+csf
                                  segmentation from simnibs3 to simnibs
                                  4 and reran the mesh after editing.
                                  This works reasonably well but the
                                  some of the external to brain
                                  structures are affected, plus requires
                                  double the runtime to run versions 3
                                  and 4. Have you noticed a problem
                                  similar to this and do you have any
                                  recommendations to try? Thank you for
                                  all your work and I appreciate the
                                  research to keep improving this
                                  modeling.</div>
                                <div style="font-family: Calibri, Arial,
                                  Helvetica, sans-serif; font-size:
                                  12pt; color: rgb(0, 0, 0);"
                                  class="elementToProof">
                                  <br>
                                </div>
                                <div style="font-family: Calibri, Arial,
                                  Helvetica, sans-serif; font-size:
                                  12pt; color: rgb(0, 0, 0);"
                                  class="elementToProof">
                                  Thank you,</div>
                                <div style="font-family: Calibri, Arial,
                                  Helvetica, sans-serif; font-size:
                                  12pt; color: rgb(0, 0, 0);"
                                  class="elementToProof">
                                  <br>
                                </div>
                                <div style="font-family: Calibri, Arial,
                                  Helvetica, sans-serif; font-size:
                                  12pt; color: rgb(0, 0, 0);"
                                  class="elementToProof">
                                  Joel Upston</div>
                                <div style="font-family: Calibri, Arial,
                                  Helvetica, sans-serif; font-size:
                                  12pt; color: rgb(0, 0, 0);"
                                  class="elementToProof">
                                  <br>
                                </div>
                                <div style="font-family: Calibri, Arial,
                                  Helvetica, sans-serif; font-size:
                                  12pt; color: rgb(0, 0, 0);"
                                  class="elementToProof">
                                  <img
                                    alt="Correct_GM_surface_from_headreco.png"
src="cid:part1.XvOmVQvv.gVzaZAQF@drcmr.dk" class=""><br>
                                </div>
                                <div style="font-family: Calibri, Arial,
                                  Helvetica, sans-serif; font-size:
                                  12pt; color: rgb(0, 0, 0);"
                                  class="elementToProof">
                                  <br>
                                </div>
                                <div style="font-family: Calibri, Arial,
                                  Helvetica, sans-serif; font-size:
                                  12pt; color: rgb(0, 0, 0);"
                                  class="elementToProof">
                                  <img
                                    alt="Incorrect_GM_surface_from_charm.png"
src="cid:part2.KlSnrDQY.WcKZL0Y9@drcmr.dk" class=""><br>
                                </div>
                                <img
                                  id="32A1A34F-43FD-42CA-9990-D08828BD128B"
alt="Screenshot%20from%202022-08-04%2012-51-01.png"
                                  src="cid:part3.WIlROTAi.IeMi9QgU@drcmr.dk"
                                  class=""></div>
                            </blockquote>
                          </div>
                        </div>
                      </blockquote>
                    </div>
                  </div>
                </div>
              </blockquote>
            </div>
          </div>
        </blockquote>
      </div>
    </blockquote>
  </body>
</html>