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


Python Brain.add_morphometry方法代码示例

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


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

示例1: test_animate

# 需要导入模块: from surfer import Brain [as 别名]
# 或者: from surfer.Brain import add_morphometry [as 别名]
def test_animate(tmpdir):
    """Test animation."""
    _set_backend('auto')
    brain = Brain(*std_args, size=100)
    brain.add_morphometry('curv')
    tmp_name = str(tmpdir.join('test.avi'))
    brain.animate(["m"] * 3, n_steps=2)
    brain.animate(['l', 'l'], n_steps=2, fname=tmp_name)
    # can't rotate in axial plane
    pytest.raises(ValueError, brain.animate, ['l', 'd'])
    brain.close()
开发者ID:nipy,项目名称:PySurfer,代码行数:13,代码来源:test_viz.py

示例2: test_animate

# 需要导入模块: from surfer import Brain [as 别名]
# 或者: from surfer.Brain import add_morphometry [as 别名]
def test_animate():
    """Test animation."""
    _set_backend('auto')
    brain = Brain(*std_args, size=100)
    brain.add_morphometry('curv')
    tmp_name = mktemp() + '.avi'
    brain.animate(["m"] * 3, n_steps=2)
    brain.animate(['l', 'l'], n_steps=2, fname=tmp_name)
    # can't rotate in axial plane
    assert_raises(ValueError, brain.animate, ['l', 'd'])
    brain.close()
开发者ID:mwaskom,项目名称:PySurfer,代码行数:13,代码来源:test_viz.py

示例3: test_animate

# 需要导入模块: from surfer import Brain [as 别名]
# 或者: from surfer.Brain import add_morphometry [as 别名]
def test_animate():
    """Test animation
    """
    mlab.options.backend = 'auto'
    brain = Brain(*std_args, config_opts=small_brain)
    brain.add_morphometry('curv')
    tmp_name = mktemp() + '.avi'
    brain.animate(["m"] * 3, n_steps=2)
    brain.animate(['l', 'l'], n_steps=2, fname=tmp_name)
    # can't rotate in axial plane
    assert_raises(ValueError, brain.animate, ['l', 'd'])
    brain.close()
开发者ID:arokem,项目名称:PySurfer,代码行数:14,代码来源:test_viz.py

示例4: visMorph

# 需要导入模块: from surfer import Brain [as 别名]
# 或者: from surfer.Brain import add_morphometry [as 别名]
def visMorph(pathToSurface, overlay, outputPath, hemi):
    '''
    Display anything morphometric
    '''
    # check the overlay
    if (not overlay == 'sulc' and not overlay == 'thickness'
        and not overlay == 'curv'):
        message = ('You specified %s as overlay, this doesn\'t make sense'
                     % (overlay))
        raise Exception(message)

    brain = Brain(pathToSurface, hemi, 'white')
    brain.add_morphometry(overlay)
    brain.save_montage(outputPath, ['l', 'm'], orientation='v')
    brain.close()
开发者ID:NeuroanatomyAndConnectivity,项目名称:surfaceProcessing,代码行数:17,代码来源:visops.py

示例5: test_morphometry

# 需要导入模块: from surfer import Brain [as 别名]
# 或者: from surfer.Brain import add_morphometry [as 别名]
def test_morphometry():
    """Test plotting of morphometry."""
    _set_backend()
    brain = Brain(*std_args)
    brain.add_morphometry("curv")
    brain.add_morphometry("sulc", grayscale=True)
    brain.add_morphometry("thickness")
    brain.close()
开发者ID:mwaskom,项目名称:PySurfer,代码行数:10,代码来源:test_viz.py

示例6: dict

# 需要导入模块: from surfer import Brain [as 别名]
# 或者: from surfer.Brain import add_morphometry [as 别名]
from surfer._commandline import parser

args = parser.parse_args(sys.argv[1].split())

# Get a dict of config override options
confkeys = ["size", "background", "cortex"]
argdict = args.__dict__
config_opts = dict([(k, v) for k, v in argdict.items() if k in confkeys and v])

# Load  up the figure and underlying brain object
b = Brain(args.subject_id, args.hemi, args.surf, args.curv,
          args.title, config_opts=config_opts)

# Maybe load some morphometry
if args.morphometry is not None:
    b.add_morphometry(args.morphometry)

# Maybe load an overlay
if args.overlay is not None:
    if args.range is not None:
        args.min, args.max = args.range

    b.add_overlay(args.overlay, args.min, args.max, args.sign)

# Maybe load an annot
if args.annotation is not None:
    if not args.borders:
        args.borders = any([args.overlay, args.morphometry])
    b.add_annotation(args.annotation, args.borders)

# Maybe load a label
开发者ID:satra,项目名称:PySurfer,代码行数:33,代码来源:_pysurfer-load.py

示例7: Brain

# 需要导入模块: from surfer import Brain [as 别名]
# 或者: from surfer.Brain import add_morphometry [as 别名]
print __doc__

from surfer import Brain

brain = Brain("fsaverage", "both", "pial", views="frontal",
              config_opts=dict(background="dimgray"))

"""
Because the morphometry files generated by
recon-all live in a predicatble location,
all you need to call the add_morphometry
method with is the name of the measure you want.
Here, we'll look at cortical curvatuve values,
and plot them for both hemispheres.
"""
brain.add_morphometry("curv")

"""
Each of the possible values is displayed in an
appropriate full-color map, but you can also
display in grayscale. Here we only plot the
left hemisphere.
"""
brain.add_morphometry("sulc", hemi='lh', grayscale=True)

"""
The Brain object can only hold one morphometry
overlay at a time, so adding a new one removes
any existing overlays.
"""
brain.add_morphometry("thickness")
开发者ID:aestrivex,项目名称:PySurfer,代码行数:33,代码来源:plot_morphometry.py

示例8: print

# 需要导入模块: from surfer import Brain [as 别名]
# 或者: from surfer.Brain import add_morphometry [as 别名]
from surfer import Brain

print(__doc__)

brain = Brain("fsaverage", "both", "pial", views="frontal",
              background="dimgray")

"""
Because the morphometry files generated by
recon-all live in a predicatble location,
all you need to call the add_morphometry
method with is the name of the measure you want.
Here, we'll look at cortical curvatuve values,
and plot them for both hemispheres.
"""
brain.add_morphometry("curv")

"""
Each of the possible values is displayed in an
appropriate full-color map, but you can also
display in grayscale. Here we only plot the
left hemisphere.
"""
brain.add_morphometry("sulc", hemi='lh', grayscale=True)

"""
You can also use a custom colormap and tweak its range.
"""
brain.add_morphometry("thickness",
                      colormap="PuBuGn", min=1, max=4)
开发者ID:Eric89GXL,项目名称:PySurfer,代码行数:32,代码来源:plot_morphometry.py

示例9: print

# 需要导入模块: from surfer import Brain [as 别名]
# 或者: from surfer.Brain import add_morphometry [as 别名]
"""
from os import environ
from os.path import join
import numpy as np
from surfer import Brain
from nibabel.freesurfer import read_label

print(__doc__)

brain = Brain("fsaverage", "lh", "inflated")

"""
Show the morphometry with a continuous grayscale colormap.
"""
brain.add_morphometry("curv", colormap="binary",
                      min=-.8, max=.8, colorbar=False)

"""
The easiest way to label any vertex that could be in the region is with
add_label.
"""
brain.add_label("BA1_exvivo", color="#A6BDDB")

"""
You can also threshold based on the probability of that region being at each
vertex.
"""
brain.add_label("BA1_exvivo", color="#2B8CBE", scalar_thresh=.5)

"""
It's also possible to plot just the label boundary, in case you wanted to
开发者ID:Eric89GXL,项目名称:PySurfer,代码行数:33,代码来源:plot_probabilistic_label.py


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