Example #1
0
def _check_count(obj, n):
    nt.eq_(bif.count(obj), n)
Example #2
0
    print('Mean radius of segments:',
          np.mean(list(iter_neurites(nrn, seg.radius))))

    # get stats for the segment taper rate, for different types of neurite
    for ttype in ezy.NEURITE_TYPES:
        ttt = ttype
        seg_taper_rate = list(iter_neurites(nrn, seg.taper_rate, tree_type_checker(ttt)))
        print('Segment taper rate (', ttype,
              '):\n  mean=', np.mean(seg_taper_rate),
              ', std=', np.std(seg_taper_rate),
              ', min=', np.min(seg_taper_rate),
              ', max=', np.max(seg_taper_rate),
              sep='')

    # Number of bifurcation points.
    print('Number of bifurcation points:', bif.count(nrn))

    # Number of bifurcation points for apical dendrites
    print('Number of bifurcation points (apical dendrites):',
          sum(1 for _ in iter_neurites(nrn, bif.identity,
                                       tree_type_checker(ezy.TreeType.apical_dendrite))))

    # Maximum branch order
    # We create a custom branch_order section_function
    # and use the generalized iteration method
    @sec.section_function(as_tree=True)
    def branch_order(s):
        '''Get the branch order of a section'''
        return mt.branch_order(s)

    print('Maximum branch order:',