Skip to content

Commit

Permalink
Merge pull request #392 from effigies/enh/report-t2w-flair-usage
Browse files Browse the repository at this point in the history
ENH: Add T2w/FLAIR usage to boilerplate
  • Loading branch information
effigies authored Nov 20, 2023
2 parents c7356c3 + 910b807 commit 1860074
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions smriprep/workflows/anatomical.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def init_anat_preproc_wf(
spaces: SpatialReferences,
precomputed: dict,
omp_nthreads: int,
flair: list = (), # Remove default after callers start passing it
debug: bool = False,
sloppy: bool = False,
cifti_output: ty.Literal["91k", "170k", False] = False,
Expand Down Expand Up @@ -263,6 +264,7 @@ def init_anat_preproc_wf(
spaces=spaces,
t1w=t1w,
t2w=t2w,
flair=flair,
precomputed=precomputed,
debug=debug,
sloppy=sloppy,
Expand Down Expand Up @@ -446,6 +448,7 @@ def init_anat_fit_wf(
spaces: SpatialReferences,
precomputed: dict,
omp_nthreads: int,
flair: list = (), # Remove default after callers start passing it
debug: bool = False,
sloppy: bool = False,
name="anat_fit_wf",
Expand Down Expand Up @@ -480,6 +483,7 @@ def init_anat_fit_wf(
msm_sulc=True,
t1w=['t1w.nii.gz'],
t2w=['t2w.nii.gz'],
flair=[],
skull_strip_mode='force',
skull_strip_template=Reference('OASIS30ANTs'),
spaces=SpatialReferences(spaces=['MNI152NLin2009cAsym', 'fsaverage5']),
Expand Down Expand Up @@ -1033,6 +1037,11 @@ def init_anat_fit_wf(
hires=hires,
precomputed=precomputed,
)
if t2w or flair:
t2w_or_flair = "T2-weighted" if t2w else "FLAIR"
surface_recon_wf.__desc__ += f"""\
A {t2w_or_flair} image was used to improve pial surface refinement.
"""

# fmt:off
workflow.connect([
Expand Down
2 changes: 2 additions & 0 deletions smriprep/workflows/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ def init_single_subject_wf(
subject_data = {
"t1w": ["/completely/made/up/path/sub-01_T1w.nii.gz"],
"t2w": [],
"flair": [],
}
else:
subject_data = collect_data(layout, subject_id, bids_filters=bids_filters)[0]
Expand Down Expand Up @@ -427,6 +428,7 @@ def init_single_subject_wf(
name="anat_preproc_wf",
t1w=subject_data["t1w"],
t2w=subject_data["t2w"],
flair=subject_data["flair"],
omp_nthreads=omp_nthreads,
output_dir=output_dir,
skull_strip_fixed_seed=skull_strip_fixed_seed,
Expand Down

0 comments on commit 1860074

Please sign in to comment.