cortex.mapper.get_mapper¶
- cortex.mapper.get_mapper(subject, xfmname, type='nearest', recache=False, **kwargs)[source]¶
Get a Mapper object that projects data between volume and vertex (surface) space for the given subject and transform, loading a cached version from disk if one already exists.
- Parameters:
- subjectstr
Subject identifier. Must exist in the pycortex database.
- xfmnamestr
Transform name. Must exist in the pycortex database.
- typestr, optional
Mapping method to use for projecting between volume and surface space. One of ‘nearest’, ‘trilinear’, ‘gaussian’, ‘lanczos’, ‘const_patch_nn’, ‘const_patch_trilin’, ‘const_patch_lanczos’, ‘line_nearest’, ‘line_trilinear’, ‘line_lanczos’. Default is ‘nearest’.
- recachebool, optional
If True, ignore any cached mapper file on disk and recompute it. Default is False.
- **kwargs
Extra keyword arguments are passed to the chosen mapper’s sampling function, and which ones matter depends on type:
- sigmafloat (default 1)
Standard deviation of the gaussian kernel. Only used when type=’gaussian’.
- windowint (default 3)
Kernel window size, in voxels. Used when type=’gaussian’ or type=’lanczos’.
- nptsint (default 64)
Number of random sample points per patch/line segment. Used by the ‘const_patch_*’ and ‘line_*’ types.
- mpbool (default True)
Whether to parallelize sampling across processes. Used by the ‘const_patch_*’ types.
- Returns:
- Mapper
A Mapper subclass instance (e.g. PointNN, LineTrilin, …) that can project data between volume and vertex space for this subject/transform.