Exemplo n.º 1
0
def test_has_finite_length_segments_good_data():
    files = [os.path.join(SWC_PATH, f)
             for f in ['Neuron.swc',
                       'sequential_trunk_off_0_16pt.swc',
                       'sequential_trunk_off_1_16pt.swc',
                       'sequential_trunk_off_42_16pt.swc']]
    for f in files:
        ok, ids = check.has_all_finite_length_segments(load_data(f))
        nt.ok_(ok)
        nt.ok_(len(ids) == 0)
Exemplo n.º 2
0
def test_has_finite_length_segments_good_data():
    files = [
        os.path.join(SWC_PATH, f) for f in [
            'Neuron.swc', 'sequential_trunk_off_0_16pt.swc',
            'sequential_trunk_off_1_16pt.swc',
            'sequential_trunk_off_42_16pt.swc'
        ]
    ]
    for f in files:
        ok, ids = check.has_all_finite_length_segments(load_data(f))
        nt.ok_(ok)
        nt.ok_(len(ids) == 0)
Exemplo n.º 3
0
def test_has_finite_length_segments_bad_data():
    files = [
        os.path.join(SWC_PATH, f) for f in [
            'Neuron_zero_length_segments.swc', 'Single_apical.swc',
            'Single_basal.swc', 'Single_axon.swc'
        ]
    ]

    bad_segs = [[(4, 5), (215, 216), (426, 427), (637, 638)], [(4, 5)],
                [(4, 5)], [(4, 5)]]

    for i, f in enumerate(files):
        ok, ids = check.has_all_finite_length_segments(load_data(f))
        nt.ok_(not ok)
        nt.assert_equal(ids, bad_segs[i])
Exemplo n.º 4
0
def test_has_finite_length_segments_bad_data():
    files = [os.path.join(SWC_PATH, f)
             for f in ['Neuron_zero_length_segments.swc',
                       'Single_apical.swc',
                       'Single_basal.swc',
                       'Single_axon.swc']]

    bad_segs = [[(4, 5), (215, 216),
                 (426, 427), (637, 638)],
                [(4, 5)],
                [(4, 5)],
                [(4, 5)]]

    for i, f in enumerate(files):
        ok, ids = check.has_all_finite_length_segments(load_data(f))
        nt.ok_(not ok)
        nt.assert_equal(ids, bad_segs[i])