<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hello!
<div class=""><br class="">
</div>
<div class="">Thank you so much for the response. I attempted the realignment using all of the other coordinate systems, and the only one that did not produce the same problem during my reslice was the ACPC coordinate system. However, even though I did not
 lose any slices during the reslice, I am now having a weird problem occur when I generate my source model. It appears that the top of the head is “wrapping” to the bottom and I am not quite sure why that is happening. I am generating the source model using
 the FEM and the Simbio toolbox using this tutorial: <a href="https://www.fieldtriptoolbox.org/workshop/ohbm2018/forward/" class="">https://www.fieldtriptoolbox.org/workshop/ohbm2018/forward/</a> </div>
<div class="">The code I use to generate the head model and the source model is as follows: </div>
<div class=""><br class="">
</div>
<div class="">
<pre class="highlight" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 13.2px; margin-top: 0px; margin-bottom: 0px; overflow: auto; color: rgb(33, 37, 41); background-color: rgb(240, 240, 240); font-variant-ligatures: normal; orphans: 2; widows: 2; text-decoration-thickness: initial;"><code style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: inherit; color: inherit; word-break: normal;" class=""><span class="n" style="box-sizing: border-box;">cfg</span>               <span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">=</span> <span class="p" style="box-sizing: border-box;">[];</span>
<span class="n" style="box-sizing: border-box;">cfg</span><span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">.</span><span class="n" style="box-sizing: border-box;">method</span>        <span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">=</span> <span class="s1" style="box-sizing: border-box; color: rgb(64, 112, 160);">'simbio'</span><span class="p" style="box-sizing: border-box;">;</span>
<span class="n" style="box-sizing: border-box;">cfg</span><span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">.</span><span class="n" style="box-sizing: border-box;">conductivity</span>  <span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">=</span> <span class="p" style="box-sizing: border-box;">[</span><span class="mf" style="box-sizing: border-box; color: rgb(64, 160, 112);">0.43</span> <span class="mf" style="box-sizing: border-box; color: rgb(64, 160, 112);">0.01</span> <span class="mf" style="box-sizing: border-box; color: rgb(64, 160, 112);">1.79</span> <span class="mf" style="box-sizing: border-box; color: rgb(64, 160, 112);">0.33</span> <span class="mi" style="box-sizing: border-box; color: rgb(64, 160, 112);">14</span><span class="p" style="box-sizing: border-box;">];</span>
<span class="n" style="box-sizing: border-box;">cfg</span><span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">.</span><span class="n" style="box-sizing: border-box;">tissuelabel</span>   <span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">=</span> <span class="p" style="box-sizing: border-box;">{</span><span class="s1" style="box-sizing: border-box; color: rgb(64, 112, 160);">'scalp'</span><span class="p" style="box-sizing: border-box;">,</span> <span class="s1" style="box-sizing: border-box; color: rgb(64, 112, 160);">'skull'</span><span class="p" style="box-sizing: border-box;">,</span> <span class="s1" style="box-sizing: border-box; color: rgb(64, 112, 160);">'csf'</span><span class="p" style="box-sizing: border-box;">,</span> <span class="s1" style="box-sizing: border-box; color: rgb(64, 112, 160);">'gray'</span><span class="p" style="box-sizing: border-box;">,</span><span class="s1" style="box-sizing: border-box; color: rgb(64, 112, 160);">'white'</span><span class="p" style="box-sizing: border-box;">};</span>
<span class="n" style="box-sizing: border-box;">headmodel_fem_eeg</span> <span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">=</span> <span class="n" style="box-sizing: border-box;">ft_prepare_headmodel</span><span class="p" style="box-sizing: border-box;">(</span><span class="n" style="box-sizing: border-box;">cfg</span><span class="p" style="box-sizing: border-box;">,</span> <span class="n" style="box-sizing: border-box;">mesh_fem</span><span class="p" style="box-sizing: border-box;">);</span></code></pre>
<div class="">
<pre class="highlight" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 13.2px; margin-top: 0px; margin-bottom: 0px; overflow: auto; color: rgb(33, 37, 41); background-color: rgb(240, 240, 240); font-variant-ligatures: normal; orphans: 2; widows: 2; text-decoration-thickness: initial;"><code style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: inherit; color: inherit; word-break: normal;" class=""><span class="n" style="box-sizing: border-box;">cfg</span>                 <span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">=</span> <span class="p" style="box-sizing: border-box;">[];</span>
<span class="n" style="box-sizing: border-box;">cfg</span><span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">.</span><span class="n" style="box-sizing: border-box;">resolution</span> <span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">=</span> <span class="mi" style="box-sizing: border-box; color: rgb(64, 160, 112);">5</span><span class="p" style="box-sizing: border-box;">;</span> <span class="c1" style="box-sizing: border-box; color: rgb(96, 160, 176); font-style: italic;">%in mm</span>
<span class="n" style="box-sizing: border-box;">cfg</span><span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">.</span><span class="n" style="box-sizing: border-box;">headmodel</span>       <span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">=</span> <span class="n" style="box-sizing: border-box;">headmodel_fem_eeg</span><span class="p" style="box-sizing: border-box;">;</span>
<span class="n" style="box-sizing: border-box;">cfg</span><span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">.</span><span class="n" style="box-sizing: border-box;">inwardshift</span>     <span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">=</span> <span class="mi" style="box-sizing: border-box; color: rgb(64, 160, 112);">1</span><span class="p" style="box-sizing: border-box;">;</span> <span class="c1" style="box-sizing: border-box; color: rgb(96, 160, 176); font-style: italic;">%shifts dipoles away from surfaces</span>
<span class="n" style="box-sizing: border-box;">sourcemodel</span>         <span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">=</span> <span class="n" style="box-sizing: border-box;">ft_prepare_sourcemodel</span><span class="p" style="box-sizing: border-box;">(</span><span class="n" style="box-sizing: border-box;">cfg</span><span class="p" style="box-sizing: border-box;">,</span> <span class="n" style="box-sizing: border-box;">headmodel_fem_eeg</span><span class="p" style="box-sizing: border-box;">);</span></code></pre>
<div class=""><br class="">
</div>
</div>
<div class="">For troubleshooting, here are some images that might help.</div>
<div class=""><br class="">
</div>
<div class="">Image of my resliced MRI using the ACPC coordinate system: </div>
<div class=""><br class="">
</div>
<div class=""><img apple-inline="yes" id="F3D60282-C378-4559-8BE9-56DA0F5DD794" src="cid:70B95CFE-6F3B-421F-861F-304C5E7265A1" class=""></div>
<div class=""><br class="">
</div>
<div class="">Image of my head model, which appears fine: </div>
<div class=""><br class="">
</div>
<div class=""><img apple-inline="yes" id="08D03B97-9AE2-4794-AF6C-73961FFA2183" src="cid:4940D270-ECB9-47AD-88F7-64B1BA7A3D1C" class=""></div>
<div class=""><br class="">
</div>
<div class="">Image of the incorrect source model, that is “wrapping”:</div>
<div class=""><br class="">
</div>
<div class=""><img apple-inline="yes" id="190EBEEF-8968-4305-A770-9BEC2350EC75" src="cid:5D01DEAE-F32E-4217-BD49-4DAB7FA463CC" class=""></div>
<div class=""><br class="">
</div>
<div class="">Any suggestions you might have would be greatly appreciated. One potential problem might be that, unfortunately, due to a problem with the MRI acquisition set-up, all of of MRI images have a few mm missing from the top of the subject’s head, Could
 this be what is causing the problem?</div>
<div class=""><br class="">
</div>
<div class="">Best,</div>
<div class="">JT Galla</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Mar 30, 2022, at 3:12 AM, Schoffelen, J.M. (Jan Mathijs) via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi JT,
<div class=""><br class="">
</div>
<div class="">You’d first need to ensure that ‘mri_realigned’ is correctly realigned. Since the resliced MRI image is upside down, this suggests that the coordinate system information that is used by FieldTrip (i.e. the mri_realigned.coordsys -> it looks like
 ‘ctf’ ) is not compatible with what’s in the data.</div>
<div class=""><br class="">
</div>
<div class="">If you search the documentation for coordinate systems I think there should be plenty of information that will get you on the road.</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">JM</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On 30 Mar 2022, at 05:45, JT Galla via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<span style="caret-color: rgb(0, 0, 0);" class="">Hello!</span>
<div class="" style="caret-color: rgb(0, 0, 0);"><br class="">
</div>
<div class="" style="caret-color: rgb(0, 0, 0);">I am trying to reslice my MRI image for the purposes of EEG Source Reconstruction using the following code:</div>
<div class="" style="caret-color: rgb(0, 0, 0);"><br class="">
</div>
<div class="" style="caret-color: rgb(0, 0, 0);">
<pre class="highlight" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 13.2px; margin-top: 0px; margin-bottom: 0px; overflow: auto; color: rgb(33, 37, 41); background-color: rgb(240, 240, 240); font-variant-ligatures: normal; orphans: 2; widows: 2; text-decoration-thickness: initial;"><code class="" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: inherit; color: inherit; word-break: normal;"><span class="n" style="box-sizing: border-box;">cfg</span>          <span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">=</span> <span class="p" style="box-sizing: border-box;">[];</span>
<span class="n" style="box-sizing: border-box;">mri_resliced</span> <span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">=</span> <span class="n" style="box-sizing: border-box;">ft_volumereslice</span><span class="p" style="box-sizing: border-box;">(</span><span class="n" style="box-sizing: border-box;">cfg</span><span class="p" style="box-sizing: border-box;">,</span> <span class="n" style="box-sizing: border-box;">mri_realigned</span><span class="p" style="box-sizing: border-box;">);</span></code></pre>
<div class=""><br class="">
</div>
</div>
<div class="" style="caret-color: rgb(0, 0, 0);">However, when I go to view the output of this command I see that the reslice method has completely removed axial slices and has inverted coronal and sagittal slices. This is, of course, ruining subsequent head
 model generations so any guidance that could be provided on why this might be happening and how to fix it would be greatly appreciated. Attached is a screenshot of what my replaced image looks like.</div>
<div class="" style="caret-color: rgb(0, 0, 0);"><br class="">
</div>
<div class="" style="caret-color: rgb(0, 0, 0);"><span id="cid:DF98F78D-F6AE-4658-AC9E-D5A8944051B6" class=""><Screen Shot 2022-03-29 at 11.38.25 PM.png></span></div>
<div class="" style="caret-color: rgb(0, 0, 0);"><br class="">
<br class="">
</div>
<span style="caret-color: rgb(0, 0, 0);" class="">Thank you for your time!</span><br class="" style="caret-color: rgb(0, 0, 0);">
<br class="" style="caret-color: rgb(0, 0, 0);">
<div class="" style="caret-color: rgb(0, 0, 0);">
<div dir="auto" class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div dir="auto" class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<b class="">JT Galla</b>
<div class="">Duke University c/o ’23</div>
<div class="">Neuroscience Major, Chemistry & Computational Biology Minor</div>
</div>
</div>
</div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://urldefense.com/v3/__https://mailman.science.ru.nl/mailman/listinfo/fieldtrip__;!!OToaGQ!6vPrFskflVtIpKCZCHkLFVhfKvKgb1rM8nb5xFmygRVRnuVmHV2dy1mmhD9V_hPYcYKW7A$" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
<a href="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!6VeM6ulnnoPWj9YzzXC2iwz3vUayVv0lqRR_Y5ejucd-ilqk-ByihIVsmRT3y87wRsROZSh9D0p8TICvD4tfGgsU622H5RT-oRNQRA$" class="">https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!6VeM6ulnnoPWj9YzzXC2iwz3vUayVv0lqRR_Y5ejucd-ilqk-ByihIVsmRT3y87wRsROZSh9D0p8TICvD4tfGgsU622H5RT-oRNQRA$</a>
<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://urldefense.com/v3/__https://mailman.science.ru.nl/mailman/listinfo/fieldtrip__;!!OToaGQ!6vPrFskflVtIpKCZCHkLFVhfKvKgb1rM8nb5xFmygRVRnuVmHV2dy1mmhD9V_hPYcYKW7A$" class="">https://urldefense.com/v3/__https://mailman.science.ru.nl/mailman/listinfo/fieldtrip__;!!OToaGQ!6vPrFskflVtIpKCZCHkLFVhfKvKgb1rM8nb5xFmygRVRnuVmHV2dy1mmhD9V_hPYcYKW7A$</a>
<br class="">
<a href="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!OToaGQ!6vPrFskflVtIpKCZCHkLFVhfKvKgb1rM8nb5xFmygRVRnuVmHV2dy1mmhD9V_hNnHKlryg$" class="">https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!OToaGQ!6vPrFskflVtIpKCZCHkLFVhfKvKgb1rM8nb5xFmygRVRnuVmHV2dy1mmhD9V_hNnHKlryg$</a>
<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>