Skip to content

Commit 375ce6e

Browse files
committed
Start addressing review.
1 parent b90c126 commit 375ce6e

File tree

2 files changed

+17
-21
lines changed

2 files changed

+17
-21
lines changed

src/fmripost_aroma/workflows/base.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -486,20 +486,6 @@ def init_single_run_wf(bold_file):
486486
bold_MNI6_wf.inputs.inputnode.target_mask = mni6_mask
487487
bold_MNI6_wf.inputs.inputnode.target_ref_file = mni6_mask
488488

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-
503489
# Pass transforms and warped fieldmap to bold_MNI6_wf
504490
workflow.connect([
505491
(inputnode, bold_MNI6_wf, [
@@ -510,7 +496,6 @@ def init_single_run_wf(bold_file):
510496
# use mask as boldref?
511497
('bold_mask_native', 'inputnode.bold_ref_file'),
512498
]),
513-
(fieldmap_to_boldref, bold_MNI6_wf, [('output_image', 'fmap')]),
514499
# Resample BOLD to MNI152NLin6Asym, may duplicate bold_std_wf above
515500
(stc_buffer, bold_MNI6_wf, [('bold_file', 'inputnode.bold_file')]),
516501
(bold_MNI6_wf, mni6_buffer, [('outputnode.bold_file', 'bold')]),

src/fmripost_aroma/workflows/resample.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import nipype.pipeline.engine as pe
55
from fmriprep.interfaces.resampling import DistortionParameters, ResampleSeries
66
from niworkflows.interfaces.nibabel import GenerateSamplingReference
7-
from niworkflows.interfaces.utility import KeySelect
87

98

109
def init_bold_volumetric_resample_wf(
@@ -81,6 +80,8 @@ def init_bold_volumetric_resample_wf(
8180
further images into the BOLD series' space.
8281
8382
"""
83+
from fmripost_aroma.interfaces.misc import ApplyTransforms
84+
8485
workflow = pe.Workflow(name=name)
8586

8687
inputnode = pe.Node(
@@ -145,19 +146,29 @@ def init_bold_volumetric_resample_wf(
145146
if not fieldmap_id:
146147
return workflow
147148

149+
# Warp desc-preproc_fieldmap to boldref space
150+
# Warp the mask as well
151+
fieldmap_to_boldref = pe.Node(
152+
ApplyTransforms(),
153+
name='fieldmap_to_boldref',
154+
)
155+
workflow.connect([
156+
(inputnode, fieldmap_to_boldref, [
157+
('fmap', 'input_image'), # XXX: not right
158+
('fmap2boldref', 'transforms'),
159+
('bold_mask_native', 'reference_image'),
160+
]),
161+
]) # fmt:skip
162+
148163
distortion_params = pe.Node(
149164
DistortionParameters(metadata=metadata),
150165
name='distortion_params',
151166
run_without_submitting=True,
152167
)
153168
workflow.connect([
154-
(inputnode, fmap_select, [
155-
('fmap', 'fmap_ref'),
156-
('fmap_id', 'keys'),
157-
]),
158169
(inputnode, distortion_params, [('bold_file', 'in_file')]),
159170
# Inject fieldmap correction into resample node
160-
(fmap_select, resample, [('fmap', 'fieldmap')]),
171+
(fieldmap_to_boldref, resample, [('fmap', 'fieldmap')]),
161172
(distortion_params, resample, [
162173
('readout_time', 'ro_time'),
163174
('pe_direction', 'pe_dir'),

0 commit comments

Comments
 (0)