本文整理汇总了Python中surfer.Brain.animate方法的典型用法代码示例。如果您正苦于以下问题:Python Brain.animate方法的具体用法?Python Brain.animate怎么用?Python Brain.animate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类surfer.Brain
的用法示例。
在下文中一共展示了Brain.animate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_animate
# 需要导入模块: from surfer import Brain [as 别名]
# 或者: from surfer.Brain import animate [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()
示例2: test_animate
# 需要导入模块: from surfer import Brain [as 别名]
# 或者: from surfer.Brain import animate [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()
示例3: test_animate
# 需要导入模块: from surfer import Brain [as 别名]
# 或者: from surfer.Brain import animate [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()
示例4: Brain
# 需要导入模块: from surfer import Brain [as 别名]
# 或者: from surfer.Brain import animate [as 别名]
============================
Animate brain and save movie
============================
"""
print __doc__
from surfer import Brain
sub = 'fsaverage'
hemi = 'lh'
surf = 'inflated'
brain = Brain(sub, hemi, surf)
brain.animate(['l', 'c'])
# control number of steps
brain.animate(['l', 'm'], n_steps=30)
# any path you can think of
brain.animate(['l', 'c', 'm', 'r', 'c', 'r', 'l'], n_steps=45)
# full turns
brain.animate(["m"] * 3)
# movies
brain.animate(['l', 'l'], n_steps=10, fname='simple_animation.avi')
# however, rotating out of the axial plane is not allowed
try: