mne.setup_subcortical_source_space#
- mne.setup_subcortical_source_space(subject, label=None, surface=None, aseg='auto', subjects_dir=None, keep_largest_component=True, smooth=0, fill_hole_size=None, add_dist=False, *, verbose=None)[source]#
Set up a subcortical or cerebellar surface source space.
This builds a
SourceSpacesfrom a triangulated mesh of a subcortical or cerebellar structure, either tessellated directly from an anatomical segmentation (label) or supplied as an externally-produced mesh (surface, e.g. one fitted by another package such as CMB). Exactly one oflabelorsurfacemust be provided.Warning
This is experimental functionality.
SourceSpacescreated by this function are not (yet) compatible with morphing (SourceMorph),mne.extract_label_time_course()does not yet know how to select vertices within a subcortical-surface label, and plotting support is limited (for example, theplot()method does not yet support these source spaces).- Parameters:
- subject
str Subject to process.
- label
str|list|dict|None Region(s) of interest to tessellate from the anatomical segmentation given by
aseg. One source space is created per entry (a single str is turned into a one-element list). If dict, maps region names to atlas id numbers, allowing the use of other atlases. Mutually exclusive withsurface.- surfacepath-like |
dict|None A FreeSurfer-compatible surface file (e.g. a
.surffile), or a dict with'rr'and'tris'entries in FreeSurfer surface RAS coordinates (mm), such as those returned bymne.read_surface()or produced by an external mesh-fitting tool. Creates a single source space. Mutually exclusive withlabel.- aseg
str The anatomical segmentation file. Default
autousesaparc+asegif available andwmparcif not. This may be any anatomical segmentation file in the mri subdirectory of the FreeSurfer subject directory.Changed in version 1.8: Added support for the new default
'auto'.Only used when
labelis provided.- subjects_dirpath-like |
None The path to the directory containing the FreeSurfer subjects reconstructions. If
None, defaults to theSUBJECTS_DIRenvironment variable.- keep_largest_componentbool
If True (default), keep only the largest connected component of each tessellated mesh, discarding disconnected islands (the marching-cubes equivalent of FreeSurfer’s
mris_extract_main_component).- smooth
floatin [0, 1) The smoothing factor to be applied. Default 0 is no smoothing.
Only used when
labelis provided.- fill_hole_size
int|None The size of holes to remove in the mesh in voxels. Default is None, no holes are removed. This dilates the boundaries of the surface by
fill_hole_sizevoxels, so use the minimal size needed. Only used whenlabelis provided.- add_distbool
If True, compute inter-source distances along the mesh (see
mne.add_source_space_distances()). Default False, as this can be slow and is not needed for a forward solution.- verbosebool |
str|int|None Control verbosity of the logging output. If
None, use the default verbosity level. See the logging documentation andmne.verbose()for details. Should only be passed as a keyword argument.
- subject
- Returns:
- srcinstance of
SourceSpaces The subcortical/cerebellar surface source space(s), one per
labelentry, or a single one ifsurfacewas used.
- srcinstance of
Notes
This is a first, deliberately narrow proof of concept: it has been validated interactively on the
samplesubject. See the warning above for known gaps, to be addressed in follow-up work.New in v1.12.