Skip to content

Commit b675937

Browse files
committed
initial connection to apply fmap
1 parent aa16cd9 commit b675937

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

dmriprep/workflows/base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,15 @@ def init_single_subject_wf(subject_id):
321321
("outputnode.t1w2fsnative_xfm", "inputnode.t1w2fsnative_xfm"),
322322
("outputnode.fsnative2t1w_xfm", "inputnode.fsnative2t1w_xfm")]),
323323
(bids_info, dwi_preproc_wf, [("subject", "inputnode.subject_id")]),
324-
])
324+
(fmap_wf, dwi_preproc_wf,
325+
[("outputnode.fmap", "inputnode.fmap"),
326+
("outputnode.fmap_ref", "inputnode.fmap"),
327+
("outputnode.fmap_coeff", "inputnode.fmap"),
328+
("outputnode.fmap_mask", "inputnode.fmap")])
325329
# fmt: on
326330

327331
if "fieldmap" in config.workflow.ignore:
332+
sdc = False
328333
return workflow
329334

330335
from sdcflows import fieldmaps as fm

dmriprep/workflows/dwi/base.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from niworkflows.engine.workflows import LiterateWorkflow as Workflow
88
from ...interfaces import DerivativesDataSink
9-
9+
from sdcflows.workflows.apply.registration import init_coeff2epi_wf
1010

1111
def init_dwi_preproc_wf(dwi_file):
1212
"""
@@ -30,6 +30,7 @@ def init_dwi_preproc_wf(dwi_file):
3030
----------
3131
dwi_file : :obj:`os.PathLike`
3232
One diffusion MRI dataset to be processed.
33+
sdc : :bool:
3334
3435
Inputs
3536
------
@@ -39,6 +40,10 @@ def init_dwi_preproc_wf(dwi_file):
3940
File path of the b-vectors
4041
in_bval
4142
File path of the b-values
43+
fmap_coeff
44+
File path of the fieldmap coefficients
45+
fmap_mask
46+
File path of the fieldmap mask
4247
4348
Outputs
4449
-------
@@ -110,6 +115,8 @@ def init_dwi_preproc_wf(dwi_file):
110115
mem_gb=config.DEFAULT_MEMORY_MIN_GB, omp_nthreads=config.nipype.omp_nthreads
111116
)
112117

118+
coeff2epi_wf = init_coeff2epi_wf(omp_nthreads=config.nipype.omp_nthreads, write_coeff=True)
119+
113120
# MAIN WORKFLOW STRUCTURE
114121
# fmt:off
115122
workflow.connect([
@@ -118,9 +125,12 @@ def init_dwi_preproc_wf(dwi_file):
118125
("in_bval", "in_bval")]),
119126
(inputnode, dwi_reference_wf, [("dwi_file", "inputnode.dwi_file")]),
120127
(gradient_table, dwi_reference_wf, [("b0_ixs", "inputnode.b0_ixs")]),
121-
(dwi_reference_wf, outputnode, [
122-
("outputnode.ref_image", "dwi_reference"),
123-
("outputnode.dwi_mask", "dwi_mask"),
128+
(dwi_reference_wf, coeff2epi_wf, [
129+
("outputnode.ref_image", "target_ref"),
130+
("outputnode.dwi_mask", "target_mask"),
131+
#outputnode, [
132+
# ("outputnode.ref_image", "dwi_reference"),
133+
# ("outputnode.dwi_mask", "dwi_mask"),
124134
]),
125135
(gradient_table, outputnode, [("out_rasb", "gradients_rasb")]),
126136
])

0 commit comments

Comments
 (0)