Skip to content

Commit

Permalink
Merge branch 'ME-ICA:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
BahmanTahayori authored Feb 29, 2024
2 parents 5fcf148 + 7c0b91f commit b7d08e9
Show file tree
Hide file tree
Showing 9 changed files with 316 additions and 102 deletions.
Binary file added docs/_static/t2star_plots.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions docs/outputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,22 @@ should not overly focus on carpet plots and should examine these results in cont
:height: 400px


************************
T2* and S0 Summary Plots
************************

Below the carpet plots are summary plots for the T2* and S0 maps.
Each map has two figures: a spatial map of the values and a histogram of the voxelwise values.
The T2* map should look similar to T2 maps and be brightest in the ventricles and darkest in areas of largest susceptibility.
The S0 map should roughly follow the signal-to-noise ratio and will be brightest near the surface near RF coils.

It is important to note that the histogram is limited from 0 to the 98th percentile of the data to improve readability.

.. image:: /_static/t2star_plots.png
:align: center
:height: 400px


**************************
Citable workflow summaries
**************************
Expand Down
45 changes: 34 additions & 11 deletions tedana/reporting/data/html/report_body_template.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<style type="text/css">
.brainplot {
width: 50%;
height: auto;
}

.report {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -174,21 +179,39 @@ <h1>Carpet plots</h1>
<img id="imgCarpetPlot" src="$initialCarpet" />
</div>
</div>
<div class="info">
<h1>Info</h1>
$info
</div>
<div class="carpet-plots">
<h1>T2* and S0</h1>
<h2>T2*</h2>
<div class="carpet-plots-image">
<img id="t2starBrainPlot" src="$t2starBrainPlot" class="brainplot" />
</div>
<div class="carpet-plots-image">
<img id="t2starHistogram" src="$t2starHistogram" />
</div>
<div class="about">
<h1>About tedana</h1>
$about
<h2>S0</h2>
<div class="carpet-plots-image">
<img id="s0BrainPlot" src="$s0BrainPlot" class="brainplot" />
</div>
<div class="content references">
<h1>References</h1>
<ul>
$references
</ul>
<div class="carpet-plots-image">
<img id="s0Histogram" src="$s0Histogram" />
</div>
</div>
</div>
<div class="info">
<h1>Info</h1>
$info
</div>
<div class="about">
<h1>About tedana</h1>
$about
</div>
<div class="content references">
<h1>References</h1>
<ul>
$references
</ul>
</div>

<script type="text/javascript">
function updateCarpetPlot(name) {
Expand Down
23 changes: 16 additions & 7 deletions tedana/reporting/html_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from pybtex.plugin import find_plugin

from tedana import __version__
from tedana.io import load_json
from tedana.io import OutputGenerator, load_json
from tedana.reporting import dynamic_figures as df

LGR = logging.getLogger("GENERAL")
Expand Down Expand Up @@ -143,6 +143,12 @@ def _update_template_bokeh(bokeh_id, info_table, about, prefix, references, boke
# Initial carpet plot (default one)
initial_carpet = f"./figures/{prefix}carpet_optcom.svg"

# T2* and S0 images
t2star_brain = f"./figures/{prefix}t2star_brain.svg"
t2star_histogram = f"./figures/{prefix}t2star_histogram.svg"
s0_brain = f"./figures/{prefix}s0_brain.svg"
s0_histogram = f"./figures/{prefix}s0_histogram.svg"

# Convert bibtex to html
references, bibliography = _bib2html(references)

Expand All @@ -159,6 +165,10 @@ def _update_template_bokeh(bokeh_id, info_table, about, prefix, references, boke
about=about,
prefix=prefix,
initialCarpet=initial_carpet,
t2starBrainPlot=t2star_brain,
t2starHistogram=t2star_histogram,
s0BrainPlot=s0_brain,
s0Histogram=s0_histogram,
references=references,
javascript=bokeh_js,
buttons=buttons,
Expand Down Expand Up @@ -212,18 +222,17 @@ def _generate_info_table(info_dict):
return info_html


def generate_report(io_generator):
def generate_report(io_generator: OutputGenerator) -> None:
"""Generate an HTML report.
Parameters
----------
io_generator : tedana.io.OutputGenerator
io_generator : :obj:`tedana.io.OutputGenerator`
io_generator object for this workflow's output
Returns
-------
HTML : file
A generated HTML report
Notes
-----
This writes out an HTML report to a file.
"""
# Load the component time series
comp_ts_path = io_generator.get_name("ICA mixing tsv")
Expand Down
Loading

0 comments on commit b7d08e9

Please sign in to comment.