tpl
tpl(
which,
mask=True,
version=DEFAULT_TEMPLATE_VERSION,
space=TEMPLATE_SPACE,
dtype=np.float64,
)Connectivity hyperalignment template.
Templates are stored in the hyperbrain dataset (https://gin.g-node.org/neuroboros/hyperbrain) and downloaded on first use. Each hemisphere’s template has shape (n_targets, n_vertices): rows are connectivity targets (connectivity patterns) and columns are the vertices of that hemisphere (connectivity profiles). The targets are the onavg-ico8 vertices of the left hemisphere followed by those of the right hemisphere, the same order as nb.mask("lr", "onavg-ico8").
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| which | (l, r, lr, meta) | Hemisphere of the template (‘lh’ and ‘rh’ are also accepted). ‘lr’ concatenates the two hemispheres along the vertex axis. ‘meta’ returns the metadata of the template version as a dict. | 'l' |
| mask | bool | Whether to apply the standard cortical masks: the onavg-ico8 mask of both hemispheres to the targets (rows) and the mask of space for the requested hemisphere to the vertices (columns). Ignored when which is ‘meta’. |
True |
| version | str | Template name and version, '<name>-<number>'. Versions never change once published. |
'sparta-0.9' |
| space | str | Surface space of the vertices of the returned array. The templates are stored in onavg-ico64; requesting another space resamples them with :func:neuroboros.mapping and emits a warning, because resampling may reduce data quality. Ignored when which is ‘meta’. |
'onavg-ico64' |
| dtype | dtype or None | Data type of the returned array. If None, the data type stored in the file (float32) is kept. Ignored when which is ‘meta’. |
numpy.float64 |
Returns
| Name | Type | Description |
|---|---|---|
| template | ndarray or dict | Array of shape (n_targets, n_vertices) or, for ‘meta’, the parsed meta.json. |
Notes
A newly downloaded file is checked against the SHA-256 checksum in the manifest, and a mismatch emits a warning. Files already in the cache are not re-checked; use :func:verify_manifest for that.
See Also
update_manifest : Refresh the list of available template files. verify_manifest : Check the checksums of the downloaded files.