Cortical model#
This module may be employed to read and cortical models.
- src_rec.cort_mdl.Cort_mdl(lh_vert, lh_faces, lh_valid_vert, rh_vert, rh_faces, rh_valid_vert, octa_mdl_vert, octa_mdl_faces)#
Container populated with the following cortical surface (MRI) based items.
- Parameters:
lh_vert (np.ndarray, shape(lh_vtx_cnt, 3)) – White matter surface model vertices (left hemisphere).
lh_faces (np.ndarray, shape(lh_face_cnt, 3)) – White matter surface model faces (left hemisphere).
lh_valid_vert (np.ndarray, shape(rh_vtx_cnt,)) – Valid flags for white matter surface model vertices (left hemisphere).
rh_vert (np.ndarray, shape(rh_vtx_cnt, 3)) – White matter surface model vertices (right hemisphere).
rh_faces (np.ndarray, shape(rh_face_cnt, 3)) – White matter surface model faces (right hemisphere).
lh_valid_vert – Valid flags for white matter surface model vertices (right hemisphere).
octa_model_vert (np.ndarray, shape(octa_mdl_vtx_cnt, 3)) – Octamodel vertices (left hemisphere).
octa_model_faces (np.ndarray, shape(octa_mdl_face_cnt, 3)) – Octamodel faces (right hemisphere).
- src_rec.cort_mdl.get(anatomy_path, subj_name, signal_type, coreg, bem_mdl)#
Read and filter cortical freesurfer data.
- Parameters:
anatomy_path (string) – Path to the anatomy folder. This folder should contain a sub-folder for each subject, to be pupulated with the corresponding structural data.
subj_name (string) – Name of the subject.
signal_type (string) – Mode is either “EEG” or “MEG”.
coreg (finnpy.src_rec.coregistration_meg_mri.Coreg) – Container with different transformation matrices
bem_mdl (finnpy.src_rec.bem_mdl.BEM_mdl) –
Container class, populed with the following items:
- vertlist() of np.ndarray, [shape(scaled_vtx_cnt, 3), …]
Remaining vertices of a skin/skull model vertices.
- faceslist() of np.ndarray, [shape(scaled_face_cnt, 3), …]
Remaining faces of a skin/skull model faces.
- faces_normalnp.ndarray, shape(scaled_face_cnt, 3)
Normals of the individual remaining inner skull faces.
- faces_areanp.ndarray, shape(scaled_face_cnt)
Surface area of the remaining faces.
- bem_solutionnp.ndarray, shape(scaled_vtx_cnt, scaled_vtx_cnt)
BEM solution (preliminary step for the calculation of the forward model).
- Returns:
cort_mdl – Container populated with the following items:
- lh_vertnp.ndarray, shape(lh_vtx_cnt, 3)
White matter surface model vertices (left hemisphere).
- lh_facesnp.ndarray, shape(lh_face_cnt, 3)
White matter surface model faces (left hemisphere).
- lh_valid_vertnp.ndarray, shape(lh_vtx_cnt,)
Valid flags for white matter surface model vertices (left hemisphere).
- rh_vertnp.ndarray, shape(rh_vtx_cnt, 3)
White matter surface model vertices (right hemisphere).
- rh_facesnp.ndarray, shape(rh_face_cnt, 3)
White matter surface model faces (right hemisphere).
- rh_valid_vertnp.ndarray, shape(rh_vtx_cnt,)
Valid flags for white matter surface model vertices (right hemisphere).
- octa_model_vertnp.ndarray, shape(octa_mdl_vtx_cnt, 3)
Octamodel vertices (left hemisphere).
- octa_model_facesnp.ndarray, shape(octa_mdl_face_cnt, 3)
Octamodel faces (right hemisphere).
- Return type:
finnpy.src_rec.cort_mdl.Cort_mdl
- src_rec.cort_mdl._read(anatomy_path, subj_name, signal_type, coreg)#
Read cortical freesurfer data.
- Parameters:
anatomy_path (string) – Path to the anatomy folder. This folder should contain a sub-folder for each subject, to be pupulated with the corresponding structural data.
subj_name (string) – Name of the subject.
signal_type (string) – Either “EEG” or “MEG”.
coreg (finnpy.src_rec.coregistration_meg_mri.Coreg) – Container with different transformation matrices
- Returns:
result –
- lh_white_vertnp.ndarray, shape(lh_white_vtx_cnt, 3)
White matter surface model vertices (left hemisphere).
- lh_white_facesnp.ndarray, shape(lh_white_face_cnt, 3)
White matter surface model faces (left hemisphere).
- rh_white_vertnp.ndarray, shape(rh_white_vtx_cnt, 3)
White matter surface model vertices (right hemisphere).
- rh_white_facesnp.ndarray, shape(rh_white_face_cnt, 3)
White matter surface model faces (right hemisphere).
- lh_sphere_vertnp.ndarray, shape(lh_sphere_vtx_cnt, 3)
Spherical freesurfer head model vertices (left hemisphere).
- rh_sphere_vertnp.ndarray, shape(rh_sphere_vtx_cnt, 3)
Spherical freesurfer head model vertices (right hemisphere).
- Return type:
tuple of (np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray)
- src_rec.cort_mdl._update_invalid_vertices(approx_surface, white_vert, valid_vert)#
Update invalid vertices.
- Parameters:
approx_surface (scipy.spatial._qhull.Delaunay) – Approximate in/out skull/skin surface.
white_vert (np.ndarray, shape(white_vtx_cnt, 3)) – White matter surface vertices.
valid_vert (np.ndarray, shape(white_vtx_cnt, 3)) – Binary list of valid vertices.
- Returns:
trans_white_vert – Transformed vertices.
- Return type:
np.ndarray, shape(white_vtx_cnt, 3)