Skip to content

Commit

Permalink
Merge pull request #2781 from effigies/enh/t2s_hist_bounds
Browse files Browse the repository at this point in the history
ENH: Clip T2* values at 100ms to keep consistent histogram axes
  • Loading branch information
effigies authored May 20, 2022
2 parents 26d7fae + 3fe8832 commit 8c89cc1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion fmriprep/data/reports-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ sections:
subtitle: T2* map
- bids: {datatype: figures, desc: t2starhist, suffix: bold}
caption: A histogram of estimated T2* values within the anatomically-derived gray-matter mask
shown in the previous plot.
shown in the previous plot. Note that values are clipped at 100ms, so any extreme outliers will
appear in the 100ms bin.
static: false
subtitle: T2* gray-matter values
- bids: {datatype: figures, desc: flirtnobbr, suffix: bold}
Expand Down
9 changes: 6 additions & 3 deletions fmriprep/workflows/bold/t2s.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from nipype.interfaces import utility as niu

from ...interfaces.multiecho import T2SMap
from ...interfaces.maths import Label2Mask
from ...interfaces.maths import Label2Mask, Clip
from ...interfaces.reports import LabeledHistogram
from ... import config

Expand Down Expand Up @@ -135,7 +135,7 @@ def init_t2s_reporting_wf(name='t2s_reporting_wf'):
boldref
reference BOLD file
label_file
an integer label file identifying grey matter with value ``1``
an integer label file identifying gray matter with value ``1``
label_bold_xform
Affine matrix that maps the label file into alignment with the native
BOLD space; can be ``"identity"`` if label file is already aligned
Expand Down Expand Up @@ -169,6 +169,8 @@ def init_t2s_reporting_wf(name='t2s_reporting_wf'):

gm_mask = pe.Node(Label2Mask(label_val=1), name="gm_mask")

clip_t2star = pe.Node(Clip(maximum=0.1), name="clip_t2star")

t2s_hist = pe.Node(LabeledHistogram(mapping={1: "Gray matter"}, xlabel='T2* (s)'),
name='t2s_hist')

Expand All @@ -186,7 +188,8 @@ def init_t2s_reporting_wf(name='t2s_reporting_wf'):
(inputnode, label_tfm, [('label_file', 'input_image'),
('t2star_file', 'reference_image'),
('label_bold_xform', 'transforms')]),
(inputnode, t2s_hist, [('t2star_file', 'in_file')]),
(inputnode, clip_t2star, [('t2star_file', 'in_file')]),
(clip_t2star, t2s_hist, [('out_file', 'in_file')]),
(label_tfm, gm_mask, [('output_image', 'in_file')]),
(gm_mask, t2s_hist, [('out_file', 'label_file')]),
(inputnode, t2s_comparison, [('boldref', 'before'),
Expand Down

0 comments on commit 8c89cc1

Please sign in to comment.