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()
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()
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()
============================ 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:
color = '#4D4D4D' #gray subject_id = "fsaverage" hemi = 'lh' surf = 'inflated' color = '#FF007F' alpha=0.75 # whole brain brain = Brain(subject_id, "both", 'inflated', cortex=("gray", -2, 7, True), background='black', alpha=0.6) for roi_name, seed_coord in zip(roi_names, seed_coords): print(roi_name) print(seed_coord) x = seed_coord[0] if x > 0 or np.abs(x) < 6: #brain.add_foci(seed_coord, map_surface="white", color=color, # scale_factor=1.6, hemi='rh', alpha=alpha) brain.add_foci(network1_L, map_surface="white", hemi='lh', color="#F5D300", scale_factor=1.6) # Visual/Sensory brain.add_foci(network2_L, map_surface="white", hemi='lh', color="#09FBD3", scale_factor=1.6) # Limbic brain.add_foci(network3_L, map_surface="white", hemi='lh', color="#FE53BB", scale_factor=1.6) # Intermediate brain.add_foci(network4_L, map_surface="white", hemi='lh', color="#A117F2", scale_factor=1.6) # Higher Associative if x < 0 or np.abs(x) < 6: #brain.add_foci(seed_coord, map_surface="white", color=color, # scale_factor=1.6, hemi='lh', alpha=alpha) brain.add_foci(network1_R, map_surface="white", hemi='rh', color="#F5D300", scale_factor=1.6) # Visual/Sensory brain.add_foci(network2_R, map_surface="white", hemi='rh', color="#09FBD3", scale_factor=1.6) # Limbic brain.add_foci(network3_R, map_surface="white", hemi='rh', color="#FE53BB", scale_factor=1.6) # Intermediate brain.add_foci(network4_R, map_surface="white", hemi='rh', color="#A117F2", scale_factor=1.6) # Higher Associative # the actual animation: brain.animate(["m"] * 3, n_steps=100)
============================ 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: