Skip to content

Commit fdd6312

Browse files
committed
MAINT: Update nireports, boilerplate
1 parent c91b517 commit fdd6312

File tree

3 files changed

+64
-4
lines changed

3 files changed

+64
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dependencies = [
2727
"matplotlib >= 3.5",
2828
"nibabel >= 4.0.1",
2929
"nipype >= 1.8.5",
30-
"nireports @ git+https://github.com/nipreps/nireports.git@main",
30+
"nireports >= 25.2.0",
3131
"niworkflows >= 1.13.1",
3232
"numpy >= 1.24",
3333
"packaging >= 24",

src/smriprep/cli/run.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,14 +470,20 @@ def _warn_redirect(message, category, filename, lineno, file=None, line=None):
470470
finally:
471471
from nireports.assembler.tools import generate_reports
472472

473-
from ..utils.bids import write_bidsignore, write_derivative_description
473+
from smriprep import data
474+
from smriprep.utils.bids import write_bidsignore, write_derivative_description
474475

475476
logger.log(
476477
25, 'Writing reports for participants: %s', _pprint_subses(subject_session_list)
477478
)
478479
# Generate reports phase
479480
smriprep_dir = Path(output_dir) / 'smriprep'
480-
errno += generate_reports(subject_session_list, smriprep_dir, run_uuid)
481+
bootstrap_file = data.load('reports-spec.yml')
482+
errno += generate_reports(
483+
subject_session_list,
484+
smriprep_dir, run_uuid,
485+
bootstrap_file=bootstrap_file,
486+
)
481487
write_derivative_description(bids_dir, smriprep_dir)
482488
write_bidsignore(smriprep_dir)
483489
sys.exit(int(errno > 0))
@@ -643,14 +649,22 @@ def build_workflow(opts, retval):
643649
if opts.reports_only:
644650
from nireports.assembler.tools import generate_reports
645651

652+
from smriprep import data
653+
646654
logger.log(
647655
25, 'Running --reports-only on participants %s', _pprint_subses(subject_session_list)
648656
)
649657
if opts.run_uuid is not None:
650658
run_uuid = opts.run_uuid
651659

652660
smriprep_dir = output_dir / 'smriprep'
653-
retval['return_code'] = generate_reports(subject_session_list, smriprep_dir, run_uuid)
661+
bootstrap_file = data.load('reports-spec.yml')
662+
retval['return_code'] = generate_reports(
663+
subject_session_list,
664+
smriprep_dir,
665+
run_uuid,
666+
bootstrap_file=bootstrap_file,
667+
)
654668
return retval
655669

656670
output_spaces = opts.output_spaces

src/smriprep/data/reports-spec.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package: smriprep
2+
title: Visual report for participant '{subject}'
3+
sections:
4+
- name: Summary
5+
reportlets:
6+
- bids: { datatype: figures, desc: summary, suffix: T1w }
7+
- name: Anatomical
8+
reportlets:
9+
- bids:
10+
datatype: figures
11+
desc: conform
12+
extension: [ .html ]
13+
suffix: T1w
14+
- bids: { datatype: figures, suffix: dseg }
15+
caption: This panel shows the final, preprocessed T1-weighted image, with contours delineating the detected brain mask and brain tissue segmentations.
16+
subtitle: Brain mask and brain tissue segmentation of the T1w
17+
- bids: { datatype: figures, space: .*, suffix: T1w, regex_search: True }
18+
caption: Spatial normalization of the T1w image to the <code>{space}</code> template.
19+
description: Results of nonlinear alignment of the T1w reference one or more template space(s). Hover on the panels with the mouse pointer to transition between both spaces.
20+
static: false
21+
subtitle: Spatial normalization of the anatomical T1w reference
22+
- bids: { datatype: figures, desc: reconall, suffix: T1w }
23+
caption: Surfaces (white and pial) reconstructed with FreeSurfer (<code>recon-all</code>) overlaid on the participant's T1w template.
24+
subtitle: Surface reconstruction
25+
26+
- name: About
27+
nested: true
28+
reportlets:
29+
- bids: { datatype: figures, desc: about, suffix: T1w }
30+
- custom: boilerplate
31+
path: '{out_dir}/logs'
32+
bibfile: [ 'smriprep', 'data/boilerplate.bib' ]
33+
caption: |
34+
<p>We kindly ask to report results preprocessed with this tool using the following boilerplate.</p>
35+
<p class="alert alert-info" role="alert">
36+
<strong>Copyright Waiver</strong>.
37+
The boilerplate text was automatically generated by <em>NiReports</em> with the
38+
express intention that users should copy and paste this text into their manuscripts <em>unchanged</em>.
39+
It is released under the
40+
<a href="https://creativecommons.org/publicdomain/zero/1.0/" target="_blank">CC0 license</a>.
41+
</p>
42+
title: Methods
43+
- custom: errors
44+
path: '{out_dir}/sub-{subject}/log/{run_uuid}'
45+
captions: <em>NiReports</em> may have recorded failure conditions.
46+
title: Errors

0 commit comments

Comments
 (0)