Skip to content

Commit

Permalink
ENH: Generate separate reportlet for each reconstruction method
Browse files Browse the repository at this point in the history
  • Loading branch information
mgxd committed Dec 20, 2023
1 parent a399235 commit 90ea339
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
8 changes: 8 additions & 0 deletions nibabies/data/reports-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,17 @@ sections:
static: false
subtitle: Spatial normalization of the anatomical T1w reference
- bids: {datatype: figures, desc: reconall, suffix: T1w}
caption: Surfaces (white and pial) reconstructed with FreeSurfer (<code>recon-all</code>)
overlaid on the participant's T1w template.
subtitle: Surface reconstruction
- bids: {datatype: figures, desc: infantfs, suffix: T1w}
caption: Surfaces (white and pial) reconstructed with FreeSurfer (<code>infant_recon_all</code>)
overlaid on the participant's T1w template.
subtitle: Surface reconstruction
- bids: {datatype: figures, desc: mcribs, suffix: T2w}
caption: Surfaces (white and pial) reconstructed with M-CRIB-S (<code>MCRIBReconAll</code>)
overlaid on the participant's T2w template.
subtitle: Surface reconstruction

- name: <em>B<sub>0</sub></em> field mapping
ordering: session,acquisition,run,fmapid
Expand Down
14 changes: 9 additions & 5 deletions nibabies/workflows/anatomical/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,25 +233,29 @@ def init_anat_reports_wf(
if not surface_recon:
return workflow

# TODO: Separate report for MCRIBS?
from smriprep.interfaces.reports import FSSurfaceReport

recon_report = pe.Node(FSSurfaceReport(), name="recon_report")
recon_report.interface._always_run = True

if surface_recon == "freesurfer":
recon_desc = "reconall"
elif surface_recon == "infantfs":
recon_desc = "infantfs"
elif surface_recon == "mcribs":
recon_desc = "mcribs"

ds_recon_report = pe.Node(
DerivativesDataSink(base_directory=output_dir, desc="reconall", datatype="figures"),
DerivativesDataSink(base_directory=output_dir, desc=recon_desc, datatype="figures"),
name="ds_recon_report",
run_without_submitting=True,
)
# fmt: off
workflow.connect([
(inputnode, recon_report, [('subjects_dir', 'subjects_dir'),
('subject_id', 'subject_id')]),
(recon_report, ds_recon_report, [('out_report', 'in_file')]),
(inputnode, ds_recon_report, [('source_file', 'source_file')])
])
# fmt: on
]) # fmt: skip

return workflow

Expand Down

0 comments on commit 90ea339

Please sign in to comment.