<div dir="ltr">Hi Omar, <div><br></div><div>Excellent - thanks so much for taking a look! I know that you are very busy these days, and so your attention on this is highly appreciated! I will try experimenting more with this, with different input parameters, as you suggested.  </div><div class="gmail_extra"><div class="gmail_quote"><br></div><div class="gmail_quote">If you also want to take a look, since #680 and #681 were merged into dipy, you can now run: </div><div class="gmail_quote"><br></div><div class="gmail_quote">    import dipy.data as dpd</div><div class="gmail_quote">    MNI_T2 = dpd.read_mni_template()</div><div class="gmail_quote"><br></div><div class="gmail_quote">To get the template data. </div><div class="gmail_quote"><br></div><div class="gmail_quote">Thanks again, </div><div class="gmail_quote"><br></div><div class="gmail_quote">Ariel </div><div class="gmail_quote"><br></div><div class="gmail_quote">On Wed, Sep 2, 2015 at 6:16 PM, Jesus-Omar Ocegueda-Gonzalez <span dir="ltr"><<a href="mailto:jomaroceguedag@gmail.com" target="_blank">jomaroceguedag@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Hello guys!, <br></div><div>I have been working on this issue for some days now (this is very interesting Ariel!, thanks for sharing your findings). Satra is totally right that **in theory** the transformations should preserve the topology. Unfortunately, the transformations are only **approximately** diffeomorphic. I am totally sure that this issue should be there in the original version of ants too (dipy's implementation is the same algorithm), although maybe the new version (antsRegistration) may have some improvements that I'm not aware of.<br></div><br></div>Having said that, you can make the transforms closer to diffeomorphic by reducing the `step_length` parameter (in millimeters) from `SymmetricDiffeomorphicRegistration`, which by default is 0.25 mm. You may try something about 0.15 mm. The objective is to avoid making very "aggressive" iterations, so another way to achieve this is by increasing the smoothing parameter from the CCMetric, the parameter is `sigma_diff`, which by default is 2.0, you may try something bout 3.0 (I would first try reducing the step size, though).<br><br></div>I would like to try some other ideas, by any chance can you share the data (MNI_T2)?<br></div>Thank you very much!<br></div><div>-Omar.<br></div><div><div><div><div><br><br></div></div></div></div></div><div class="gmail_extra"><div><div><br><div class="gmail_quote">On Wed, Sep 2, 2015 at 7:28 PM, Satrajit Ghosh <span dir="ltr"><<a href="mailto:satra@mit.edu" target="_blank">satra@mit.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">hi ariel,<div><br></div><div>can you do nearest neighbor interpolation in `mapping.inverse_transform`? if your original ROI doesn't have holes and you are doing a diffeomorphic mapping, your target shouldn't have holes either. for a comparison you could run antsRegister and antsApplyTransforms, with nearest neighbor interpolation.</div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">cheers,<br><br>satra<br><br></div></div></div></div></div></div></div><div class="gmail_quote"><div><div>On Wed, Sep 2, 2015 at 8:13 PM, Ariel Rokem <span dir="ltr"><<a href="mailto:arokem@gmail.com" target="_blank">arokem@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Hi everyone, <div><br></div><div>Jason and I are working on a port of his AFQ system (<a href="https://github.com/jyeatman/afq" target="_blank">https://github.com/jyeatman/afq</a>) into dipy. We've started sketching out some notebooks on how that might work here: </div><div><br></div><div><a href="https://github.com/arokem/AFQ-notebooks" target="_blank">https://github.com/arokem/AFQ-notebooks</a><br></div><div><br></div><div>The main thrust of this is in this one: </div><div><br></div><div><a href="https://github.com/arokem/AFQ-notebooks/blob/master/AFQ-registration-callosum.ipynb" target="_blank">https://github.com/arokem/AFQ-notebooks/blob/master/AFQ-registration-callosum.ipynb</a><br></div><div><br></div><div>The first step in this process is to take a standard ROI of some part of the brain (say, corpus callosum, which is where we are starting) and warp it into the subject's individual brain through a non-linear registration between the individual brain and the template brain on which the ROI was defined (in this case MNI152). Registration works phenomenally (see cell 17), but because this is a non-linear registration, we find ourselves with some holes in the ROI after the transformation (see cell 27 for a sum-intensity projects). We are trying to use scipy.ndimage.binary_fill_holes to, well, fill these holes, but that doesn't seem to be working for us (cell 35 still has that hole...). </div><div><br></div><div>Any ideas about what might be going wrong? Are we using fill_holes incorrectly? Any other tricks to do flood-filling in python? Should we be using skimage? </div><div><br></div><div>Thanks! </div><span><font color="#888888"><div><br></div><div>Ariel   </div></font></span></div>
<br></div></div>_______________________________________________<br>
Neuroimaging mailing list<br>
<a href="mailto:Neuroimaging@python.org" target="_blank">Neuroimaging@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/neuroimaging" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/neuroimaging</a><br>
<br></blockquote></div><br></div></div>
<br>_______________________________________________<br>
Neuroimaging mailing list<br>
<a href="mailto:Neuroimaging@python.org" target="_blank">Neuroimaging@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/neuroimaging" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/neuroimaging</a><br>
<br></blockquote></div><br><br clear="all"><br></div></div><span><font color="#888888">-- <br><div>"Cada quien es dueño de lo que calla y esclavo de lo que dice"<br>-Proverbio chino.<br>"We all are owners of what we keep silent and slaves of what we say"<br>-Chinese proverb.<br><br><a href="http://www.cimat.mx/~omar" target="_blank">http://www.cimat.mx/~omar</a><br></div>
</font></span></div>
<br>_______________________________________________<br>
Neuroimaging mailing list<br>
<a href="mailto:Neuroimaging@python.org" target="_blank">Neuroimaging@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/neuroimaging" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/neuroimaging</a><br>
<br></blockquote></div><br></div></div>