Skip to content

Commit b890160

Browse files
committed
enh: remove 'bold' appearances, use wf from fmriprep
1 parent aeaf24b commit b890160

File tree

5 files changed

+40
-292
lines changed

5 files changed

+40
-292
lines changed

dmriprep/cli/parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def _bids_filter(value):
191191
action="store",
192192
nargs="+",
193193
default=[],
194-
choices=["fieldmaps", "slicetiming", "sbref"],
194+
choices=["fieldmaps", "sbref"],
195195
help="ignore selected aspects of the input dataset to disable corresponding "
196196
"parts of the workflow (a space delimited list)",
197197
)
@@ -220,12 +220,12 @@ def _bids_filter(value):
220220
% (currentv.base_version if is_release else "latest"),
221221
)
222222
g_conf.add_argument(
223-
"--bold2t1w-init",
223+
"--dwi2t1w-init",
224224
action="store",
225225
default="register",
226226
choices=["register", "header"],
227227
help='Either "register" (the default) to initialize volumes at center or "header"'
228-
" to use the header information when coregistering BOLD to T1w images.",
228+
" to use the header information when coregistering DWI to T1w images.",
229229
)
230230

231231
# ANTs options

dmriprep/config/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,9 @@ class workflow(_Config):
425425

426426
anat_only = False
427427
"""Execute the anatomical preprocessing only."""
428+
dwi2t1w_init = "register"
429+
"""Whether to use standard coregistration ('register') or to initialize coregistration from the
430+
DWI header ('header')."""
428431
fmap_bspline = None
429432
"""Regularize fieldmaps with a field of B-Spline basis."""
430433
fmap_demean = None
@@ -436,9 +439,6 @@ class workflow(_Config):
436439
ignore = None
437440
"""Ignore particular steps for *dMRIPrep*."""
438441
longitudinal = False
439-
bold2t1w_init = "register"
440-
"""Whether to use standard coregistration ('register') or to initialize coregistration from the
441-
BOLD image-header ('header')."""
442442
"""Run FreeSurfer ``recon-all`` with the ``-logitudinal`` flag."""
443443
run_reconall = True
444444
"""Run FreeSurfer's surface reconstruction."""

dmriprep/workflows/base.py

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
from niworkflows.utils.misc import fix_multi_T1w_source_name
1313
from niworkflows.utils.spaces import Reference
1414
from smriprep.workflows.anatomical import init_anat_preproc_wf
15+
from fmriprep.workflows.bold.registration import init_bbreg_wf
1516

1617
from ..interfaces import DerivativesDataSink, BIDSDataGrabber
1718
from ..interfaces.reports import SubjectSummary, AboutSummary
1819
from ..utils.bids import collect_data
1920
from .dwi.base import init_early_b0ref_wf
2021
from .fmap.base import init_fmap_estimation_wf
21-
from .dwi.registration import init_bbreg_wf
22+
2223

2324
def init_dmriprep_wf():
2425
"""
@@ -287,7 +288,7 @@ def init_single_subject_wf(subject_id):
287288
return workflow
288289

289290
# Append the dMRI section to the existing anatomical excerpt
290-
# That way we do not need to stream down the number of bold datasets
291+
# That way we do not need to stream down the number of DWI datasets
291292
anat_preproc_wf.__postdesc__ = (
292293
(anat_preproc_wf.__postdesc__ or "")
293294
+ f"""
@@ -358,28 +359,42 @@ def init_single_subject_wf(subject_id):
358359
from niworkflows.interfaces.nibabel import ApplyMask
359360

360361
# Mask the T1w
361-
t1w_brain = pe.Node(ApplyMask(), name='t1w_brain')
362+
t1w_brain = pe.Node(ApplyMask(), name="t1w_brain")
362363

363364
bbr_wf = init_bbreg_wf(
364-
bold2t1w_init=config.workflow.bold2t1w_init,
365+
bold2t1w_init=config.workflow.dwi2t1w_init,
365366
omp_nthreads=config.nipype.omp_nthreads,
366367
use_bbr=True,
367368
)
368369

369-
workflow.connect([
370-
# T1w Mask
371-
(anat_preproc_wf, t1w_brain, [('outputnode.t1w_preproc', 'in_file'),
372-
('outputnode.t1w_mask', 'in_mask')]),
373-
# BBRegister
374-
(split_info, bbr_wf, [('dwi_file', 'inputnode.in_file')]),
375-
(t1w_brain, bbr_wf, [('out_file', 'inputnode.t1w_brain')]),
376-
(anat_preproc_wf, bbr_wf, [('outputnode.t1w_dseg', 'inputnode.t1w_dseg')]),
377-
(fsinputnode, bbr_wf, [("subjects_dir", "inputnode.subjects_dir")]),
378-
(bids_info, bbr_wf, [('subject', 'inputnode.subject_id')]),
379-
(anat_preproc_wf, bbr_wf, [
380-
('outputnode.fsnative2t1w_xfm', 'inputnode.fsnative2t1w_xfm')
381-
])
382-
])
370+
workflow.connect(
371+
[
372+
# T1w Mask
373+
(
374+
anat_preproc_wf,
375+
t1w_brain,
376+
[
377+
("outputnode.t1w_preproc", "in_file"),
378+
("outputnode.t1w_mask", "in_mask"),
379+
],
380+
),
381+
# BBRegister
382+
(split_info, bbr_wf, [("dwi_file", "inputnode.in_file")]),
383+
(t1w_brain, bbr_wf, [("out_file", "inputnode.t1w_brain")]),
384+
(
385+
anat_preproc_wf,
386+
bbr_wf,
387+
[("outputnode.t1w_dseg", "inputnode.t1w_dseg")],
388+
),
389+
(fsinputnode, bbr_wf, [("subjects_dir", "inputnode.subjects_dir")]),
390+
(bids_info, bbr_wf, [("subject", "inputnode.subject_id")]),
391+
(
392+
anat_preproc_wf,
393+
bbr_wf,
394+
[("outputnode.fsnative2t1w_xfm", "inputnode.fsnative2t1w_xfm")],
395+
),
396+
]
397+
)
383398

384399
fmap_estimation_wf = init_fmap_estimation_wf(
385400
subject_data["dwi"], debug=config.execution.debug

dmriprep/workflows/dwi/registration.py

Lines changed: 0 additions & 268 deletions
This file was deleted.

0 commit comments

Comments
 (0)