コード例 #1
0
"""Find index of the thalamus and get the mesh.

If you want to get all of the index of the ROI template use :
* `roi_obj.get_labels()` : return a pandas DatFrame
* `roi_obj.get_labels('/home/')` : save all supported ROI and labels in an
  excel file.
"""
idx_thalamus = roi_obj.where_is('Thalamus')
roi_obj.select_roi(idx_thalamus, smooth=5)
"""Once the ROI object created, we can project source's alpha modulations
directly on the thalamus
"""
roi_obj.project_sources(s_obj,
                        cmap='Spectral_r',
                        clim=(200., 2000.),
                        vmin=300.,
                        under='gray',
                        vmax=1800.,
                        over='darkred')
"""You can also force sources to fit onto the thalamus
"""
# s_obj.fit_to_vertices(roi_obj.vertices)
"""
"""
b_obj = BrainObj('B3')

# Define a Brain instance :
vb = Brain(brain_obj=b_obj, source_obj=s_obj, roi_obj=roi_obj)
"""Select the colorbar of the ROI
"""
vb.cbar_select('roi')
コード例 #2
0
sc.add_to_subplot(s_obj_2,
                  row=1,
                  col=1,
                  title='Plot only sources in BA4, 6 and 8')
sc.add_to_subplot(roi_brod_2, row=1, col=1, use_this_cam=True)

# =============================================================================
#                   CORTICAL PROJECTION OF SOURCE'S ACTIVITY
# =============================================================================
print("\n-> Project source's activity onto ROI")
# Define the ROI object :
roi_brod_3 = RoiObj('aal')
roi_brod_3.select_roi(select=[29, 30, 77, 78], smooth=11)
# Define a source object :
s_obj_3 = SourceObj('SecondSources', xyz, data=data)
roi_brod_3.project_sources(s_obj_3,
                           cmap='plasma',
                           clim=(-1., 1.),
                           vmin=-.5,
                           vmax=.7,
                           under='gray',
                           over='red')
cb_brod_3 = ColorbarObj(roi_brod_3, cblabel='Source activity', **CBAR_STATE)
sc.add_to_subplot(roi_brod_3,
                  row=1,
                  col=2,
                  title="Project source activity onto ROI")
sc.add_to_subplot(cb_brod_3, row=1, col=3, width_max=200)

sc.preview()
コード例 #3
0
roi_obj = RoiObj('aal', cblabel="Alpha power", border=False)

"""Find index of the thalamus and get the mesh.

If you want to get all of the index of the ROI template use :
* `roi_obj.get_labels()` : return a pandas DatFrame
* `roi_obj.get_labels('/home/')` : save all supported ROI and labels in an
  excel file.
"""
idx_thalamus = roi_obj.where_is('Thalamus')
roi_obj.select_roi(idx_thalamus, smooth=5)

"""Once the ROI object created, we can project source's alpha modulations
directly on the thalamus
"""
roi_obj.project_sources(s_obj, cmap='Spectral_r', clim=(200., 2000.),
                        vmin=300., under='gray', vmax=1800., over='darkred')

"""You can also force sources to fit onto the thalamus
"""
# s_obj.fit_to_vertices(roi_obj.vertices)

"""
"""
b_obj = BrainObj('B3')

# Define a Brain instance :
vb = Brain(brain_obj=b_obj, source_obj=s_obj, roi_obj=roi_obj)

"""Select the colorbar of the ROI
"""
vb.cbar_select('roi')