@@ -13,6 +13,22 @@ nonstandard spaces can be inserted.
13
13
*fMRIPrep * will reduce the amount of output spaces to just spaces listed in ``--output-spaces ``,
14
14
even if other options require resampling the preprocessed data into intermediary spaces.
15
15
16
+
17
+ .. _TemplateFlow :
18
+
19
+ *TemplateFlow *
20
+ """"""""""""""
21
+ *TemplateFlow * is a software library and a repository of neuroimaging templates
22
+ that allows end-user applications such as *fMRIPrep * to flexibly query and pull
23
+ template and atlas information.
24
+ In other words, *TemplateFlow * enables *fMRIPrep * to access a wide range
25
+ of templates (and also custom templates, see below).
26
+ Therefore, *TemplateFlow * is central to define *fMRIPrep *'s interface regarding
27
+ template and atlas prior-knowledge.
28
+ For more general information about *TemplateFlow *, visit
29
+ `TemplateFlow.org <https://www.templateflow.org >`__.
30
+
31
+
16
32
Standard spaces
17
33
"""""""""""""""
18
34
When using *fMRIPrep * in a workflow that will investigate effects that span across
@@ -23,7 +39,7 @@ For instance, to instruct *fMRIPrep* to use the MNI template brain distributed w
23
39
FSL as coordinate reference the option will read as follows: ``--output-spaces MNI152NLin6Asym ``.
24
40
By default, *fMRIPrep * uses ``MNI152NLin2009cAsym `` as spatial-standardization reference.
25
41
Valid template identifiers (``MNI152NLin6Asym ``, ``MNI152NLin2009cAsym ``, etc.) come from
26
- the `TemplateFlow project <https://github.com/templateflow/templateflow >`__.
42
+ the `TemplateFlow repository <https://github.com/templateflow/templateflow >`__.
27
43
28
44
Therefore, *fMRIPrep * will run nonlinear registration processes against the template
29
45
T1w image corresponding to all the standard spaces supplied with the argument
@@ -69,21 +85,27 @@ selecting ``fsLR`` surface space without a density label, ``fsLR:den-32k`` will
69
85
70
86
Custom standard spaces
71
87
""""""""""""""""""""""
72
- Although the functionality is not available yet, the interface of the
73
- ``--output-spaces `` permits providing paths to custom templates that
74
- follow TemplateFlow's naming conventions
75
- (e.g., ``/path/to/custom/templates/tpl-MyCustom:res-2 ``).
76
- Following the example, at least the following files
77
- must be found under under ``/path/to/custom/templates/tpl-MyCustom ``::
78
-
79
- tpl-MyCustom/
80
- template_description.json
81
- tpl-MyCustom_res-1_T1w.nii.gz
82
- tpl-MyCustom_res-1_desc-brain_mask.nii.gz
83
- tpl-MyCustom_res-2_T1w.nii.gz
84
- tpl-MyCustom_res-2_desc-brain_mask.nii.gz
85
-
86
- Although a more comprehensive coverage of standard files would be advised.
88
+ To make your custom templates visible by *fMRIPrep *, and usable via
89
+ the ``--output-spaces `` argument, please store your template under
90
+ *TemplateFlow *'s home directory.
91
+ The default *TemplateFlow *'s home directory is ``$HOME/.cache/templateflow ``
92
+ and that can path can be arbitrarily changed by setting
93
+ the ``$TEMPLATEFLOW_HOME `` environment variable.
94
+ A minimal example of the necessary files for a template called
95
+ ``MyCustom `` (and therefore callable via, e.g., ``--output-spaces MyCustom ``)
96
+ follows::
97
+
98
+ $TEMPLATEFLOW_HOME/
99
+ tpl-MyCustom/
100
+ template_description.json
101
+ tpl-MyCustom_res-1_T1w.nii.gz
102
+ tpl-MyCustom_res-1_desc-brain_mask.nii.gz
103
+ tpl-MyCustom_res-2_T1w.nii.gz
104
+ tpl-MyCustom_res-2_desc-brain_mask.nii.gz
105
+
106
+ For further information about how custom templates must be organized and
107
+ corresponding naming, please check `the TemplateFlow tutorials
108
+ <https://www.templateflow.org/python-client/tutorials.html> `__.
87
109
88
110
Nonstandard spaces
89
111
""""""""""""""""""
@@ -118,58 +140,3 @@ identifier not be found within the ``--output-spaces`` list already.
118
140
In other words, running *fMRIPrep * with ``--output-spaces MNI152NLin6Asym:res-2
119
141
--use-syn-sdc `` will expand the list of output spaces to be
120
142
``MNI152NLin6Asym:res-2 MNI152NLin2009cAsym ``.
121
-
122
- .. _TemplateFlow :
123
-
124
- *TemplateFlow *
125
- """"""""""""""
126
- Group inference and reporting of neuroimaging studies require that individual's
127
- features are spatially aligned into a common frame where their location can be
128
- called *standard *.
129
- To that end, a multiplicity of brain templates with anatomical annotations
130
- (i.e., atlases) have been published.
131
- However, a centralized resource that allows programmatic access to templates
132
- was lacking.
133
- *TemplateFlow * is a modular, version-controlled resource that allows researchers
134
- to use templates "off-the-shelf" and share new ones.
135
-
136
- In addition to the repository from which neuroimaging templates are redistributed,
137
- *TemplateFlow * also comprehends a Python client tool to access them programmatically
138
- when used as a library by other software, or interactively by humans.
139
- Therefore *TemplateFlow * is the software module that allows *fMRIPrep * to flexibly
140
- change, and dynamically pull down, new standardized template information.
141
-
142
- .. _tf_no_internet :
143
-
144
- **How do you use TemplateFlow in the absence of access to the Internet? **.
145
- This is a fairly common situation in :abbr: `HPCs ( high-performance computing ) `
146
- systems, where the so-called login nodes have access to the Internet but
147
- compute nodes are isolated, or in PC/laptop enviroments if you are travelling.
148
- *TemplateFlow * will require Internet access the first time it receives a
149
- query for a template resource that has not been previously accessed.
150
- If you know what are the templates you are planning to use, you could
151
- prefetch them using the Python client.
152
- To do so, follow the next steps.
153
-
154
- 1. By default, a mirror of *TemplateFlow * to store the resources will be
155
- created in ``$HOME/.cache/templateflow ``.
156
- You can modify such a configuration with the ``TEMPLATEFLOW_HOME ``
157
- environment variable, e.g.::
158
-
159
- $ export TEMPLATEFLOW_HOME=$HOME/.templateflow
160
-
161
- 2. Install the client within your favorite Python 3 environment (this can
162
- be done in your login-node, or in a host with Internet access,
163
- without need for Docker/Singularity)::
164
-
165
- $ python -m pip install -U templateflow
166
-
167
- 3. Use the ``get() `` utility of the client to pull down all the templates you'll
168
- want to use. For example::
169
-
170
- $ python -c "from templateflow.api import get; get(['MNI152NLin2009cAsym', 'MNI152NLin6Asym', 'OASIS30ANTs', 'MNIPediatricAsym', 'MNIInfant'])"
171
-
172
- After pulling down the resources you'll need, you will just need to make sure your
173
- runtime environment is able to access the filesystem, at the location of your
174
- *TemplateFlow home * directory.
175
- If you are a Singularity user, please check out :ref: `singularity_tf `.
0 commit comments