Skip to content

Commit ad3c3c6

Browse files
committed
Work on using fmap directly.
1 parent 5128f91 commit ad3c3c6

File tree

1 file changed

+18
-10
lines changed
  • src/fmripost_aroma/workflows

1 file changed

+18
-10
lines changed

src/fmripost_aroma/workflows/base.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,7 @@ def init_single_run_wf(bold_file):
401401
'boldref2anat_xfm',
402402
'anat2std_xfm',
403403
'bold_ref_file',
404-
'fmap_ref',
405-
'fmap_coeff',
406-
'fmap_id',
404+
'fmap',
407405
'bold_mask_native',
408406
],
409407
),
@@ -419,9 +417,7 @@ def init_single_run_wf(bold_file):
419417
inputnode.inputs.boldref2anat = functional_cache['boldref2anat']
420418
inputnode.inputs.anat2mni152nlin6asym = functional_cache['anat2mni152nlin6asym']
421419
# Field maps
422-
inputnode.inputs.fmap_ref = functional_cache['fmap_ref']
423-
inputnode.inputs.fmap_coeff = functional_cache['fmap_coeff']
424-
inputnode.inputs.fmap_id = functional_cache['fmap_id']
420+
inputnode.inputs.fmap = functional_cache['fmap']
425421

426422
# Run ICA-AROMA
427423
ica_aroma_wf = init_ica_aroma_wf(bold_file=bold_file, metadata=bold_metadata, mem_gb=mem_gb)
@@ -490,6 +486,21 @@ def init_single_run_wf(bold_file):
490486
bold_MNI6_wf.inputs.inputnode.target_mask = mni6_mask
491487
bold_MNI6_wf.inputs.inputnode.target_ref_file = mni6_mask
492488

489+
# Warp desc-preproc_fieldmap to boldref space
490+
# Warp the mask as well
491+
fieldmap_to_boldref = pe.Node(
492+
ApplyTransforms(),
493+
name='fieldmap_to_boldref',
494+
)
495+
workflow.connect([
496+
(inputnode, fieldmap_to_boldref, [
497+
('fmap', 'input_image'), # XXX: not right
498+
('fmap2boldref', 'transforms'),
499+
('bold_mask_native', 'reference_image'),
500+
]),
501+
]) # fmt:skip
502+
503+
# Pass transforms and warped fieldmap to bold_MNI6_wf
493504
workflow.connect([
494505
(inputnode, bold_MNI6_wf, [
495506
('bold_hmc', 'inputnode.motion_xfm'),
@@ -498,11 +509,8 @@ def init_single_run_wf(bold_file):
498509
('anat2mni152nlin6asym', 'inputnode.anat2std_xfm'),
499510
# use mask as boldref?
500511
('bold_mask_native', 'inputnode.bold_ref_file'),
501-
# field map information
502-
('fmap_ref', 'inputnode.fmap_ref'),
503-
('fmap_coeff', 'inputnode.fmap_coeff'),
504-
('fmap_id', 'inputnode.fmap_id'),
505512
]),
513+
(fieldmap_to_boldref, bold_MNI6_wf, [('output_image', 'fmap')]),
506514
# Resample BOLD to MNI152NLin6Asym, may duplicate bold_std_wf above
507515
(stc_buffer, bold_MNI6_wf, [('bold_file', 'inputnode.bold_file')]),
508516
(bold_MNI6_wf, mni6_buffer, [('outputnode.bold_file', 'bold')]),

0 commit comments

Comments
 (0)