Plot Source Reconstructions#

This module enables 3D plotting of source-reconstructed results, either in individual subject space,

visualization.plot_src_rec.plot_subj_space(cort_mdl, color_data, signal_type=None, rec_meta_info=None, coreg=None, ch_names=None, title=None)#

Use finnpy’s cortical model to produce a high resolution 3D plot.

Parameters:
  • cort_mdl (finnpy.src_rec.cort_mdl.Cort_mdl) –

    Container populated with the following items:

    lh_vertnumpy.ndarray, shape(lh_vtx_cnt, 3)

    White matter surface model vertices (left hemisphere).

    lh_facesnumpy.ndarray, shape(lh_face_cnt, 3)

    White matter surface model faces (left hemisphere).

    lh_valid_vertnumpy.ndarray, shape(lh_vtx_cnt,)

    Valid flags for white matter surface model vertices (left hemisphere).

    rh_vertnumpy.ndarray, shape(rh_vtx_cnt, 3)

    White matter surface model vertices (right hemisphere).

    rh_facesnumpy.ndarray, shape(rh_face_cnt, 3)

    White matter surface model faces (right hemisphere).

    rh_valid_vertnumpy.ndarray, shape(rh_vtx_cnt,)

    Valid flags for white matter surface model vertices (right hemisphere).

    octa_model_vertnumpy.ndarray, shape(octa_mdl_vtx_cnt, 3)

    Octamodel vertices (left hemisphere).

    octa_model_facesnumpy.ndarray, shape(octa_mdl_face_cnt, 3)

    Octamodel faces (right hemisphere).

  • color_data (numpy.ndarray(valid_vtx_cnt, )) – Scalar values to be plotted at each vortex of the model.

  • signal_type (str) – ‘EEG’ or ‘MEG’.

  • rec_meta_info (tuple of (np.ndarray, list or np.ndarray)) –

    • eeg_coords or pos_megnp.ndarray, shape(ch_cnt, 3)

      Position of the EEG/MEG sensors.

    • ws or pos_mri: list or np.ndarray

      Either EEG weights or position of the MEG sensor in MRI space.

  • coreg (finnpy.src_rec.coreg) – Coregistration between MEEG and MRI.

  • ch_names (list) – Channel names.

  • title (str) – Title string.

fs-average space (for group analyses),

visualization.plot_src_rec.plot_fsavg_space(subj_to_fsavg_mdl, color_data, signal_type=None, rec_meta_info=None, coreg=None, ch_names=None)#

Use finnpy’s fsavg model to produce a high resolution 3D plot.

Parameters:
  • subj_to_fsavg_mdl (finnpy.src_rec.subj_to_fsavg.Subj_to_fsavg_mdl) –

    Container class, populated with the following items:

    transnumpy.ndarray, shape(valid_subj_vtx_cnt, valid_subj_vtx_cnt)

    Transformation matrix

    lh_valid_vertnumpy.ndarray, shape(lh_vtx_cnt,)

    Valid/supporting vertices for left hemisphere.

    lh_vertnumpy.ndarray, shape(lh_vtx_cnt, 3)

    White matter surface model vertices (left hemisphere).

    lh_facesnumpy.ndarray, shape(lh_face_cnt, 3)

    White matter surface model faces (left hemisphere).

    rh_vertnumpy.ndarray, shape(rh_vtx_cnt, 3)

    White matter surface model vertices (right hemisphere).

    rh_facesnumpy.ndarray, shape(rh_face_cnt, 3)

    White matter surface model faces (right hemisphere).

    rh_valid_vertnumpy.ndarray, shape(rh_vtx_cnt,)

    Valid flags for white matter surface model vertices (right hemisphere).

    rh_valid_vertnumpy.ndarray, shape(fs_avg_vtx_cnt,)

    Valid/supporting vertices for right hemisphere.

  • color_data (numpy.ndarray(valid_vtx_cnt, )) – Scalar values to be plotted at each vortex of the model.

  • signal_type (str) – ‘EEG’ or ‘MEG’.

  • rec_meta_info (tuple of (np.ndarray, list or np.ndarray)) –

    • eeg_coords or pos_megnp.ndarray, shape(ch_cnt, 3)

      Position of the EEG/MEG sensors.

    • ws or pos_mri: list or np.ndarray

      Either EEG weights or position of the MEG sensor in MRI space.

  • coreg (finnpy.src_rec.coreg) – Coregistration between MEEG and MRI.

  • ch_names (list) – Channel names.

or region-averaged fs-average space.

visualization.plot_src_rec.plot_reg_avg(subj_to_fsavg_mdl, morphed_channels, color_data, signal_type=None, rec_meta_info=None, coreg=None, ch_names=None)#

Generate a high resolution 3D plot using using Desikan-Killiany parcellation on fs-average projected data.

Parameters:
  • subj_to_fsavg_mdl (finnpy.src_rec.subj_to_fsavg.Subj_to_fsavg_mdl) –

    Container class, populated with the following items:

    transnumpy.ndarray, shape(valid_subj_vtx_cnt, valid_subj_vtx_cnt)

    Transformation matrix

    lh_valid_vertnumpy.ndarray, shape(lh_vtx_cnt,)

    Valid/supporting vertices for left hemisphere.

    lh_vertnumpy.ndarray, shape(lh_vtx_cnt, 3)

    White matter surface model vertices (left hemisphere).

    lh_facesnumpy.ndarray, shape(lh_face_cnt, 3)

    White matter surface model faces (left hemisphere).

    rh_vertnumpy.ndarray, shape(rh_vtx_cnt, 3)

    White matter surface model vertices (right hemisphere).

    rh_facesnumpy.ndarray, shape(rh_face_cnt, 3)

    White matter surface model faces (right hemisphere).

    rh_valid_vertnumpy.ndarray, shape(rh_vtx_cnt,)

    Valid flags for white matter surface model vertices (right hemisphere).

    rh_valid_vertnumpy.ndarray, shape(fs_avg_vtx_cnt,)

    Valid/supporting vertices for right hemisphere.

  • morphed_channels (list(np.ndarray(variable size)), len = valid_vtx_cnt) – Projects from 68 cortical regions onto the vertices of the high resolution MRI scans.

  • color_data (numpy.ndarray(valid_vtx_cnt, )) – Scalar values to be plotted at each vortex of the model.

  • signal_type (str) – ‘EEG’ or ‘MEG’.

  • rec_meta_info (tuple of (np.ndarray, list or np.ndarray)) –

    • eeg_coords or pos_megnp.ndarray, shape(ch_cnt, 3)

      Position of the EEG/MEG sensors.

    • ws or pos_mri: list or np.ndarray

      Either EEG weights or position of the MEG sensor in MRI space.

  • coreg (finnpy.src_rec.coreg) – Coregistration between MEEG and MRI.

  • ch_names (list) – Channel names.