nispace.datasets.fetch_template
- nispace.datasets.fetch_template(template='MNI152NLin6Asym', res=None, desc=None, hemi=['L', 'R'], nispace_data_dir=None, overwrite=False, check_file_hash=True, verbose=True)[source]
Fetch a brain template.
- Parameters:
template (str, optional) – The template to fetch. Default is “MNI152NLin6Asym”.
res (str, optional) – The resolution of the template to fetch. Defaults: “1mm” for MNI152, “41k” for fsaverage (available: 3k/10k/41k/164k), “32k” for fsLR (available: 4k/8k/32k/164k).
desc (str, optional) – The image type. Defaults: “T1w” for MNI152 (also: brain/mask/gmprob); “pial” for fsaverage (also: white/inflated/sphere/sulc/medial/vaavg); “midthickness” for fsLR (also: inflated/veryinflated[32k+]/sphere/sulc/medial/vaavg).
hemi (list of str, optional) – The hemispheres to fetch. Default is [“L”, “R”].
nispace_data_dir (str orPath, optional) – The directory containing the NiSpace data. Default is None.
overwrite (bool, default False) – Re-download the template even if already cached locally.
check_file_hash (bool, default True) – Verify the SHA-256 hash of the cached file against the known reference hash.
verbose (bool, default True) – Print progress messages.
- Returns:
Path to the downloaded template file. For surface templates with 2 hemispheres requested, a 2-tuple of paths (one per hemisphere).
- Return type:
Path or tuple of Path