Skip to content

Commit 55adb11

Browse files
committed
enh: finalize with plotting a report
1 parent 6b4e72a commit 55adb11

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

dmriprep/config/reports-spec.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,23 @@ sections:
4949
all b=0 found in the dataset, after accounting for signal drift.
5050
The red contour shows the brain mask calculated using this reference b=0.
5151
subtitle: Reference b=0 and brain mask
52+
- bids: {datatype: figures, desc: coreg, suffix: dwi}
53+
caption: Diffusion-weighted data and anatomical data (EPI-space and T1w-space)
54+
were aligned with <code>mri_coreg</code> (FreeSurfer).
55+
WARNING - <code>bbregister</code> refinement rejected.
56+
descriptions: Note that nearest-neighbor interpolation is used in this reportlet
57+
in order to highlight potential slice Inhomogeneities and other artifacts, whereas
58+
the final images are resampled using cubic B-Spline interpolation.
59+
static: false
60+
subtitle: Alignment of functional and anatomical MRI data (volume based)
61+
- bids: {datatype: figures, desc: bbregister, suffix: dwi}
62+
caption: Diffusion-weighted data and anatomical data (EPI-space and T1w-space)
63+
were aligned with <code>bbregister</code> (FreeSurfer).
64+
descriptions: Note that nearest-neighbor interpolation is used in this reportlet
65+
in order to highlight potential slice Inhomogeneities and other artifacts, whereas
66+
the final images are resampled using cubic B-Spline interpolation.
67+
static: false
68+
subtitle: Alignment of functional and anatomical MRI data (surface driven)
5269
- name: About
5370
reportlets:
5471
- bids: {datatype: figures, desc: about, suffix: T1w}

dmriprep/workflows/base.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,11 +362,21 @@ def init_single_subject_wf(subject_id):
362362
t1w_brain = pe.Node(ApplyMask(), name="t1w_brain")
363363

364364
bbr_wf = init_bbreg_wf(
365+
bold2t1w_dof=6,
365366
bold2t1w_init=config.workflow.dwi2t1w_init,
366367
omp_nthreads=config.nipype.omp_nthreads,
367368
use_bbr=True,
368369
)
369370

371+
ds_report_reg = pe.Node(
372+
DerivativesDataSink(base_directory=str(output_dir), datatype="figures",),
373+
name="ds_report_reg",
374+
run_without_submitting=True,
375+
)
376+
377+
def _bold_reg_suffix(fallback):
378+
return "coreg" if fallback else "bbregister"
379+
370380
# fmt:off
371381
workflow.connect([
372382
# T1w Mask
@@ -383,6 +393,9 @@ def init_single_subject_wf(subject_id):
383393
(anat_preproc_wf, bbr_wf, [
384394
("outputnode.fsnative2t1w_xfm", "inputnode.fsnative2t1w_xfm")
385395
]),
396+
(bbr_wf, ds_report_reg, [
397+
('outputnode.out_report', 'in_file'),
398+
(('outputnode.fallback', _bold_reg_suffix), 'desc')]),
386399
])
387400
# fmt:on
388401

0 commit comments

Comments
 (0)