Skip to content

Commit cf28b97

Browse files
committed
FIX: Hard-wire MNI152NLin2009cAsym as standard space for SDC-SyN
1 parent fcc9ee0 commit cf28b97

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

sdcflows/workflows/syn.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
2424
2525
"""
26-
import pkg_resources as pkgr
26+
from pkg_resources import resource_filename
2727

2828
from nipype import logging
2929
from nipype.pipeline import engine as pe
@@ -74,8 +74,6 @@ def init_syn_sdc_wf(omp_nthreads, epi_pe=None,
7474
reference image
7575
in_reference_brain
7676
skull-stripped reference image
77-
template : str
78-
Name of template targeted by ``template`` output space
7977
t1w_brain
8078
skull-stripped, bias-corrected structural image
8179
std2anat_xfm
@@ -127,7 +125,7 @@ def init_syn_sdc_wf(omp_nthreads, epi_pe=None,
127125
template [@fieldmapless3].
128126
""".format(ants_ver=Registration().version or '<ver>')
129127
inputnode = pe.Node(
130-
niu.IdentityInterface(['in_reference', 'in_reference_brain', 'template',
128+
niu.IdentityInterface(['in_reference', 'in_reference_brain',
131129
't1w_brain', 'std2anat_xfm']),
132130
name='inputnode')
133131
outputnode = pe.Node(
@@ -137,10 +135,10 @@ def init_syn_sdc_wf(omp_nthreads, epi_pe=None,
137135

138136
# Collect predefined data
139137
# 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')
141139
# 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')
144142

145143
invert_t1w = pe.Node(Rescale(invert=True), name='invert_t1w',
146144
mem_gb=0.3)
@@ -153,6 +151,8 @@ def init_syn_sdc_wf(omp_nthreads, epi_pe=None,
153151
# 1) BOLD -> T1; 2) MNI -> T1; 3) ATLAS -> MNI
154152
transform_list = pe.Node(niu.Merge(3), name='transform_list',
155153
mem_gb=DEFAULT_MEMORY_MIN_GB)
154+
transform_list.inputs.in3 = resource_filename(
155+
'sdcflows', 'data/fmap_atlas_2_MNI152NLin2009cAsym_affine.mat')
156156

157157
# Inverting (1), then applying in reverse order:
158158
#
@@ -193,8 +193,7 @@ def init_syn_sdc_wf(omp_nthreads, epi_pe=None,
193193
(ref_2_t1, t1_2_ref, [('forward_transforms', 'transforms')]),
194194
(ref_2_t1, transform_list, [('forward_transforms', 'in1')]),
195195
(inputnode, transform_list, [
196-
('std2anat_xfm', 'in2'),
197-
(('template', _prior_path), 'in3')]),
196+
('std2anat_xfm', 'in2')]),
198197
(inputnode, atlas_2_ref, [('in_reference', 'reference_image')]),
199198
(transform_list, atlas_2_ref, [('out', 'transforms')]),
200199
(atlas_2_ref, threshold_atlas, [('output_image', 'in_file')]),
@@ -215,10 +214,3 @@ def init_syn_sdc_wf(omp_nthreads, epi_pe=None,
215214
])
216215

217216
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))

setup.cfg

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ setup_requires =
2525
install_requires =
2626
nibabel >=2.2.1
2727
niflow-nipype1-workflows ~= 0.0.1
28-
nipype ~= 1.3.0
29-
# nipype @ git+https://github.com/nipy/nipype.git@5058ab7dfa6c32d4f3a16ee698a8fc4e3d28bee7
30-
niworkflows ~= 1.0.0rc1
28+
nipype >= 1.3.1
29+
niworkflows ~= 1.0.0
3130
numpy
3231
pybids ~=0.9.2
3332
templateflow ~= 0.4

0 commit comments

Comments
 (0)