Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions osl_ephys/report/src_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ def gen_html_data(config, outdir, subject, reportdir, logger=None, extra_funcs=N
data["plt_filters_svd"] = f"{subject}/filters_svd.png"
copy("{}/{}".format(outdir, data["filters_svd_plot"]), "{}/{}/filters_svd.png".format(reportdir, subject))

if "dipole_locations_plot" in data:
data["plt_dipole_locations"] = f"{subject}/dipole_locations.html" # this might not have been rendered yet (if using dask), so potentially need to copy it over later
copy("{}/{}".format(outdir, data["dipole_locations_plot"]), "{}/{}/dipole_locations.html".format(reportdir, subject))

if "parc_psd_plot" in data:
data["plt_parc_psd"] = f"{subject}/parc_psd.png"
copy("{}/{}".format(outdir, data["parc_psd_plot"]), "{}/{}/parc_psd.png".format(reportdir, subject))
Expand Down Expand Up @@ -157,6 +161,7 @@ def gen_html_page(reportdir):
# Load HTML data
data = []
for subdir in subdirs:

subdir = Path(subdir)
# Just generate the html page with the successful runs
try:
Expand Down Expand Up @@ -464,6 +469,7 @@ def add_to_data(data_file, info):
Info to add.
"""
data_file = Path(data_file)

if data_file.exists():
data = pickle.load(open(data_file, "rb"))
else:
Expand Down
40 changes: 27 additions & 13 deletions osl_ephys/report/templates/src_subject_panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,32 @@ <h3>Coregistration
{% endif %}

{% if data.beamform or data.beamform_and_parcellate %}
<div class="tabpage" style='width: 100%; display: none' id={{ data.fif_id }}_beamforming>
<h3>Beamforming</h3>
<span style="margin-right: 10px;"></span>
<button style="cursor: help; border: 1px solid; background-color: lightblue; color: black; padding: 2px 5px; font-size: 12px;"
title="Does the covariance look sensible (i.e., not dominated by a single channel pair)? Do the eigenvalues drop off gradually before suddenly dropping to zero? Is the rank what you'd expect?">
?
</button>
<div>LCMV Filter</div>
<div style="width: 70%; margin: auto">
<img src="{{ data.plt_filters_cov }}" alt="" style='max-width: 100%'/>
<img src="{{ data.plt_filters_svd }}" alt="" style='max-width: 100%'/>
</div>
<div class="tabpage" style='width: 100%' id={{ data.fif_id }}_beamforming>
<h3>Beamforming</h3>
<span style="margin-right: 10px;"></span>
<button style="cursor: help; border: 1px solid; background-color: lightblue; color: black; padding: 2px 5px; font-size: 12px;"
title="Does the covariance look sensible (i.e., not dominated by a single channel pair)? Do the eigenvalues drop off gradually before suddenly dropping to zero? Is the rank what you'd expect?">
?
</button>
<div>LCMV Filter</div>
<div style="width: 70%; margin: auto">
<img src="{{ data.plt_filters_cov }}" alt="" style='max-width: 100%'/>
<img src="{{ data.plt_filters_svd }}" alt="" style='max-width: 100%'/>
</div>
<div>Dipole types and locations</div>
<iframe data-src="{{ data.plt_dipole_locations }}" width="525" height="525" id="{{ data.fif_id}}_beamforming_iframe"></iframe>
<div>
Click and drag to rotate and scroll to zoom.</br>
Blue dots are dipoles that will be treated as single dipoles.</br>
</br>
If a (non-patched) bilateral beamformer is being used:</br>
- Red lines connect dipole "pairs" that will be beamformed together.</br>
- Green dots are "midline" dipoles that will be treated as single dipoles.</br>
</br>
If a patch (multi-dipole) beamformer is being used:</br>
- Multi-coloured dots are dipoles that belong to multi-dipole patches,</br>
the color indicates the patch each dipole belongs to.
</div>
</div>
{% endif %}

Expand Down Expand Up @@ -167,7 +181,6 @@ <h4>Error Log</h4>
</style>



<script>
(function () {
// initialize only once even if template rendered many times
Expand Down Expand Up @@ -517,3 +530,4 @@ <h4>Error Log</h4>
})();
</script>
<!-- END: osl-fif stacking fix -->

Loading