<div dir="ltr">What do you think about the following:<div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 12, 2015 at 4:33 PM, Eleftherios Garyfallidis <span dir="ltr"><<a href="mailto:garyfallidis@gmail.com" target="_blank">garyfallidis@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">Hi Ariel, <div><br></div><div>Very good point.<br><div><br></div><div>We don't have such a transform method that can take both streamlines and images. </div><div><br></div><div>Certainly Omar had a similar function in some previous version of his PR where you could apply the transformations into points/streamlines. </div><div><br></div><div>I am sure he will be happy to put those back (if they are not already). They can be useful for many things.</div><div><br></div><div>I am not sure it is necessary to have the same transform method operating both with images and streamlines at the same time for now.</div><div><br></div><div>As a first step I would make a function and put it in dipy.tracking.streamline where if you have a diffeomorphic map you can apply</div><div>that to the streamlines. It could be an extension of transform_streamlines which works with an affine matrix.</div></div></div></blockquote><div><br></div><br class="Apple-interchange-newline"><div>How about refactoring this function so that if it gets a matrix, it does what it currently does, and if it gets a (x,y,z,3) array, it uses this as a warp field on the points? We can implement an `apply_warp_field` function that does that part of the function. </div><div><br></div><div>We'd have to assume that the streamlines are already in register with the warp field, so we might end up sometimes doing something like: </div><div><br></div><div>transform_streamlines(transform_streamlines(transform_streamlines(sl, affine), warp_field), np.linalg.inv(affine))</div><div><br></div><div>:-) </div><div><br></div><div> </div><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>After we test this one then we can try to include it to the transform method of the Diffeomorphic Map.</div><div><br></div><div>But we need both versions. Because some times people register the images first and then much later they want to apply the fields to the</div><div>streamlines.</div><div><br></div><div>Having such an easy API to do these things that were so messy before is SO EXCITING! :D </div><div><br></div><div>So yeah it should be trivial with the current API. If Omar is busy with his PhD thesis we can go ahead and do it ourselves.</div><div><br></div><div>Cheers,</div><div>Eleftherios</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Aug 12, 2015 at 7:10 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 class="h5"><div dir="ltr">Hi Eleftherios, <br><div class="gmail_extra"><br></div><div class="gmail_extra">Just considered this one today:<br><div class="gmail_quote"><br></div><div class="gmail_quote"><span>On Tue, Aug 4, 2015 at 6:25 PM, Eleftherios Garyfallidis <span dir="ltr"><<a href="mailto:garyfallidis@gmail.com" target="_blank">garyfallidis@gmail.com</a>></span> wrote:<br></span><span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Tue, Aug 4, 2015 at 7:21 PM, Jorge Rudas <span dir="ltr"><<a href="mailto:jrudascas@gmail.com" target="_blank">jrudascas@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">Thanks for your answer Eleftherios<div><br></div><div>One questions more...</div><div><br></div></div></blockquote></span><div>Be happy to ask as many questions as you need until everything is clear. I am sure you will need </div><div>feedback from us to perform such an analysis. That is because although we are currently working on making </div><div>easy workflows, right  now you will need write your own scripts combining different DIPY tutorials of the </div><div>development version.</div><div><br></div><div>Of course I am more than happy to help you with this.</div><span><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></div><div>When you say "<span style="font-size:12.8000001907349px">then apply the deformation fields to the tractographies</span>", what exactly does this mean ?</div><div><br></div></div></blockquote></span><div>You will generate streamlines and FA maps in the native space of every subject. Then you can for example register</div><div>the FAs to an FA template. After you have performed this registrations you will also have saved the deformation fields</div><div>which were applied to the FAs so that they can be registered to the FA template. Because the tractographies were</div><div>in the same space (native) as the FAs the same deformation fields can be used to warp them to the FA template space</div><div>and in that way your tractographies will also be normalized.</div></div></div></div></blockquote><div><br></div></span><div>Do we have an implementation of functions that take a non-linear transform and streamlines and warp the streamlines through this transform? Or should we implement something like this? As it is now, the DiffeomorphicMapping.transform method (and the functions that get called under the hood there) take a 3D or 2D image as input, but it should be fairly straightforward also enable these functions to take lists of streamlines and operate on these instead. Is this something that already works? </div><div><br></div><div>Cheers, </div><span><font color="#888888"><div><br></div><div>Ariel </div><div><br></div></font></span></div></div></div>
<br></div></div><span class="">_______________________________________________<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></span></blockquote></div><br></div>
<br>_______________________________________________<br>
Neuroimaging mailing list<br>
<a href="mailto:Neuroimaging@python.org">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>