Skip to content

Commit

Permalink
Merge pull request #1164 from celprov/fix/multi-echo-report
Browse files Browse the repository at this point in the history
FIX: Rearrange multi-echo report
  • Loading branch information
celprov authored Dec 15, 2023
2 parents d10c981 + 9cb24e0 commit 24f786a
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 75 deletions.
35 changes: 18 additions & 17 deletions mriqc/data/bootstrap-func.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,28 @@ sections:
- bids: {datatype: figures, desc: stdev}
subtitle: Standard deviation of signal through time
caption: The voxel-wise standard deviation of the signal (variability along time).
- 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 BOLD timeseries
- bids: {datatype: figures, desc: zoomed}
caption: This panel shows a mosaic of the brain. This mosaic is the most suitable to
screen head-motion intensity inhomogeneities, global/local noise, signal leakage
(for example, from the eyeballs and across the phase-encoding axis), etc.
subtitle: Voxel-wise average of BOLD time-series, zoomed-in covering just the brain
- bids: {datatype: figures, desc: carpet}
subtitle: Carpetplot and nuisance signals
caption: The so-called «carpetplot» may assist in assessing head-motion
derived artifacts and respiation effects.

- name: Extended echo-wise reports
ordering: echo
reportlets:
- bids: {datatype: figures, desc: mean}
subtitle: Voxel-wise average of BOLD time-series
caption: The average signal calculated across the last axis (time).

- name: Extended reports shared across echos
reportlets:
- bids: {datatype: figures, desc: brainmask}
Expand All @@ -54,23 +72,6 @@ sections:
subtitle: Spatial normalization of the anatomical image
static: false

- name: Extended echo-wise reports
ordering: echo
reportlets:
- 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 BOLD timeseries
- bids: {datatype: figures, desc: mean}
subtitle: Average signal through time
caption: The average signal calculated across the last axis (time).
- bids: {datatype: figures, desc: zoomed}
caption: This panel shows a mosaic of the brain. This mosaic is the most suitable to
screen head-motion intensity inhomogeneities, global/local noise, signal leakage
(for example, from the eyeballs and across the phase-encoding axis), etc.
subtitle: Voxel-wise average of BOLD time-series, zoomed-in covering just the brain

- name: About
nested: true
reportlets:
Expand Down
116 changes: 58 additions & 58 deletions mriqc/workflows/functional/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,35 @@ def init_func_report_wf(name="func_report_wf"):
iterfield=["in_file"],
)

mosaic_zoom = pe.MapNode(
PlotMosaic(
cmap="Greys_r",
),
name="PlotMosaicZoomed",
iterfield=["in_file"],
)

mosaic_noise = pe.MapNode(
PlotMosaic(
only_noise=True,
cmap="viridis_r",
),
name="PlotMosaicNoise",
iterfield=["in_file"],
)

if config.workflow.species.lower() in ("rat", "mouse"):
mosaic_mean.inputs.view = ["coronal", "axial"]
mosaic_stddev.inputs.view = ["coronal", "axial"]
mosaic_zoom.inputs.view = ["coronal", "axial"]
mosaic_noise.inputs.view = ["coronal", "axial"]

ds_report_mean = pe.MapNode(
DerivativesDataSink(
base_directory=reportlets_dir,
desc="mean",
datatype="figures",
dismiss_entities=("part",)
dismiss_entities=("part",),
),
name="ds_report_mean",
run_without_submitting=True,
Expand All @@ -168,19 +191,43 @@ def init_func_report_wf(name="func_report_wf"):
base_directory=reportlets_dir,
desc="stdev",
datatype="figures",
dismiss_entities=("part",)
dismiss_entities=("part",),
),
name="ds_report_stdev",
run_without_submitting=True,
iterfield=["in_file", "source_file"],
)

ds_report_background = pe.MapNode(
DerivativesDataSink(
base_directory=reportlets_dir,
desc="background",
datatype="figures",
dismiss_entities=("part",),
),
name="ds_report_background",
run_without_submitting=True,
iterfield=["in_file", "source_file"],
)

ds_report_zoomed = pe.MapNode(
DerivativesDataSink(
base_directory=reportlets_dir,
desc="zoomed",
datatype="figures",
dismiss_entities=("part",),
),
name="ds_report_zoomed",
run_without_submitting=True,
iterfield=["in_file", "source_file"],
)

ds_report_carpet = pe.MapNode(
DerivativesDataSink(
base_directory=reportlets_dir,
desc="carpet",
datatype="figures",
dismiss_entities=("part",)
dismiss_entities=("part",),
),
name="ds_report_carpet",
run_without_submitting=True,
Expand All @@ -194,9 +241,16 @@ def init_func_report_wf(name="func_report_wf"):
(inputnode, mosaic_stddev, [("in_stddev", "in_file")]),
(inputnode, ds_report_mean, [("name_source", "source_file")]),
(inputnode, ds_report_stdev, [("name_source", "source_file")]),
(inputnode, ds_report_background, [("name_source", "source_file")]),
(inputnode, ds_report_zoomed, [("name_source", "source_file")]),
(inputnode, ds_report_carpet, [("name_source", "source_file")]),
(inputnode, mosaic_zoom, [("epi_mean", "in_file"),
("brainmask", "bbox_mask_file")]),
(inputnode, mosaic_noise, [("epi_mean", "in_file")]),
(mosaic_mean, ds_report_mean, [("out_file", "in_file")]),
(mosaic_stddev, ds_report_stdev, [("out_file", "in_file")]),
(mosaic_noise, ds_report_background, [("out_file", "in_file")]),
(mosaic_zoom, ds_report_zoomed, [("out_file", "in_file")]),
(bigplot, ds_report_carpet, [("out_file", "in_file")]),
])
# fmt: on
Expand All @@ -216,7 +270,7 @@ def init_func_report_wf(name="func_report_wf"):
base_directory=reportlets_dir,
desc="spikes",
datatype="figures",
dismiss_entities=("part",)
dismiss_entities=("part",),
),
name="ds_report_spikes",
run_without_submitting=True,
Expand All @@ -239,29 +293,6 @@ def init_func_report_wf(name="func_report_wf"):
from niworkflows.utils.connections import pop_file as _pop
from nireports.interfaces import PlotContours

mosaic_zoom = pe.MapNode(
PlotMosaic(
cmap="Greys_r",
),
name="PlotMosaicZoomed",
iterfield=["in_file"],
)

mosaic_noise = pe.MapNode(
PlotMosaic(
only_noise=True,
cmap="viridis_r",
),
name="PlotMosaicNoise",
iterfield=["in_file"]
)

if config.workflow.species.lower() in ("rat", "mouse"):
mosaic_mean.inputs.view = ["coronal", "axial"]
mosaic_stddev.inputs.view = ["coronal", "axial"]
mosaic_zoom.inputs.view = ["coronal", "axial"]
mosaic_noise.inputs.view = ["coronal", "axial"]

plot_bmask = pe.Node(
PlotContours(
display_mode="y" if config.workflow.species.lower() in ("rat", "mouse") else "z",
Expand All @@ -273,30 +304,6 @@ def init_func_report_wf(name="func_report_wf"):
name="PlotBrainmask",
)

ds_report_zoomed = pe.MapNode(
DerivativesDataSink(
base_directory=reportlets_dir,
desc="zoomed",
datatype="figures",
dismiss_entities=("part",)
),
name="ds_report_zoomed",
run_without_submitting=True,
iterfield=["in_file", "source_file"],
)

ds_report_background = pe.MapNode(
DerivativesDataSink(
base_directory=reportlets_dir,
desc="background",
datatype="figures",
dismiss_entities=("part",)
),
name="ds_report_background",
run_without_submitting=True,
iterfield=["in_file", "source_file"],
)

ds_report_bmask = pe.Node(
DerivativesDataSink(
base_directory=reportlets_dir,
Expand Down Expand Up @@ -325,14 +332,7 @@ def init_func_report_wf(name="func_report_wf"):
("name_source", "source_file")]),
(inputnode, plot_bmask, [(("epi_mean", _pop), "in_file"),
("brainmask", "in_contours")]),
(inputnode, mosaic_zoom, [("epi_mean", "in_file"),
("brainmask", "bbox_mask_file")]),
(inputnode, mosaic_noise, [("epi_mean", "in_file")]),
(inputnode, ds_report_zoomed, [("name_source", "source_file")]),
(inputnode, ds_report_background, [("name_source", "source_file")]),
(inputnode, ds_report_bmask, [("name_source", "source_file")]),
(mosaic_zoom, ds_report_zoomed, [("out_file", "in_file")]),
(mosaic_noise, ds_report_background, [("out_file", "in_file")]),
(plot_bmask, ds_report_bmask, [(("out_file", _pop), "in_file")]),
])
# fmt: on
Expand Down

0 comments on commit 24f786a

Please sign in to comment.