当前位置: 首页>>代码示例>>Python>>正文


Python utils.load_neuron函数代码示例

本文整理汇总了Python中neurom.io.utils.load_neuron函数的典型用法代码示例。如果您正苦于以下问题:Python load_neuron函数的具体用法?Python load_neuron怎么用?Python load_neuron使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了load_neuron函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_load_neuron_mixed_tree_swc

def test_load_neuron_mixed_tree_swc():
    nrn_mix =  utils.load_neuron(os.path.join(SWC_ORD_PATH, 'sample_mixed_tree_sections.swc'))
    nt.assert_items_equal(get('number_of_sections_per_neurite', nrn_mix), [5, 3])

    nt.assert_items_equal(get('number_of_sections_per_neurite', nrn_mix),
                          get('number_of_sections_per_neurite', SWC_ORD_REF))

    nt.assert_items_equal(get('number_of_segments', nrn_mix),
                          get('number_of_segments', SWC_ORD_REF))

    nt.assert_items_equal(get('total_length', nrn_mix),
                          get('total_length', SWC_ORD_REF))
开发者ID:eleftherioszisis,项目名称:NeuroM,代码行数:12,代码来源:test_utils.py

示例2: test_load_neuron_section_order_break_swc

def test_load_neuron_section_order_break_swc():
    nrn_mix =  utils.load_neuron(os.path.join(SWC_ORD_PATH, 'sample_disordered.swc'))

    assert_items_equal(get('number_of_sections_per_neurite', nrn_mix), [5, 3])

    assert_items_equal(get('number_of_sections_per_neurite', nrn_mix),
                       get('number_of_sections_per_neurite', SWC_ORD_REF))

    assert_items_equal(get('number_of_segments', nrn_mix),
                       get('number_of_segments', SWC_ORD_REF))

    assert_items_equal(get('total_length', nrn_mix),
                       get('total_length', SWC_ORD_REF))
开发者ID:jdcourcol,项目名称:NeuroM,代码行数:13,代码来源:test_utils.py

示例3: test_load_h5_trunk_points_regression

def test_load_h5_trunk_points_regression():
    # regression test for issue encoutnered wile
    # implementing PR #479, related to H5 unpacking
    # of files with non-standard soma structure.
    # See #480.
    nrn = utils.load_neuron(os.path.join(DATA_PATH, 'h5', 'v1', 'Neuron.h5'))
    nt.ok_(np.allclose(nrn.neurites[0].root_node.points[1],
                       [0., 0. , 0.1, 0.31646374, 4., 4., 3.]))

    nt.ok_(np.allclose(nrn.neurites[1].root_node.points[1],
                       [0., 0., 0.1, 1.84130445e-01, 3.0, 235., 234.]))

    nt.ok_(np.allclose(nrn.neurites[2].root_node.points[1],
                       [0., 0., 0.1, 5.62225521e-01, 3., 466, 465]))

    nt.ok_(np.allclose(nrn.neurites[3].root_node.points[1],
                       [0., 0., 0.1, 7.28555262e-01, 2., 697, 696]))
开发者ID:eleftherioszisis,项目名称:NeuroM,代码行数:17,代码来源:test_utils.py

示例4: test_load_trees_good_neuron

def test_load_trees_good_neuron():
    '''Check trees in good neuron are the same as trees from loaded neuron'''
    filepath = os.path.join(SWC_PATH, 'Neuron.swc')
    nrn = utils.load_neuron(filepath)
    trees = utils.load_trees(filepath)
    nt.eq_(len(nrn.neurites), 4)
    nt.eq_(len(nrn.neurites), len(trees))

    nrn2 = MockNeuron(trees)

    @pts.point_function(as_tree=False)
    def elem(point):
        return point

    # Check data are the same in tree collection and neuron's neurites
    for a, b in izip(iter_neurites(nrn, elem), iter_neurites(nrn2, elem)):
        nt.ok_(np.all(a == b))
开发者ID:guozanhua,项目名称:NeuroM,代码行数:17,代码来源:test_utils.py

示例5: test_load_neuron_deep_neuron

def test_load_neuron_deep_neuron():
    '''make sure that neurons with deep (ie: larger than the python
       recursion limit can be loaded)
    '''
    deep_neuron = os.path.join(DATA_PATH, 'h5/v1/deep_neuron.h5')
    utils.load_neuron(deep_neuron)
开发者ID:guozanhua,项目名称:NeuroM,代码行数:6,代码来源:test_utils.py

示例6: test_load_neuron

def test_load_neuron():
    nrn = utils.load_neuron(FILES[0])
    nt.ok_(nrn.name == FILES[0].strip('.swc').split('/')[-1])
开发者ID:guozanhua,项目名称:NeuroM,代码行数:3,代码来源:test_utils.py

示例7: _load_neuron

def _load_neuron(name):
    if name.endswith('.swc'):
        path = os.path.join(SWC_PATH, name)
    elif name.endswith('.h5'):
        path = os.path.join(H5V1_PATH, name)
    return name, load_neuron(path)
开发者ID:Tsolmongerel,项目名称:NeuroM,代码行数:6,代码来源:test_morphology.py

示例8: test_load_neuron_invalid_id_sequence_raises

def test_load_neuron_invalid_id_sequence_raises():
    utils.load_neuron(INVALID_ID_SEQUENCE_FILE);
开发者ID:guozanhua,项目名称:NeuroM,代码行数:2,代码来源:test_utils.py

示例9: test_load_neuron_missing_parents_raises

def test_load_neuron_missing_parents_raises():
    utils.load_neuron(MISSING_PARENTS_FILE)
开发者ID:guozanhua,项目名称:NeuroM,代码行数:2,代码来源:test_utils.py

示例10: test_load_bifurcating_soma_points_raises_SomaError

def test_load_bifurcating_soma_points_raises_SomaError():
    utils.load_neuron(os.path.join(SWC_PATH, 'soma', 'bifurcating_soma.swc'))
开发者ID:eleftherioszisis,项目名称:NeuroM,代码行数:2,代码来源:test_utils.py

示例11: test_load_neuromorpho_3pt_soma

def test_load_neuromorpho_3pt_soma():
    nrn = utils.load_neuron(os.path.join(SWC_PATH, 'soma', 'three_pt_soma.swc'))
    nt.eq_(len(nrn.neurites), 4)
    nt.eq_(len(nrn.soma.points), 3)
    nt.eq_(nrn.soma.radius, 2)
    _check_neurites_have_no_parent(nrn)
开发者ID:eleftherioszisis,项目名称:NeuroM,代码行数:6,代码来源:test_utils.py

示例12: test_load_contour_split_1st_soma_neuron

def test_load_contour_split_1st_soma_neuron():
    nrn = utils.load_neuron(os.path.join(SWC_PATH, 'soma', 'contour_split_1st_soma_neuron.swc'))
    nt.eq_(len(nrn.neurites), 3)
    nt.eq_(len(nrn.soma.points), 6)
    nt.eq_(nrn.soma.radius, 2.0)
    _check_neurites_have_no_parent(nrn)
开发者ID:eleftherioszisis,项目名称:NeuroM,代码行数:6,代码来源:test_utils.py

示例13: test_neuron_name

def test_neuron_name():

    for fn, nn in zip(FILENAMES, NRN_NAMES):
        nrn = utils.load_neuron(fn)
        nt.eq_(nrn.name, nn)
开发者ID:eleftherioszisis,项目名称:NeuroM,代码行数:5,代码来源:test_utils.py

示例14: test_load_neuron

def test_load_neuron():

    nrn = utils.load_neuron(FILENAMES[0])
    nt.assert_true(isinstance(NRN, Neuron))
    nt.assert_equal(NRN.name, 'Neuron')
    _check_neurites_have_no_parent(nrn)
开发者ID:eleftherioszisis,项目名称:NeuroM,代码行数:6,代码来源:test_utils.py

示例15: test_load_neuron_no_consecutive_ids_raises_NonConsecutiveIDsError

def test_load_neuron_no_consecutive_ids_raises_NonConsecutiveIDsError():
    utils.load_neuron(NON_CONSECUTIVE_ID_FILE);
开发者ID:wvangeit,项目名称:NeuroM,代码行数:2,代码来源:test_utils.py


注:本文中的neurom.io.utils.load_neuron函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。