Skip to content

Commit 5282950

Browse files
authored
Merge pull request #34 from oesteban/enh/reportlet
ENH: Set up customized report specification
2 parents 3a0341f + 2e8aadf commit 5282950

File tree

6 files changed

+49
-14
lines changed

6 files changed

+49
-14
lines changed

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ include LICENSE
55
# versioneer
66
include versioneer.py
77
include dmriprep/_version.py
8+
9+
# data
10+
include dmriprep/config/reports-spec.yml

dmriprep/cli/run.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,9 @@ def main():
384384

385385
# Generate reports phase
386386
failed_reports = generate_reports(
387-
subject_list, output_dir, work_dir, run_uuid, packagename='dmriprep')
387+
subject_list, output_dir, work_dir, run_uuid,
388+
config=pkgrf('dmriprep', 'config/reports-spec.yml'),
389+
packagename='dmriprep')
388390
write_derivative_description(bids_dir, output_dir / 'dmriprep')
389391

390392
if failed_reports and not opts.notrack:
@@ -524,12 +526,14 @@ def build_workflow(opts, retval):
524526

525527
# Called with reports only
526528
if opts.reports_only:
529+
from pkg_resources import resource_filename as pkgrf
527530
build_log.log(25, 'Running --reports-only on participants %s', ', '.join(subject_list))
528531
if opts.run_uuid is not None:
529532
run_uuid = opts.run_uuid
530533
retval['run_uuid'] = run_uuid
531534
retval['return_code'] = generate_reports(
532535
subject_list, output_dir, work_dir, run_uuid,
536+
config=pkgrf('dmriprep', 'config/reports-spec.yml'),
533537
packagename='dmriprep')
534538
return retval
535539

dmriprep/config/reports-spec.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package: dmriprep
2+
sections:
3+
- name: Summary
4+
reportlets:
5+
- bids: {datatype: anat, desc: summary, suffix: T1w}
6+
- name: Anatomical
7+
reportlets:
8+
- bids:
9+
datatype: anat
10+
desc: conform
11+
extension: [.html]
12+
suffix: T1w
13+
- bids: {datatype: anat, suffix: dseg}
14+
caption: This panel shows the template T1-weighted image (if several T1w images
15+
were found), with contours delineating the detected brain mask and brain tissue
16+
segmentations.
17+
subtitle: Brain mask and brain tissue segmentation of the T1w
18+
- bids: {datatype: anat, space: .*, suffix: T1w, regex_search: True}
19+
caption: Spatial normalization of the T1w image to the <code>{space}</code> template.
20+
description: Results of nonlinear alignment of the T1w reference one or more template
21+
space(s). Hover on the panels with the mouse pointer to transition between both
22+
spaces.
23+
static: false
24+
subtitle: Spatial normalization of the anatomical T1w reference
25+
- bids: {datatype: anat, desc: reconall, suffix: T1w}
26+
caption: Surfaces (white and pial) reconstructed with FreeSurfer (<code>recon-all</code>)
27+
overlaid on the participant's T1w template.
28+
subtitle: Surface reconstruction
29+
- name: About
30+
reportlets:
31+
- bids: {datatype: anat, desc: about, suffix: T1w}

dmriprep/workflows/base.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010

1111
import sys
1212
import os
13+
from packaging.version import Version
1314
from collections import OrderedDict
1415
from copy import deepcopy
1516

1617
from nipype import __version__ as nipype_ver
1718
from nipype.pipeline import engine as pe
1819
from nipype.interfaces import utility as niu
19-
from nilearn import __version__ as nilearn_ver
2020

2121
from niworkflows.engine.workflows import LiterateWorkflow as Workflow
2222
from niworkflows.interfaces.bids import (
@@ -340,12 +340,9 @@ def init_single_subject_wf(
340340
""".format(dmriprep_ver=__version__, nipype_ver=nipype_ver)
341341
workflow.__postdesc__ = """
342342
343-
Many internal operations of *dMRIPrep* use
344-
*Nilearn* {nilearn_ver} [@nilearn, RRID:SCR_001362],
345-
mostly within the diffusion MRI processing workflow.
346343
For more details of the pipeline, see [the section corresponding
347344
to workflows in *dMRIPrep*'s documentation]\
348-
(https://dmriprep.readthedocs.io/en/latest/workflows.html \
345+
(https://nipreps.github.io/dmriprep/{dmriprep_ver}/workflows.html \
349346
"dMRIPrep's documentation").
350347
351348
@@ -359,7 +356,7 @@ def init_single_subject_wf(
359356
360357
### References
361358
362-
""".format(nilearn_ver=nilearn_ver)
359+
""".format(dmriprep_ver=Version(__version__).public)
363360

364361
# Filter out standard spaces to a separate dict
365362
std_spaces = OrderedDict([

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ niworkflows ~= 1.1.0
66
packaging
77
pydot>=1.2.3
88
pydotplus
9-
smriprep ~= 0.4.0
9+
smriprep ~= 0.4.1
1010
sphinx-argparse
1111
sphinx>=2.1.2
1212
sphinx_rtd_theme

setup.cfg

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,23 @@ classifiers =
1313
Intended Audience :: Science/Research
1414
Topic :: Scientific/Engineering :: Image Recognition
1515
License :: OSI Approved :: BSD License
16-
Programming Language :: Python :: 3.5
1716
Programming Language :: Python :: 3.6
1817
Programming Language :: Python :: 3.7
18+
Programming Language :: Python :: 3.8
1919

2020
[options]
2121
python_requires = >=3.5
2222
install_requires =
23-
dipy >= 1.0.0
23+
dipy >=1.0.0
2424
indexed_gzip >=0.8.8
2525
nibabel ~= 3.0.0rc1
26-
nilearn !=0.5.0, !=0.5.1
2726
nipype ~= 1.3.1
2827
niworkflows ~= 1.1.0
2928
numpy
30-
psutil >=5.4
3129
pybids ~= 0.9.2
3230
pyyaml
3331
smriprep ~= 0.4.1
34-
templateflow ~= 0.4.2rc
32+
templateflow ~= 0.4.2rc1
3533
test_requires =
3634
codecov
3735
coverage
@@ -58,7 +56,7 @@ doc =
5856
docs =
5957
%(doc)s
6058
duecredit = duecredit
61-
resmon =
59+
resmon = psutil >=5.4
6260
sentry = sentry-sdk >=0.6.9
6361
style =
6462
flake8 >= 3.7.0
@@ -73,13 +71,15 @@ all =
7371
%(datalad)s
7472
%(doc)s
7573
%(duecredit)s
74+
%(resmon)s
7675
%(sentry)s
7776
%(tests)s
7877

7978
[options.package_data]
8079
dmriprep =
8180
VERSION
8281
data/boilerplate.bib
82+
config/reports-spec.yml
8383

8484
[options.entry_points]
8585
console_scripts =

0 commit comments

Comments
 (0)