def n_segments(neurites, neurite_type=NeuriteType.all):
    '''Number of segments in a collection of neurites'''
    return sum(len(s.points) - 1
               for s in iter_sections(neurites, neurite_filter=is_type(neurite_type)))
def n_segments ( neurites , neurite_type = NeuriteType . all ) : return sum ( len ( s . points ) - 1 for s in iter_sections ( neurites , neurite_filter = is_type ( neurite_type ) ) )
Number of segments in a collection of neurites