conpy.utils.get_morph_src_mapping#
- conpy.utils.get_morph_src_mapping(src_from, src_to, subject_from=None, subject_to=None, subjects_dir=None, indices=False)[source]#
Get a mapping between an original source space and its morphed version.
It is assumed that the number of vertices and their positions match between the source spaces, only the ordering is different. This is commonly the case when using
morph_source_spaces()
.- Parameters:
- src_frominstance of SourceSpaces
The original source space that was morphed to the target subject.
- src_toinstance of SourceSpaces | list of two arrays
Either the source space to which
src_from
was morphed, or the vertex numbers of this source space.- subject_fromstr | None
The name of the Freesurfer subject to which
src_from
belongs. By default, the value stored in the SourceSpaces object is used.- subject_tostr | None
The name of the Freesurfer subject to which
src_to
belongs. By default, the value stored in the SourceSpaces object is used.- subjects_dirstr | None
Path to SUBJECTS_DIR if it is not set in the environment.
- indicesbool
Whether to return mapping between vertex numbers (
False
, the default) or vertex indices (True
).
- Returns:
- from_todict | pair of dicts
If
indices=True
, a dictionary mapping vertex indices from src_from -> src_to. Ifindices=False
, for each hemisphere, a dictionary mapping vertex numbers from src_from -> src_to.- to_fromdict | pair of dicts
If
indices=True
, a dictionary mapping vertex indices from src_to -> src_from. Ifindices=False
, for each hemisphere, a dictionary mapping vertex numbers from src_to -> src_from.
See also
_get_morph_src_reordering