def test_extract_stats_single_neuron(): nrn = nm.load_neuron(SWC_PATH / 'Neuron.swc') res = ms.extract_stats(nrn, REF_CONFIG) assert set(res.keys()) == set(REF_OUT.keys()) for k in ('neuron', 'all', 'axon', 'basal_dendrite', 'apical_dendrite'): assert set(res[k].keys()) == set(REF_OUT[k].keys()) for kk in res[k].keys(): assert_almost_equal(res[k][kk], REF_OUT[k][kk], decimal=4)
def test_extract_stats_single_neuron(): nrn = nm.load_neuron(os.path.join(DATA_PATH, 'Neuron.swc')) res = ms.extract_stats(nrn, REF_CONFIG) nt.eq_(res.keys(), REF_OUT.keys()) nt.assert_almost_equal(res['mean_soma_radius'], REF_OUT['mean_soma_radius']) for k in ('all', 'axon', 'basal_dendrite', 'apical_dendrite'): nt.eq_(res[k].keys(), REF_OUT[k].keys()) for kk in res[k].keys(): nt.assert_almost_equal(res[k][kk], REF_OUT[k][kk])
def test_extract_stats_single_neuron(): nrn = nm.load_neuron(os.path.join(DATA_PATH, 'Neuron.swc')) res = ms.extract_stats(nrn, REF_CONFIG) nt.eq_(res.keys(), REF_OUT.keys()) nt.assert_almost_equal(res['mean_soma_radius'], REF_OUT['mean_soma_radius']) for k in ('all', 'axon', 'basal_dendrite', 'apical_dendrite'): nt.eq_(res[k].keys(), REF_OUT[k].keys()) for kk in res[k].keys(): nt.assert_almost_equal(res[k][kk], REF_OUT[k][kk])
def test_extract_stats_single_neuron(): nrn = nm.load_neuron(os.path.join(DATA_PATH, 'Neuron.swc')) res = ms.extract_stats(nrn, REF_CONFIG) nt.eq_(res.keys(), REF_OUT.keys()) #Note: soma radius is calculated from the sphere that gives the area # of the cylinders described in Neuron.swc nt.assert_almost_equal(res['mean_soma_radius'], REF_OUT['mean_soma_radius']) for k in ('all', 'axon', 'basal_dendrite', 'apical_dendrite'): nt.eq_(res[k].keys(), REF_OUT[k].keys()) for kk in res[k].keys(): nt.assert_almost_equal(res[k][kk], REF_OUT[k][kk])
def test_extract_stats_single_neuron(): nrn = nm.load_neuron(Path(SWC_PATH, 'Neuron.swc')) res = ms.extract_stats(nrn, REF_CONFIG) assert_equal(set(res.keys()), set(REF_OUT.keys())) # Note: soma radius is calculated from the sphere that gives the area # of the cylinders described in Neuron.swc assert_almost_equal(res['neuron']['mean_soma_radius'], REF_OUT['neuron']['mean_soma_radius']) for k in ('all', 'axon', 'basal_dendrite', 'apical_dendrite'): assert_equal(set(res[k].keys()), set(REF_OUT[k].keys())) for kk in res[k].keys(): assert_almost_equal(res[k][kk], REF_OUT[k][kk], places=3)
def test_extract_stats_single_neuron(): nrn = nm.load_neuron(os.path.join(DATA_PATH, 'Neuron.swc')) res = ms.extract_stats(nrn, REF_CONFIG) nt.eq_(set(res.keys()), set(REF_OUT.keys())) #Note: soma radius is calculated from the sphere that gives the area # of the cylinders described in Neuron.swc nt.assert_almost_equal(res['mean_soma_radius'], REF_OUT['mean_soma_radius']) for k in ('all', 'axon', 'basal_dendrite', 'apical_dendrite'): nt.eq_(set(res[k].keys()), set(REF_OUT[k].keys())) for kk in res[k].keys(): nt.assert_almost_equal(res[k][kk], REF_OUT[k][kk])
def test_extract_stats_scalar_feature(): nrn = nm.load_neuron(DATA_PATH / 'neurolucida' / 'bio_neuron-000.asc') config = { 'neurite_type': ['ALL'], 'neurite': { 'n_forking_points': ['max'], }, 'neuron': { 'soma_volume': ['total'], } } res = ms.extract_stats(nrn, config) assert res == { 'all': { 'max_n_forking_point': 277 }, 'neuron': { 'total_soma_volume': 1424.4383771584492 } }