@@ -19,11 +19,11 @@ def fetch_MNI2009():
19
19
tpl-MNI152NLin2009cAsym/tpl-MNI152NLin2009cAsym_res-02_desc-fMRIPrep_boldref.nii.gz
20
20
tpl-MNI152NLin2009cAsym/tpl-MNI152NLin2009cAsym_res-01_label-brain_probseg.nii.gz
21
21
"""
22
- template = " MNI152NLin2009cAsym"
22
+ template = ' MNI152NLin2009cAsym'
23
23
24
- tf .get (template , resolution = 2 , desc = " brain" , suffix = " mask" )
25
- tf .get (template , resolution = 2 , desc = " fMRIPrep" , suffix = " boldref" )
26
- tf .get (template , resolution = 1 , label = " brain" , suffix = " probseg" )
24
+ tf .get (template , resolution = 2 , desc = ' brain' , suffix = ' mask' )
25
+ tf .get (template , resolution = 2 , desc = ' fMRIPrep' , suffix = ' boldref' )
26
+ tf .get (template , resolution = 1 , label = ' brain' , suffix = ' probseg' )
27
27
28
28
29
29
def fetch_MNI152Lin ():
@@ -33,10 +33,10 @@ def fetch_MNI152Lin():
33
33
tpl-MNI152Lin/tpl-MNI152Lin_res-02_T1w.nii.gz
34
34
tpl-MNI152Lin/tpl-MNI152Lin_res-02_desc-brain_mask.nii.gz
35
35
"""
36
- template = " MNI152Lin"
36
+ template = ' MNI152Lin'
37
37
38
- tf .get (template , resolution = 2 , desc = None , suffix = " T1w" )
39
- tf .get (template , resolution = 2 , desc = " brain" , suffix = " mask" )
38
+ tf .get (template , resolution = 2 , desc = None , suffix = ' T1w' )
39
+ tf .get (template , resolution = 2 , desc = ' brain' , suffix = ' mask' )
40
40
41
41
42
42
def fetch_OASIS ():
@@ -50,13 +50,13 @@ def fetch_OASIS():
50
50
tpl-OASIS30ANTs/tpl-OASIS30ANTs_res-01_desc-brain_mask.nii.gz
51
51
tpl-OASIS30ANTs/tpl-OASIS30ANTs_res-01_desc-BrainCerebellumExtraction_mask.nii.gz
52
52
"""
53
- template = " OASIS30ANTs"
53
+ template = ' OASIS30ANTs'
54
54
55
- tf .get (template , resolution = 1 , desc = "4" , suffix = " dseg" )
56
- tf .get (template , resolution = 1 , desc = None , suffix = " T1w" )
57
- tf .get (template , resolution = 1 , label = " brain" , suffix = " mask" )
58
- tf .get (template , resolution = 1 , desc = " BrainCerebellumExtraction" , suffix = " mask" )
59
- tf .get (template , resolution = 1 , label = " brain" , suffix = " probseg" )
55
+ tf .get (template , resolution = 1 , desc = '4' , suffix = ' dseg' )
56
+ tf .get (template , resolution = 1 , desc = None , suffix = ' T1w' )
57
+ tf .get (template , resolution = 1 , label = ' brain' , suffix = ' mask' )
58
+ tf .get (template , resolution = 1 , desc = ' BrainCerebellumExtraction' , suffix = ' mask' )
59
+ tf .get (template , resolution = 1 , label = ' brain' , suffix = ' probseg' )
60
60
61
61
62
62
def fetch_fsaverage ():
@@ -70,10 +70,10 @@ def fetch_fsaverage():
70
70
tpl-fsaverage/tpl-fsaverage_hemi-L_den-164k_midthickness.surf.gii
71
71
tpl-fsaverage/tpl-fsaverage_hemi-R_den-164k_midthickness.surf.gii
72
72
"""
73
- template = " fsaverage"
73
+ template = ' fsaverage'
74
74
75
- tf .get (template , density = " 164k" , desc = " std" , suffix = " sphere" )
76
- tf .get (template , density = " 164k" , suffix = " midthickness" )
75
+ tf .get (template , density = ' 164k' , desc = ' std' , suffix = ' sphere' )
76
+ tf .get (template , density = ' 164k' , suffix = ' midthickness' )
77
77
78
78
79
79
def fetch_fsLR ():
@@ -89,7 +89,7 @@ def fetch_fsLR():
89
89
tpl-fsLR/tpl-fsLR_space-fsaverage_hemi-L_den-32k_sphere.surf.gii
90
90
tpl-fsLR/tpl-fsLR_space-fsaverage_hemi-R_den-32k_sphere.surf.gii
91
91
"""
92
- tf .get (" fsLR" , density = " 32k" )
92
+ tf .get (' fsLR' , density = ' 32k' )
93
93
94
94
95
95
def fetch_all ():
@@ -100,21 +100,21 @@ def fetch_all():
100
100
fetch_fsLR ()
101
101
102
102
103
- if __name__ == " __main__" :
103
+ if __name__ == ' __main__' :
104
104
parser = argparse .ArgumentParser (
105
- description = " Helper script for pre-caching required templates to run fMRIPrep" ,
105
+ description = ' Helper script for pre-caching required templates to run fMRIPrep' ,
106
106
)
107
107
parser .add_argument (
108
- " --tf-dir" ,
108
+ ' --tf-dir' ,
109
109
type = os .path .abspath ,
110
- help = " Directory to save templates in. If not provided, templates will be saved to"
111
- " `${HOME}/.cache/templateflow`." ,
110
+ help = ' Directory to save templates in. If not provided, templates will be saved to'
111
+ ' `${HOME}/.cache/templateflow`.' ,
112
112
)
113
113
opts = parser .parse_args ()
114
114
115
115
# set envvar (if necessary) prior to templateflow import
116
116
if opts .tf_dir is not None :
117
- os .environ [" TEMPLATEFLOW_HOME" ] = opts .tf_dir
117
+ os .environ [' TEMPLATEFLOW_HOME' ] = opts .tf_dir
118
118
119
119
import templateflow .api as tf
120
120
0 commit comments