Skip to content

Commit 1860074

Browse files
authored
Merge pull request #392 from effigies/enh/report-t2w-flair-usage
ENH: Add T2w/FLAIR usage to boilerplate
2 parents c7356c3 + 910b807 commit 1860074

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

smriprep/workflows/anatomical.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def init_anat_preproc_wf(
100100
spaces: SpatialReferences,
101101
precomputed: dict,
102102
omp_nthreads: int,
103+
flair: list = (), # Remove default after callers start passing it
103104
debug: bool = False,
104105
sloppy: bool = False,
105106
cifti_output: ty.Literal["91k", "170k", False] = False,
@@ -263,6 +264,7 @@ def init_anat_preproc_wf(
263264
spaces=spaces,
264265
t1w=t1w,
265266
t2w=t2w,
267+
flair=flair,
266268
precomputed=precomputed,
267269
debug=debug,
268270
sloppy=sloppy,
@@ -446,6 +448,7 @@ def init_anat_fit_wf(
446448
spaces: SpatialReferences,
447449
precomputed: dict,
448450
omp_nthreads: int,
451+
flair: list = (), # Remove default after callers start passing it
449452
debug: bool = False,
450453
sloppy: bool = False,
451454
name="anat_fit_wf",
@@ -480,6 +483,7 @@ def init_anat_fit_wf(
480483
msm_sulc=True,
481484
t1w=['t1w.nii.gz'],
482485
t2w=['t2w.nii.gz'],
486+
flair=[],
483487
skull_strip_mode='force',
484488
skull_strip_template=Reference('OASIS30ANTs'),
485489
spaces=SpatialReferences(spaces=['MNI152NLin2009cAsym', 'fsaverage5']),
@@ -1033,6 +1037,11 @@ def init_anat_fit_wf(
10331037
hires=hires,
10341038
precomputed=precomputed,
10351039
)
1040+
if t2w or flair:
1041+
t2w_or_flair = "T2-weighted" if t2w else "FLAIR"
1042+
surface_recon_wf.__desc__ += f"""\
1043+
A {t2w_or_flair} image was used to improve pial surface refinement.
1044+
"""
10361045

10371046
# fmt:off
10381047
workflow.connect([

smriprep/workflows/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ def init_single_subject_wf(
331331
subject_data = {
332332
"t1w": ["/completely/made/up/path/sub-01_T1w.nii.gz"],
333333
"t2w": [],
334+
"flair": [],
334335
}
335336
else:
336337
subject_data = collect_data(layout, subject_id, bids_filters=bids_filters)[0]
@@ -427,6 +428,7 @@ def init_single_subject_wf(
427428
name="anat_preproc_wf",
428429
t1w=subject_data["t1w"],
429430
t2w=subject_data["t2w"],
431+
flair=subject_data["flair"],
430432
omp_nthreads=omp_nthreads,
431433
output_dir=output_dir,
432434
skull_strip_fixed_seed=skull_strip_fixed_seed,

0 commit comments

Comments
 (0)