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


Python Brain.remove_labels方法代码示例

本文整理汇总了Python中surfer.Brain.remove_labels方法的典型用法代码示例。如果您正苦于以下问题:Python Brain.remove_labels方法的具体用法?Python Brain.remove_labels怎么用?Python Brain.remove_labels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在surfer.Brain的用法示例。


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

示例1: test_label

# 需要导入模块: from surfer import Brain [as 别名]
# 或者: from surfer.Brain import remove_labels [as 别名]
def test_label():
    """Test plotting of label."""
    _set_backend()
    subject_id = "fsaverage"
    hemi = "lh"
    surf = "inflated"
    brain = Brain(subject_id, hemi, surf)
    brain.add_label("BA1")
    brain.add_label("BA1", color="blue", scalar_thresh=.5)
    subj_dir = utils._get_subjects_dir()
    label_file = pjoin(subj_dir, subject_id,
                       "label", "%s.MT.label" % hemi)
    brain.add_label(label_file)
    brain.add_label("BA44", borders=True)
    brain.add_label("BA6", alpha=.7)
    brain.show_view("medial")
    brain.add_label("V1", color="steelblue", alpha=.6)
    brain.add_label("V2", color="#FF6347", alpha=.6)
    brain.add_label("entorhinal", color=(.2, 1, .5), alpha=.6)
    brain.set_surf('white')

    # remove labels
    brain.remove_labels('V1')
    assert_in('V2', brain.labels_dict)
    assert_not_in('V1', brain.labels_dict)
    brain.remove_labels()
    assert_not_in('V2', brain.labels_dict)

    brain.close()
开发者ID:mwaskom,项目名称:PySurfer,代码行数:31,代码来源:test_viz.py

示例2: test_label

# 需要导入模块: from surfer import Brain [as 别名]
# 或者: from surfer.Brain import remove_labels [as 别名]
def test_label():
    """Test plotting of label."""
    _set_backend()
    subject_id = "fsaverage"
    hemi = "lh"
    surf = "inflated"
    brain = Brain(subject_id, hemi, surf)
    view = get_view(brain)

    extra, subj_dir = _get_extra()
    brain.add_label("BA1" + extra)
    check_view(brain, view)
    brain.add_label("BA1" + extra, color="blue", scalar_thresh=.5)
    label_file = pjoin(subj_dir, subject_id,
                       "label", "%s.MT%s.label" % (hemi, extra))
    brain.add_label(label_file)
    brain.add_label("BA44" + extra, borders=True)
    brain.add_label("BA6" + extra, alpha=.7)
    brain.show_view("medial")
    brain.add_label("V1" + extra, color="steelblue", alpha=.6)
    brain.add_label("V2" + extra, color="#FF6347", alpha=.6)
    brain.add_label("entorhinal" + extra, color=(.2, 1, .5), alpha=.6)
    brain.set_surf('white')
    brain.show_view(dict(elevation=40, distance=430), distance=430)
    with pytest.raises(ValueError, match='!='):
        brain.show_view(dict(elevation=40, distance=430), distance=431)

    # remove labels
    brain.remove_labels('V1' + extra)
    assert 'V2' + extra in brain.labels_dict
    assert 'V1' + extra not in brain.labels_dict
    brain.remove_labels()
    assert 'V2' + extra not in brain.labels_dict

    brain.close()
开发者ID:nipy,项目名称:PySurfer,代码行数:37,代码来源:test_viz.py

示例3: save_groups_labels_figures

# 需要导入模块: from surfer import Brain [as 别名]
# 或者: from surfer.Brain import remove_labels [as 别名]
def save_groups_labels_figures():
    labels, groups = get_groups()
    for group in groups:
        print(group)
        if len(get_group_labels(group)) < 4:
            group_label = [l for l in labels if group in l]
            colors = get_spaced_colors(len(group_label))
        brain = Brain(subject, hemi, surf, offscreen=False)
        for label_id, label in enumerate(group_label):
            print(label)
            brain.add_label(label, color=colors[label_id])
        fol = os.path.join(subjects_dir, subject, 'label', '{}_figures'.format(aparc_name))
        if not os.path.isdir(fol):
            os.mkdir(fol)
        brain.save_imageset(os.path.join(fol, group), get_views(), 'jpg')
        brain.remove_labels()
        brain.close()
开发者ID:ofek-schechner,项目名称:mmvt,代码行数:19,代码来源:show_aparc.py


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