osl_ephys.report.src_report#

Reporting tool for source reconstruction.

Functions#

gen_html_data(config, outdir, subject, reportdir[, ...])

Generate data for HTML report.

gen_html_page(reportdir)

Generate an HTML page from a report directory.

gen_html_summary(reportdir[, logsdir])

Generate an HTML summary from a report directory.

plot_config(config, reportdir)

Plots a config flowchart.

plot_parcellation(parcellation_file, reportdir)

Plot parcellation.

plot_sign_flipping_results(metrics, reportdir)

Plot sign flipping results.

add_to_data(data_file, info)

Adds info to a dictionary containing info for the source recon report.

update_config(old_config, new_config)

Merge/update a config.

Module Contents#

osl_ephys.report.src_report.gen_html_data(config, outdir, subject, reportdir, logger=None, extra_funcs=None, logsdir=None)[source]#

Generate data for HTML report.

Parameters:
  • config (dict) – Source reconstruction config.

  • outdir (str) – Source reconstruction directory.

  • subject (str) – Subject name.

  • reportdir (str) – Report directory.

  • logger (logging.getLogger) – Logger.

  • extra_funcs (list) – List of extra functions to run

  • logsdir (str) – Directory the log files were saved into. If None, log files are assumed to be in reportdir.replace(‘report’, ‘logs’)

osl_ephys.report.src_report.gen_html_page(reportdir)[source]#

Generate an HTML page from a report directory.

Parameters:

reportdir (str) – Directory to generate HTML report with.

Returns:

Whether the report was generated successfully.

Return type:

bool

osl_ephys.report.src_report.gen_html_summary(reportdir, logsdir=None)[source]#

Generate an HTML summary from a report directory.

Parameters:
  • reportdir (str) – Directory to generate HTML summary report with. logsdir: str

  • None (Directory the log files were saved into. If) – to be in reportdir.replace(‘report’, ‘logs’)

  • assumed (log files are) – to be in reportdir.replace(‘report’, ‘logs’)

Returns:

Whether the report was generated successfully.

Return type:

bool

osl_ephys.report.src_report.plot_config(config, reportdir)[source]#

Plots a config flowchart.

Parameters:
  • config (dict) – Config to plot.

  • reportdir (str) – Path to report directory. We will save the plot in this directory.

Returns:

path – Path to plot.

Return type:

str

osl_ephys.report.src_report.plot_parcellation(parcellation_file, reportdir)[source]#

Plot parcellation.

Parameters:
  • parcellation_file (str) – Path to parcellation file.

  • reportdir (str) – Path to report directory. We will save the plot in this directory.

Returns:

path – Path to plot.

Return type:

str

osl_ephys.report.src_report.plot_sign_flipping_results(metrics, reportdir)[source]#

Plot sign flipping results.

Parameters:
  • metrics (np.ndarray) – Sign flipping metrics. Shape is (n_subjects, n_iter + 1).

  • reportdir (str) – Path to report directory. We will save the plot in this directory.

Returns:

path – Path to plot.

Return type:

str

osl_ephys.report.src_report.add_to_data(data_file, info)[source]#

Adds info to a dictionary containing info for the source recon report.

Parameters:
  • data_file (str) – Path to pickle file containing the data dictionary.

  • info (dict) – Info to add.

osl_ephys.report.src_report.update_config(old_config, new_config)[source]#

Merge/update a config.

Parameters:
  • old_config (dict) – Old config.

  • new_config (dict) – New config.

Returns:

config – Merge/updated config.

Return type:

dict