BlueBrain / morph-tool

https://morph-tool.readthedocs.org/
GNU Lesser General Public License v3.0
8 stars 7 forks source link

automatic morphology alignement #51

Closed arnaudon closed 3 years ago

arnaudon commented 3 years ago

Context

Some PC morphologies are not aligned with the traditional apical trunk towards positive y-axis.

Resolution

This PR provides a simple function to rotate the morphologies wrt to a given direction, such that the apical tree will be aligned to it, adapted from an idea by @lidakanari .

Edit

This now works for any dendrite, one can align wrt to main axon branch for example, if it's end point is provided.

arnaudon commented 3 years ago

from discussion with @adrien-berchet , we should add two other methods to this function:

arnaudon commented 3 years ago

with method='apical_trunk' I assume that with section iteration if we hit apical section, the rest is in the tuft, but I'm not sure. There maybe something cleaner to do here.

arnaudon commented 3 years ago

in .transform.py, there is align function, which seems to be similar, maybe we could merge some code here

arnaudon commented 3 years ago

use .iter(IterType.upstream) to get apical trunk from apical point for method=apical_trunk

arnaudon commented 3 years ago

@asanin-epfl , if you want to have some fun, take a look at this, it's ready for review.

asanin-epfl commented 3 years ago

Does it have dask?

arnaudon commented 3 years ago

haha, it runs on single morph, but feel free to add the same function with an 's' and add dask to parallelize! (and a CLI of course!) Have a nice week end!

asanin-epfl commented 3 years ago

@wizmer do you have any objections/notes?