Example #1
0
vb.connect_control(show=True,
                   cmap='viridis',
                   colorby='count',
                   clim=(1., 5.),
                   vmin=0.,
                   vmax=10.,
                   dynamic=(.1, 1.))
vb.screenshot('count.png', autocrop=True)

# ============= Projection =============
vb.connect_control(show=False)
vb.sources_display('all')
vb.cortical_repartition(cmap='viridis',
                        clim=(1., 6.),
                        vmin=2.,
                        under='gray',
                        vmax=4.,
                        over='#ab4642',
                        radius=16.)
vb.brain_control(transparent=False)
vb.sources_opacity(show=False)
vb.rotate(custom=(-125., 0.))
vb.screenshot('repartition.jpg', autocrop=True)

vb.sources_display('all')
vb.roi_control(selection=[4, 6], roi_type='Brodmann', smooth=5)
vb.cortical_projection(project_on='roi',
                       radius=12.,
                       cmap='inferno',
                       clim=(.1, .5),
                       vmin=0.,
Example #2
0
The previous screenshot use the print_size input to increase the resolution.
Now, we use the factor input to do the same. This input simply increase
the image size proportionally.

Start by selecting the colorbar of the cortical projection, improve the
appearance and make a screenshot of it.
"""
save_as = os.path.join(save_pic_path, '2_proj_colorbar.tiff')
vb.screenshot(save_as, canvas='colorbar', autocrop=True, factor=2.)

"""Background color and transparency control of ROI screenshot
"""
roi_obj('aal')
idx_precentral_l = roi_obj.where_is(['Precentral (L)'], exact=True)
idx_postcentral_r = roi_obj.where_is(['Postcentral (R)'], exact=True)
roi_obj.select_roi(idx_precentral_l + idx_postcentral_r, smooth=11)

vb.cortical_repartition(project_on='roi', clim=(1, 17), vmin=2,
                        under='gray', cmap='Reds')
vb.sources_control('Sobj', visible=False)   # Display sources
vb.rotate(custom=(-210, 10.))               # Rotate the brain
vb.brain_control(visible=False)             # Hide the brain

save_as = os.path.join(save_pic_path, '3_cort_proj_roi.tiff')
save_as_cbar = os.path.join(save_pic_path, '3_cort_proj_roi_cbar.tiff')
vb.screenshot(save_as, transparent=True, autocrop=True, print_size=(5, 5))
vb.screenshot(save_as_cbar, canvas='colorbar', autocrop=True, factor=2.)

# Alternatively, you can display the GUI at the end, but it's not a necessity
# vb.show()
# ============= Connectivity =============
# Colorby network density :
vb.sources_display('none')
vb.connect_control(show=True, cmap='magma', colorby='density', clim=(0., 35.),
                   vmin=10., vmax=30., under='gray', over='darkred',
                   dynamic=(.7, 1.))
vb.screenshot('density.png', autocrop=True)
# Color by number of connections per node :
vb.connect_control(show=True, cmap='viridis', colorby='count', clim=(1., 5.),
                   vmin=0., vmax=10., dynamic=(.1, 1.))
vb.screenshot('count.png', autocrop=True)

# ============= Projection =============
vb.connect_control(show=False)
vb.sources_display('all')
vb.cortical_repartition(cmap='viridis', clim=(1., 6.), vmin=2., under='gray',
                        vmax=4., over='#ab4642', radius=16.)
vb.brain_control(transparent=False)
vb.sources_opacity(show=False)
vb.rotate(custom=(-125., 0.))
vb.screenshot('repartition.jpg', autocrop=True)

vb.sources_display('all')
vb.roi_control(selection=[4, 6], roi_type='Brodmann', smooth=5)
vb.cortical_projection(project_on='roi', radius=12., cmap='inferno',
                       clim=(.1, .5), vmin=0., vmax=6.)
vb.sources_display('none')
vb.brain_control(template='B3')
vb.brain_control(transparent=True)
vb.rotate('coronal')
vb.screenshot('roi.jpg', autocrop=True)
Example #4
0
the image size proportionally.

Start by selecting the colorbar of the cortical projection, improve the
appearance and make a screenshot of it.
"""
save_as = os.path.join(save_pic_path, '2_proj_colorbar.tiff')
vb.screenshot(save_as, canvas='colorbar', autocrop=True, factor=2.)
"""Background color and transparency control of ROI screenshot
"""
roi_obj('aal')
idx_precentral_l = roi_obj.where_is(['Precentral (L)'], exact=True)
idx_postcentral_r = roi_obj.where_is(['Postcentral (R)'], exact=True)
roi_obj.select_roi(idx_precentral_l + idx_postcentral_r, smooth=11)

vb.cortical_repartition(project_on='roi',
                        clim=(1, 17),
                        vmin=2,
                        under='gray',
                        cmap='Reds')
vb.sources_control('Sobj', visible=False)  # Display sources
vb.rotate(custom=(-210, 10.))  # Rotate the brain
vb.brain_control(visible=False)  # Hide the brain

save_as = os.path.join(save_pic_path, '3_cort_proj_roi.tiff')
save_as_cbar = os.path.join(save_pic_path, '3_cort_proj_roi_cbar.tiff')
vb.screenshot(save_as, transparent=True, autocrop=True, print_size=(5, 5))
vb.screenshot(save_as_cbar, canvas='colorbar', autocrop=True, factor=2.)

# Alternatively, you can display the GUI at the end, but it's not a necessity
# vb.show()