Skip to content

Commit 93fa6d4

Browse files
committed
FIX: Morphometric resampling sphere
1 parent 03d8c93 commit 93fa6d4

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

nibabies/workflows/anatomical/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ def init_infant_anat_wf(
523523
# fmt:off
524524
wf.connect([
525525
(sphere_reg_wf, anat_fsLR_resampling_wf, [
526+
('outputnode.sphere_reg', 'inputnode.sphere_reg'),
526527
('outputnode.sphere_reg_fsLR', 'inputnode.sphere_reg_fsLR')]),
527528
(surface_recon_wf, anat_fsLR_resampling_wf, [
528529
('outputnode.subject_id', 'inputnode.subject_id'),

nibabies/workflows/anatomical/resampling.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def init_anat_fsLR_resampling_wf(
3131
'subjects_dir',
3232
'surfaces',
3333
'morphometrics',
34+
'sphere_reg',
3435
'sphere_reg_fsLR',
3536
]
3637
),
@@ -96,7 +97,8 @@ def init_anat_fsLR_resampling_wf(
9697
workflow.connect([
9798
(inputnode, morph_grayords_wf, [
9899
("morphometrics", "inputnode.morphometrics"),
99-
("surfaces", "inputnode.surfaces")]),
100+
("surfaces", "inputnode.surfaces"),
101+
("sphere_reg", "inputnode.sphere_reg")]),
100102
(joinnode, morph_grayords_wf, [
101103
("midthickness_fsLR", "inputnode.midthickness_fsLR")]),
102104
])
@@ -191,6 +193,7 @@ def init_mcribs_morph_grayords_wf(
191193
"subjects_dir",
192194
"surfaces",
193195
"morphometrics",
196+
"sphere_reg",
194197
"midthickness_fsLR",
195198
]
196199
),
@@ -238,11 +241,7 @@ def init_mcribs_morph_grayords_wf(
238241
)
239242

240243
atlases = load_resource('atlases')
241-
resample.inputs.current_sphere = [
242-
str(atlases / 'mcribs' / 'lh.sphere.reg.dHCP42.surf.gii'),
243-
str(atlases / 'mcribs' / 'rh.sphere.reg.dHCP42.surf.gii'),
244-
] * 3
245-
resample.inputs.new_sphere = [
244+
resample.inputs.new_sphere = [ # 32k
246245
str(atlases / 'dHCP' / 'dHCP.week42.L.sphere.surf.gii'),
247246
str(atlases / 'dHCP' / 'dHCP.week42.R.sphere.surf.gii'),
248247
] * 3
@@ -264,6 +263,7 @@ def init_mcribs_morph_grayords_wf(
264263

265264
# fmt: off
266265
workflow.connect([
266+
(inputnode, resample, [(("sphere_reg", _triple), "current_sphere")]),
267267
(inputnode, subject_midthickness, [("surfaces", "surfaces")]),
268268
(inputnode, template_midthickness, [("midthickness_fsLR", "surfaces")]),
269269
(subject_midthickness, subject_va, [("out", "in_file")]),
@@ -292,3 +292,7 @@ def _get_surf(surfaces, name, mult=1):
292292
if not surfaces:
293293
return surfaces
294294
return [surf for surf in _sorted_by_basename(surfaces) if name in surf] * mult
295+
296+
297+
def _triple(in_list):
298+
return in_list * 3

nibabies/workflows/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ def init_single_subject_wf(
472472
('outputnode.fsnative2t1w_xfm', 'inputnode.fsnative2t1w_xfm'),
473473
('outputnode.surfaces', 'inputnode.surfaces'),
474474
('outputnode.morphometrics', 'inputnode.morphometrics'),
475+
('outputnode.anat_ribbon', 'inputnode.anat_ribbon'),
475476
('outputnode.sphere_reg_fsLR', 'inputnode.sphere_reg_fsLR'),
476477
('outputnode.midthickness_fsLR', 'inputnode.midthickness_fsLR'),
477478
]),

0 commit comments

Comments
 (0)