예제 #1
0
def test_get_flat_neurites():
    n = load_neuron(Path(SWC_PATH, 'Neuron.swc'))
    assert len(mt.get_flat_neurites(n, 1e-6, method='tolerance')) == 0
    assert len(mt.get_flat_neurites(n, 0.1, method='ratio')) == 0

    n = _make_flat(n)
    assert len(mt.get_flat_neurites(n, 1e-6, method='tolerance')) == 4
    assert len(mt.get_flat_neurites(n, 0.1, method='ratio')) == 4
예제 #2
0
def test_get_flat_neurites():

    n = load_neuron(os.path.join(SWC_PATH, 'Neuron.swc'))

    nt.assert_equal(len(mt.get_flat_neurites(n, 1e-6, method='tolerance')), 0)
    nt.assert_equal(len(mt.get_flat_neurites(n, 0.1, method='ratio')), 0)

    n = _make_flat(n)

    nt.assert_equal(len(mt.get_flat_neurites(n, 1e-6, method='tolerance')), 4)
    nt.assert_equal(len(mt.get_flat_neurites(n, 0.1, method='ratio')), 4)
예제 #3
0
def test_get_flat_neurites():

    n = load_neuron(os.path.join(SWC_PATH, 'Neuron.swc'))

    nt.assert_equal(len(mt.get_flat_neurites(n, 1e-6, method='tolerance')), 0)
    nt.assert_equal(len(mt.get_flat_neurites(n, 0.1, method='ratio')), 0)

    n = _make_flat(n)

    nt.assert_equal(len(mt.get_flat_neurites(n, 1e-6, method='tolerance')), 4)
    nt.assert_equal(len(mt.get_flat_neurites(n, 0.1, method='ratio')), 4)
예제 #4
0
def has_no_flat_neurites(neuron, tol=0.1, method='ratio'):
    '''Check that a neuron has no flat neurites

    Argument:
        neuron : The neuron object to test
        tol : the tolerance or the ratio
        method : way of determining flatness, 'tolerance', 'ratio'
    '''
    return CheckResult(len(get_flat_neurites(neuron, tol, method)) == 0)
예제 #5
0
def has_no_flat_neurites(neuron, tol=0.1, method='ratio'):
    '''Check that a neuron has no flat neurites

    Arguments:
        neuron(Neuron): The neuron object to test
        tol(float): tolerance
        method(string): way of determining flatness, 'tolerance', 'ratio' \
        as described in :meth:`neurom.check.morphtree.get_flat_neurites`

    Returns:
        CheckResult with result
    '''
    return CheckResult(len(get_flat_neurites(neuron, tol, method)) == 0)
예제 #6
0
def has_no_flat_neurites(neuron, tol=0.1, method='ratio'):
    '''Check that a neuron has no flat neurites

    Arguments:
        neuron(Neuron): The neuron object to test
        tol(float): tolerance
        method(string): way of determining flatness, 'tolerance', 'ratio'
        as described in :meth:`neurom.check.morphtree.get_flat_neurites`

    Returns:
        CheckResult with result
    '''
    return CheckResult(len(get_flat_neurites(neuron, tol, method)) == 0)