|
1 | | -A Python client to query TemplateFlow |
2 | | -===================================== |
| 1 | +TemplateFlow Python Client |
| 2 | +========================== |
3 | 3 |
|
4 | 4 | |Zenodo| |preprint| |CircleCI| |Build Status| |Pypi| |
5 | 5 |
|
6 | | -Reference anatomies of the brain and corresponding atlases play a central role in experimental |
7 | | -neuroimaging workflows and are the foundation for reporting standardized results. |
8 | | -The choice of such references —i.e., templates— and atlases is one relevant source of methodological |
9 | | -variability across studies, which has recently been brought to attention as an important challenge |
10 | | -to reproducibility in neuroscience. |
11 | | -*TemplateFlow* is a publicly available framework for human and nonhuman brain models. |
12 | | -The framework combines an open database with software for access, management, and vetting, |
13 | | -allowing scientists to distribute their resources under *FAIR* —findable, accessible, interoperable, |
14 | | -reusable— principles. |
15 | | -*TemplateFlow* supports a multifaceted insight into brains across species, and enables multiverse |
16 | | -analyses testing whether results generalize across standard references, scales, and in the long term, |
17 | | -species, thereby contributing to increasing the reliability of neuroimaging results. |
| 6 | +The TemplateFlow Python client provides a lightweight interface for working with |
| 7 | +the `TemplateFlow Archive <https://www.templateflow.org>`__. |
| 8 | +It focuses on three core features: |
| 9 | + |
| 10 | +* Discover and retrieve curated, BIDS-like template resources from Python. |
| 11 | +* Transparently cache data from the public S3 mirror or a local DataLad clone. |
| 12 | +* Share configuration with the command line interface and NiPreps' compatibility wrappers. |
| 13 | + |
| 14 | +Quickstart |
| 15 | +---------- |
| 16 | + |
| 17 | +.. code-block:: python |
| 18 | +
|
| 19 | + >>> from templateflow import TemplateFlowClient |
| 20 | + >>> client = TemplateFlowClient() |
| 21 | + >>> client.get('MNI152NLin2009cAsym', atlas='HarvardOxford', suffix='probseg') |
| 22 | + [PosixPath('.../tpl-MNI152NLin2009cAsym_atlas-HarvardOxford_probseg.nii.gz')] |
| 23 | +
|
| 24 | +Use :mod:`templateflow.api` when you need drop-in compatibility with older |
| 25 | +TemplateFlow helpers that expose top-level :func:`~templateflow.api.get` or |
| 26 | +:func:`~templateflow.api.ls` functions. |
| 27 | + |
| 28 | +Configuration reference |
| 29 | +----------------------- |
| 30 | + |
| 31 | +You can configure the client via environment variables or constructor keywords. |
| 32 | + |
| 33 | +============================== ============================== ============================================== |
| 34 | +Environment variable ``TemplateFlowClient`` keyword Purpose |
| 35 | +============================== ============================== ============================================== |
| 36 | +``TEMPLATEFLOW_HOME`` ``root`` Cache directory for downloaded templates. |
| 37 | +``TEMPLATEFLOW_USE_DATALAD`` ``use_datalad`` Opt-in to DataLad-backed cache management. |
| 38 | +``TEMPLATEFLOW_AUTOUPDATE`` ``autoupdate`` Allow automatic cache updates on import/use. |
| 39 | +============================== ============================== ============================================== |
18 | 40 |
|
19 | 41 | Publishing resources in the *TemplateFlow* Archive |
20 | 42 | -------------------------------------------------- |
|
0 commit comments