Get mapping (transform) from one space to another.
Parameters
Name
Type
Description
Default
lr
str
Hemisphere(s), either ‘l’, ‘r’, or ‘lr’.
required
source
str
Source space, the space where the data is currently in.
required
target
str
Target space, the space where the data will be transformed into.
required
mask
bool or boolean array or None
Mask to apply to the mapping. If None or False, no mask is applied. If True, the group-based cortical mask is used. If a boolean array, it is used as the mask. source_mask and target_mask can be set separately, and they take precedence over mask.
None
nn
bool
If True, use nearest neighbor interpolation. If False, use overlap-area-based interpolation.
False
keep_sum
bool
If True, keep the sum of the data. Useful for transforming area, volume, etc., where the total area/volume is preserved when keep_sum=True.
False
source_mask
bool or boolean array or None
Mask to apply to the source space. Similar to mask.
None
target_mask
bool or boolean array or None
Mask to apply to the target space. Similar to mask.
None
Returns
Name
Type
Description
M
sparse matrix
Mapping matrix. Can be applied to data in the source space to transform it into the target space. For example, if X is a data matrix in the source space, then X @ M is the data matrix in the target space.