BlueBrain / NeuroM

Neuronal Morphology Analysis Tool
https://neurom.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
101 stars 55 forks source link

Sholl diagram needed #180

Closed a1eko closed 7 years ago

a1eko commented 8 years ago

For compatibility with experimental data, a Sholl diagram is needed. Something like this:

    radial_distances = [array of distances from 0 to max radial distance]
    intersections = nrn.get_intersections(radial_distances, neurite_type=ttype)
    plt.plot(radial_distances, intersections)
juanchopanza commented 8 years ago

@lidakanari @eleftherioszisis Any comments on this? I believe the possibility of implementing this has been discussed recently.

lidakanari commented 8 years ago

Yes, indeed. This have been discussed and it will be implemented in a future version of NeuroM. However, the code is a bit more complicated than the one described by Alexander. Here is the corresponding paper: http://www.sciencedirect.com/science/article/pii/S0165027014000272

First of all, I would propose that we concentrate on the extraction of the data in the Sholl analysis function and we leave the plotting to the user (that will indeed be trivial).

Second, since Sholl analysis require the parsing of the tree for each circle in order to define the number of intersections, I would proposed an optimized approach: first define all the circles and then parse the tree once, calculating all intersections for all circles.

a1eko commented 8 years ago

"...an optimized approach: first define all the circles and then parse the tree once, calculating all intersections for all circles." Yes, it will be linear in the number of points, n. I suppose same algorithm is used for touch detection as well! If not, it could be as slow as n^2.

mgeplf commented 7 years ago

Hello @a1eko,

I have added this feature in #570, and would appreciate it if you gave it a shot, and see if it works for your use case.

Thanks.

mgeplf commented 7 years ago

570 merged