def segment_taper_rates(neurites, neurite_type=NeuriteType.all):
def _seg_taper_rates(sec):<EOL><INDENT>'''<STR_LIT>'''<EOL>pts = sec.points[:, COLS.XYZR]<EOL>diff = np.diff(pts, axis=<NUM_LIT:0>)<EOL>distance = np.linalg.norm(diff[:, COLS.XYZ], axis=<NUM_LIT:1>)<EOL>return np.divide(<NUM_LIT:2> * np.abs(diff[:, COLS.R]), distance)<EOL><DEDENT>return map_segments(_seg_taper_rates, neurites, neurite_type)<EOL>
taper rates of the segments in a collection of neurites

    The taper rate is defined as the absolute radii differences divided by length of the section