Skip to content

Commit

Permalink
enh: add background mosaic
Browse files Browse the repository at this point in the history
  • Loading branch information
oesteban committed May 23, 2023
1 parent 05203d3 commit 8cb88fb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
10 changes: 5 additions & 5 deletions mriqc/data/bootstrap-dwi.yml
Expand Up @@ -31,11 +31,6 @@ sections:
- name: Summary
reportlets:
- bids: {datatype: figures, desc: summary, extension: [.html]}
- bids: {datatype: figures, desc: background}
caption: This panel shows a mosaic enhancing the background around the head.
Artifacts usually unveil themselves in the air surrounding the head, where no signal
sources are present.
subtitle: View of the background of the voxel-wise average of the DWI orientations
- name: DWI shells
ordering: bval
reportlets:
Expand All @@ -51,6 +46,11 @@ sections:
such as those intrinsic to SMS parallelization.
subtitle: Voxel-wise standard deviation calculated across volumes in this <em>DWI shell</em>,
zoomed-in covering just the brain
- bids: {datatype: figures, desc: background}
caption: This panel shows a mosaic enhancing the background around the head.
Artifacts usually unveil themselves in the air surrounding the head, where no signal
sources are present.
subtitle: View of the background of the voxel-wise average of this <em>DWI shell</em>
- name: Extended visual report
reportlets:
- bids: {datatype: figures, desc: background}
Expand Down
2 changes: 1 addition & 1 deletion mriqc/reports/individual.py
Expand Up @@ -78,7 +78,7 @@ def _single_report(in_file):
prov["Versions_TemplateFlow"] = config.environment.templateflow_version

bids_meta = config.execution.layout.get_file(in_file).get_metadata()
bids_meta.pop("global")
bids_meta.pop("global", None)

robj = Report(
config.execution.output_dir,
Expand Down
18 changes: 17 additions & 1 deletion mriqc/workflows/diffusion/output.py
Expand Up @@ -101,7 +101,7 @@ def init_dwi_report_wf(name="dwi_report_wf"):
only_noise=True,
cmap="viridis_r",
),
name="PlotMosaicNoise",
name="mosaic_noise",
)

if config.workflow.species.lower() in ("rat", "mouse"):
Expand Down Expand Up @@ -134,6 +134,18 @@ def init_dwi_report_wf(name="dwi_report_wf"):
iterfield=["in_file", "bval"],
)

ds_report_noise = pe.MapNode(
DerivativesDataSink(
base_directory=reportlets_dir,
desc="background",
datatype="figures",
allowed_entities=("bval",),
),
name="ds_report_noise",
run_without_submitting=True,
iterfield=["in_file", "bval"],
)

def _gen_entity(inlist):
return ["00000"] + [f"{int(round(bval, 0)):05d}" for bval in inlist]

Expand All @@ -143,12 +155,16 @@ def _gen_entity(inlist):
("brainmask", "bbox_mask_file")]),
(inputnode, mosaic_stddev, [("in_stdmap", "in_file"),
("brainmask", "bbox_mask_file")]),
(inputnode, mosaic_noise, [("in_avgmap", "in_file")]),
(inputnode, ds_report_mean, [("name_source", "source_file"),
(("in_shells", _gen_entity), "bval")]),
(inputnode, ds_report_stdev, [("name_source", "source_file"),
(("in_shells", _gen_entity), "bval")]),
(inputnode, ds_report_noise, [("name_source", "source_file"),
(("in_shells", _gen_entity), "bval")]),
(mosaic_mean, ds_report_mean, [("out_file", "in_file")]),
(mosaic_stddev, ds_report_stdev, [("out_file", "in_file")]),
(mosaic_noise, ds_report_mean, [("out_file", "in_file")]),
])
# fmt: on

Expand Down

0 comments on commit 8cb88fb

Please sign in to comment.