def nonzero_section_lengths(neuron, threshold=0.0): '''Check presence of neuron sections with length not above threshold Arguments: neuron: Neuron object whose segments will be tested threshold: value above which a section length is considered to be non-zero Return: list of ids of first point in bad sections ''' l = [[s for s in val_iter(isection(t)) if section_length(s) <= threshold] for t in neuron.neurites] return [i[0][COLS.ID] for i in chain(*l)]
def nonzero_section_lengths(neuron, threshold=0.0): '''Check presence of neuron sections with length not above threshold Arguments: neuron: Neuron object whose segments will be tested threshold: value above which a section length is considered to be non-zero Return: list of ids of first point in bad sections ''' l = [[s for s in val_iter(isection(t)) if section_length(s) <= threshold] for t in neuron.neurites] return [i[0][COLS.ID] for i in chain(*l)]
def length(section): '''Return the length of a section''' return mm.section_length(section)