You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need a feature to measure the percentage of mass "above" and "below" the soma. The direction is determined based on the selected axis (default='Y').
A draft for this feature can be found here:
fromneurom.core.morphologyimportiter_neuritesfromneurom.core.typesimporttree_type_checkerasis_typefromneurom.featuresimportsectionassfdefget_mass_above_soma(neuron, neurite_type, axis='Y'):
"""Computes the percentage of points above / below the soma with respect to the selected axis. """col=getattr(neurom.COLS, axis)
points=list(
iter_neurites(neuron, mapfun=sf.section_points, filt=is_type(neurite_type))
)
point_sel=np.vstack(points)[:, col]
soma_center=neuron.soma.centerreturn100*np.count_nonzero(point_sel>soma_center[col]) /len(point_sel)
If you want to estimate the mass, shouldn't you sum up the lengths (volumes would be even better) of the segments above or below the soma? The number of points is a good approximation only if the morphology was resampled before calling this function.
Yes, you are right @adrien-berchet, computing the length percentages would actually be better. @eleftherioszisis can you easily implement this with lengths?
We need a feature to measure the percentage of mass "above" and "below" the soma. The direction is determined based on the selected axis (default='Y').
A draft for this feature can be found here:
Example values for a test neuron
The text was updated successfully, but these errors were encountered: