Skip to content

Commit

Permalink
fix tests, bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
bpinsard committed May 16, 2024
1 parent 00a20eb commit 792efd4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 5 additions & 2 deletions smriprep/workflows/anatomical.py
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ def init_anat_template_wf(
if gradunwarp_file:
nds = [
(
meta.get('NonlinearGradientCorrection', None)
not meta.get('NonlinearGradientCorrection', None)
or 'ND' in meta.get('ImageType', [])
or False
)
Expand All @@ -1498,9 +1498,12 @@ def init_anat_template_wf(
gradunwarp_file = None
if gradunwarp_file:
gradunwarp_ver = GradUnwarp.version()
workflow.__desc__ += f"""\
workflow.__desc__ = (
(workflow.__desc__ or '')
+ f"""\
{"Each" if num_files > 1 else "The"} {contrast} image was corrected for gradient
non-linearity with `gradunwarp` [@gradunwarp] {gradunwarp_ver} [@gradunwarp]\n"""
)
gradunwarp_wf = init_gradunwarp_wf('gradunward_T1w')
gradunwarp_wf.inputs.inputnode.grad_file = gradunwarp_file
# fmt:off
Expand Down
6 changes: 5 additions & 1 deletion smriprep/workflows/tests/test_anatomical.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
BASE_LAYOUT = {
'01': {
'anat': [
{'run': 1, 'suffix': 'T1w'},
{
'run': 1,
'suffix': 'T1w',
'metadata': {'ImageType': ['ND']},
},
{'run': 2, 'suffix': 'T1w'},
{'suffix': 'T2w'},
],
Expand Down

0 comments on commit 792efd4

Please sign in to comment.