23
23
24
24
25
25
"""
26
- import pkg_resources as pkgr
26
+ from pkg_resources import resource_filename
27
27
28
28
from nipype import logging
29
29
from nipype .pipeline import engine as pe
@@ -74,8 +74,6 @@ def init_syn_sdc_wf(omp_nthreads, epi_pe=None,
74
74
reference image
75
75
in_reference_brain
76
76
skull-stripped reference image
77
- template : str
78
- Name of template targeted by ``template`` output space
79
77
t1w_brain
80
78
skull-stripped, bias-corrected structural image
81
79
std2anat_xfm
@@ -127,7 +125,7 @@ def init_syn_sdc_wf(omp_nthreads, epi_pe=None,
127
125
template [@fieldmapless3].
128
126
""" .format (ants_ver = Registration ().version or '<ver>' )
129
127
inputnode = pe .Node (
130
- niu .IdentityInterface (['in_reference' , 'in_reference_brain' , 'template' ,
128
+ niu .IdentityInterface (['in_reference' , 'in_reference_brain' ,
131
129
't1w_brain' , 'std2anat_xfm' ]),
132
130
name = 'inputnode' )
133
131
outputnode = pe .Node (
@@ -137,10 +135,10 @@ def init_syn_sdc_wf(omp_nthreads, epi_pe=None,
137
135
138
136
# Collect predefined data
139
137
# Atlas image and registration affine
140
- atlas_img = pkgr . resource_filename ('sdcflows' , 'data/fmap_atlas.nii.gz' )
138
+ atlas_img = resource_filename ('sdcflows' , 'data/fmap_atlas.nii.gz' )
141
139
# Registration specifications
142
- affine_transform = pkgr . resource_filename ('sdcflows' , 'data/affine.json' )
143
- syn_transform = pkgr . resource_filename ('sdcflows' , 'data/susceptibility_syn.json' )
140
+ affine_transform = resource_filename ('sdcflows' , 'data/affine.json' )
141
+ syn_transform = resource_filename ('sdcflows' , 'data/susceptibility_syn.json' )
144
142
145
143
invert_t1w = pe .Node (Rescale (invert = True ), name = 'invert_t1w' ,
146
144
mem_gb = 0.3 )
@@ -153,6 +151,8 @@ def init_syn_sdc_wf(omp_nthreads, epi_pe=None,
153
151
# 1) BOLD -> T1; 2) MNI -> T1; 3) ATLAS -> MNI
154
152
transform_list = pe .Node (niu .Merge (3 ), name = 'transform_list' ,
155
153
mem_gb = DEFAULT_MEMORY_MIN_GB )
154
+ transform_list .inputs .in3 = resource_filename (
155
+ 'sdcflows' , 'data/fmap_atlas_2_MNI152NLin2009cAsym_affine.mat' )
156
156
157
157
# Inverting (1), then applying in reverse order:
158
158
#
@@ -193,8 +193,7 @@ def init_syn_sdc_wf(omp_nthreads, epi_pe=None,
193
193
(ref_2_t1 , t1_2_ref , [('forward_transforms' , 'transforms' )]),
194
194
(ref_2_t1 , transform_list , [('forward_transforms' , 'in1' )]),
195
195
(inputnode , transform_list , [
196
- ('std2anat_xfm' , 'in2' ),
197
- (('template' , _prior_path ), 'in3' )]),
196
+ ('std2anat_xfm' , 'in2' )]),
198
197
(inputnode , atlas_2_ref , [('in_reference' , 'reference_image' )]),
199
198
(transform_list , atlas_2_ref , [('out' , 'transforms' )]),
200
199
(atlas_2_ref , threshold_atlas , [('output_image' , 'in_file' )]),
@@ -215,10 +214,3 @@ def init_syn_sdc_wf(omp_nthreads, epi_pe=None,
215
214
])
216
215
217
216
return workflow
218
-
219
-
220
- def _prior_path (template ):
221
- """Select an appropriate input xform, based on template."""
222
- from pkg_resources import resource_filename
223
- return resource_filename (
224
- 'sdcflows' , 'data/fmap_atlas_2_{}_affine.mat' .format (template ))
0 commit comments