def sholl_frequency(nrn, neurite_type=NeuriteType.all, step_size=10):
    '''perform Sholl frequency calculations on a population of neurites

    Args:
        nrn(morph): nrn or population
        neurite_type(NeuriteType): which neurites to operate on
        step_size(float): step size between Sholl radii

    Note:
        Given a neuron, the soma center is used for the concentric circles,
        which range from the soma radii, and the maximum radial distance
        in steps of `step_size`.  When a population is given, the concentric
        circles range from the smallest soma radius to the largest radial neurite
        distance.  Finally, each segment of the neuron is tested, so a neurite that
        bends back on itself, and crosses the same Sholl radius will get counted as
        having crossed multiple times.
    '''
    nrns = neuron_population(nrn)
    neurite_filter = is_type(neurite_type)

    min_soma_edge = float('Inf')
    max_radii = 0
    neurites_list = []
    for neuron in nrns:
        neurites_list.extend(((neurites, neuron.soma.center)
                              for neurites in neuron.neurites
                              if neurite_filter(neurites)))

        min_soma_edge = min(min_soma_edge, neuron.soma.radius)
        max_radii = max(max_radii, np.max(np.abs(bounding_box(neuron))))

    radii = np.arange(min_soma_edge, max_radii + step_size, step_size)
    ret = np.zeros_like(radii)
    for neurites, center in neurites_list:
        ret += sholl_crossings(neurites, center, radii)

    return ret
perform Sholl frequency calculations on a population of neurites

    Args:
        nrn(morph): nrn or population
        neurite_type(NeuriteType): which neurites to operate on
        step_size(float): step size between Sholl radii

    Note:
        Given a neuron, the soma center is used for the concentric circles,
        which range from the soma radii, and the maximum radial distance
        in steps of `step_size`.  When a population is given, the concentric
        circles range from the smallest soma radius to the largest radial neurite
        distance.  Finally, each segment of the neuron is tested, so a neurite that
        bends back on itself, and crosses the same Sholl radius will get counted as
        having crossed multiple times.