Skip to content

Commit c0fe8b0

Browse files
authored
Merge pull request #2109 from tsalo/enh/remove-t2s-coreg
ENH: Remove ``--t2s-coreg`` and corresponding workflow
2 parents 3cd56d5 + 471fd9d commit c0fe8b0

File tree

6 files changed

+21
-71
lines changed

6 files changed

+21
-71
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ jobs:
779779
--config $PWD/nipype.cfg -w /tmp/${DATASET}/work \
780780
/tmp/data/${DATASET} /tmp/${DATASET}/derivatives participant \
781781
${FASTRACK_ARG} \
782-
--fs-no-reconall --t2s-coreg --use-syn-sdc \
782+
--fs-no-reconall --use-syn-sdc \
783783
--dummy-scans 1 --sloppy --write-graph \
784784
--output-spaces MNI152NLin2009cAsym \
785785
--mem_mb 4096 --nthreads 2 -vv

docs/workflows.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,5 @@ T2* Driven Coregistration
576576
If multi-echo :abbr:`BOLD (blood-oxygen level-dependent)` data is supplied,
577577
this workflow uses the `tedana`_ `T2* workflow`_ to generate an adaptive T2* map
578578
and optimally weighted combination of all supplied single echo time series.
579-
This optimaly combined time series is then carried forward for all subsequent
579+
This optimally combined time series is then carried forward for all subsequent
580580
preprocessing steps.
581-
Optionally, if the ``--t2s-coreg`` flag is supplied, the T2* map is then used
582-
in place of the :ref:`BOLD reference image <bold_ref>` to
583-
:ref:`register the BOLD series to the T1w image <bold_reg>` of the same subject.

fmriprep/cli/parser.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,6 @@ def _bids_filter(value):
142142
g_conf.add_argument(
143143
'--longitudinal', action='store_true',
144144
help='treat dataset as longitudinal - may increase runtime')
145-
g_conf.add_argument(
146-
'--t2s-coreg', action='store_true',
147-
help='If provided with multi-echo BOLD dataset, create T2*-map and perform '
148-
'T2*-driven coregistration. When multi-echo data is provided and this '
149-
'option is not enabled, standard EPI-T1 coregistration is performed '
150-
'using the middle echo.')
151145
g_conf.add_argument(
152146
'--output-spaces', nargs='*', action=OutputReferencesAction,
153147
help="""\

fmriprep/config.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,6 @@ class workflow(_Config):
452452
spaces = None
453453
"""Keeps the :py:class:`~niworkflows.utils.spaces.SpatialReferences`
454454
instance keeping standard and nonstandard spaces."""
455-
t2s_coreg = None
456-
"""Co-register echos before generating the T2\\* reference of
457-
:abbr:`ME-EPI (multi-echo echo-planar imaging)`."""
458455
use_aroma = None
459456
"""Run ICA-:abbr:`AROMA (automatic removal of motion artifacts)`."""
460457
use_bbr = None

fmriprep/workflows/bold/base.py

Lines changed: 14 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -209,17 +209,6 @@ def init_func_preproc_wf(bold_file):
209209
'slicetiming' not in config.workflow.ignore and
210210
(_get_series_len(ref_file) > 4 or "TooShort"))
211211

212-
# Check if MEEPI for T2* coregistration target
213-
if config.workflow.t2s_coreg and not multiecho:
214-
config.loggers.workflow.warning(
215-
"No multiecho BOLD images found for T2* coregistration. "
216-
"Using standard EPI-T1 coregistration.")
217-
config.workflow.t2s_coreg = False
218-
219-
# By default, force-bbr for t2s_coreg unless user specifies otherwise
220-
if config.workflow.t2s_coreg and config.workflow.use_bbr is None:
221-
config.workflow.use_bbr = True
222-
223212
# Build workflow
224213
workflow = Workflow(name=wf_name)
225214
workflow.__postdesc__ = """\
@@ -407,7 +396,6 @@ def init_func_preproc_wf(bold_file):
407396
bold_t2s_wf = init_bold_t2s_wf(echo_times=tes,
408397
mem_gb=mem_gb['resampled'],
409398
omp_nthreads=omp_nthreads,
410-
t2s_coreg=config.workflow.t2s_coreg,
411399
name='bold_t2smap_wf')
412400

413401
workflow.connect([
@@ -464,10 +452,14 @@ def init_func_preproc_wf(bold_file):
464452
('outputnode.ref_image_brain', 'inputnode.epi_brain'),
465453
('outputnode.bold_mask', 'inputnode.epi_mask')]),
466454
(bold_sdc_wf, bold_t1_trans_wf, [
467-
('outputnode.out_warp', 'inputnode.fieldwarp')]),
455+
('outputnode.out_warp', 'inputnode.fieldwarp'),
456+
('outputnode.epi_mask', 'inputnode.ref_bold_mask'),
457+
('outputnode.epi_brain', 'inputnode.ref_bold_brain')]),
468458
(bold_sdc_wf, bold_bold_trans_wf, [
469459
('outputnode.out_warp', 'inputnode.fieldwarp'),
470460
('outputnode.epi_mask', 'inputnode.bold_mask')]),
461+
(bold_sdc_wf, bold_reg_wf, [
462+
('outputnode.epi_brain', 'inputnode.ref_bold_brain')]),
471463
(bold_sdc_wf, summary, [('outputnode.method', 'distortion_correction')]),
472464
# Connect bold_confounds_wf
473465
(inputnode, bold_confounds_wf, [('t1w_tpms', 'inputnode.t1w_tpms'),
@@ -479,6 +471,9 @@ def init_func_preproc_wf(bold_file):
479471
('outputnode.itk_t1_to_bold', 'inputnode.t1_bold_xform')]),
480472
(bold_reference_wf, bold_confounds_wf, [
481473
('outputnode.skip_vols', 'inputnode.skip_vols')]),
474+
(bold_bold_trans_wf, bold_confounds_wf, [
475+
('outputnode.bold_mask', 'inputnode.bold_mask'),
476+
]),
482477
(bold_confounds_wf, outputnode, [
483478
('outputnode.confounds_file', 'confounds'),
484479
]),
@@ -494,32 +489,13 @@ def init_func_preproc_wf(bold_file):
494489
(outputnode, summary, [('confounds', 'confounds_file')]),
495490
])
496491

497-
if not config.workflow.t2s_coreg:
498-
workflow.connect([
499-
(bold_sdc_wf, bold_reg_wf, [
500-
('outputnode.epi_brain', 'inputnode.ref_bold_brain')]),
501-
(bold_sdc_wf, bold_t1_trans_wf, [
502-
('outputnode.epi_brain', 'inputnode.ref_bold_brain'),
503-
('outputnode.epi_mask', 'inputnode.ref_bold_mask')]),
504-
])
505-
else:
506-
workflow.connect([
507-
# For t2s_coreg, replace EPI-to-T1w registration inputs
508-
(bold_t2s_wf, bold_reg_wf, [
509-
('outputnode.bold_ref_brain', 'inputnode.ref_bold_brain')]),
510-
(bold_t2s_wf, bold_t1_trans_wf, [
511-
('outputnode.bold_ref_brain', 'inputnode.ref_bold_brain'),
512-
('outputnode.bold_mask', 'inputnode.ref_bold_mask')]),
513-
])
514-
515492
# for standard EPI data, pass along correct file
516493
if not multiecho:
517494
workflow.connect([
518495
(inputnode, func_derivatives_wf, [
519496
('bold_file', 'inputnode.source_file')]),
520497
(bold_bold_trans_wf, bold_confounds_wf, [
521-
('outputnode.bold', 'inputnode.bold'),
522-
('outputnode.bold_mask', 'inputnode.bold_mask')]),
498+
('outputnode.bold', 'inputnode.bold')]),
523499
(bold_split, bold_t1_trans_wf, [
524500
('out_files', 'inputnode.bold_split')]),
525501
])
@@ -531,8 +507,7 @@ def init_func_preproc_wf(bold_file):
531507
(bold_bold_trans_wf, skullstrip_bold_wf, [
532508
('outputnode.bold', 'inputnode.in_file')]),
533509
(bold_t2s_wf, bold_confounds_wf, [
534-
('outputnode.bold', 'inputnode.bold'),
535-
('outputnode.bold_mask', 'inputnode.bold_mask')]),
510+
('outputnode.bold', 'inputnode.bold')]),
536511
(bold_t2s_wf, bold_t1_trans_wf, [
537512
('outputnode.bold', 'inputnode.bold_split')]),
538513
])
@@ -607,7 +582,7 @@ def init_func_preproc_wf(bold_file):
607582
('outputnode.itk_bold_to_t1', 'transforms')]),
608583
(bold_t1_trans_wf, boldmask_to_t1w, [
609584
('outputnode.bold_mask_t1', 'reference_image')]),
610-
(bold_bold_trans_wf if not multiecho else bold_t2s_wf, boldmask_to_t1w, [
585+
(bold_bold_trans_wf, boldmask_to_t1w, [
611586
('outputnode.bold_mask', 'input_image')]),
612587
(boldmask_to_t1w, outputnode, [
613588
('output_image', 'bold_mask_t1')]),
@@ -645,7 +620,7 @@ def init_func_preproc_wf(bold_file):
645620
('outputnode.xforms', 'inputnode.hmc_xforms')]),
646621
(bold_reg_wf, bold_std_trans_wf, [
647622
('outputnode.itk_bold_to_t1', 'inputnode.itk_bold_to_t1')]),
648-
(bold_bold_trans_wf if not multiecho else bold_t2s_wf, bold_std_trans_wf, [
623+
(bold_bold_trans_wf, bold_std_trans_wf, [
649624
('outputnode.bold_mask', 'inputnode.bold_mask')]),
650625
(bold_sdc_wf, bold_std_trans_wf, [
651626
('outputnode.out_warp', 'inputnode.fieldwarp')]),
@@ -817,7 +792,8 @@ def init_func_preproc_wf(bold_file):
817792
(carpetplot_select_std, carpetplot_wf, [
818793
('std2anat_xfm', 'inputnode.std2anat_xfm')]),
819794
(bold_bold_trans_wf if not multiecho else bold_t2s_wf, carpetplot_wf, [
820-
('outputnode.bold', 'inputnode.bold'),
795+
('outputnode.bold', 'inputnode.bold')]),
796+
(bold_bold_trans_wf, carpetplot_wf, [
821797
('outputnode.bold_mask', 'inputnode.bold_mask')]),
822798
(bold_reg_wf, carpetplot_wf, [
823799
('outputnode.itk_t1_to_bold', 'inputnode.t1_bold_xform')]),

fmriprep/workflows/bold/t2s.py

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@
1919

2020
# pylint: disable=R0914
2121
def init_bold_t2s_wf(echo_times, mem_gb, omp_nthreads,
22-
t2s_coreg=False, name='bold_t2s_wf'):
22+
name='bold_t2s_wf'):
2323
"""
2424
Combine multiple echos of :abbr:`ME-EPI (multi-echo echo-planar imaging)`.
2525
2626
This workflow wraps the `tedana`_ `T2* workflow`_ to optimally
27-
combine multiple echos and derive a T2* map for optional use as a
28-
coregistration target.
27+
combine multiple echos and derive a T2* map.
2928
The following steps are performed:
3029
3130
#. :abbr:`HMC (head motion correction)` on individual echo files.
@@ -43,8 +42,6 @@ def init_bold_t2s_wf(echo_times, mem_gb, omp_nthreads,
4342
Size of BOLD file in GB
4443
omp_nthreads : :obj:`int`
4544
Maximum number of threads an individual process may use
46-
t2s_coreg : :obj:`bool`
47-
Use the calculated T2*-map for T2*-driven coregistration
4845
name : :obj:`str`
4946
Name of workflow (default: ``bold_t2s_wf``)
5047
@@ -57,14 +54,9 @@ def init_bold_t2s_wf(echo_times, mem_gb, omp_nthreads,
5754
-------
5855
bold
5956
the optimally combined time series for all supplied echos
60-
bold_mask
61-
the binarized, skull-stripped adaptive T2* map
62-
bold_ref_brain
63-
the adaptive T2* map
6457
6558
"""
6659
from niworkflows.engine.workflows import LiterateWorkflow as Workflow
67-
from niworkflows.func.util import init_skullstrip_bold_wf
6860

6961
workflow = Workflow(name=name)
7062
workflow.__desc__ = """\
@@ -74,26 +66,20 @@ def init_bold_t2s_wf(echo_times, mem_gb, omp_nthreads,
7466
used to fit the model.
7567
The calculated T2* map was then used to optimally combine preprocessed BOLD across
7668
echoes following the method described in [@posse_t2s].
77-
The optimally combined time series was carried forward as the *preprocessed BOLD*{}.
78-
""".format('' if not t2s_coreg else ', and the T2* map was also retained as the BOLD reference')
69+
The optimally combined time series was carried forward as the *preprocessed BOLD*.
70+
"""
7971

8072
inputnode = pe.Node(niu.IdentityInterface(fields=['bold_file']), name='inputnode')
8173

82-
outputnode = pe.Node(niu.IdentityInterface(fields=['bold', 'bold_mask', 'bold_ref_brain']),
83-
name='outputnode')
74+
outputnode = pe.Node(niu.IdentityInterface(fields=['bold']), name='outputnode')
8475

8576
LOGGER.log(25, 'Generating T2* map and optimally combined ME-EPI time series.')
8677

8778
t2smap_node = pe.Node(T2SMap(echo_times=echo_times), name='t2smap_node')
88-
skullstrip_t2smap_wf = init_skullstrip_bold_wf(name='skullstrip_t2smap_wf')
8979

9080
workflow.connect([
9181
(inputnode, t2smap_node, [('bold_file', 'in_files')]),
9282
(t2smap_node, outputnode, [('optimal_comb', 'bold')]),
93-
(t2smap_node, skullstrip_t2smap_wf, [('t2star_map', 'inputnode.in_file')]),
94-
(skullstrip_t2smap_wf, outputnode, [
95-
('outputnode.mask_file', 'bold_mask'),
96-
('outputnode.skull_stripped_file', 'bold_ref_brain')]),
9783
])
9884

9985
return workflow

0 commit comments

Comments
 (0)