Note

This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the user guide for the big picture.

nilearn.reporting.HTMLReport#

class nilearn.reporting.HTMLReport(head_tpl, body, head_values={})[source]#

A report written as HTML.

Methods such as save_as_html, or open_in_browser are inherited from class nilearn.plotting.html_document.HTMLDocument.

__init__(head_tpl, body, head_values={})[source]#

Constructor the HTMLReport class.

Parameters:
head_tplTemplate

This is meant for display as a full page, eg writing on disk. This is the Template object used to generate the HTML head section of the report. The template should be filled with:

  • title: The title of the HTML page.

  • body: The full body of the HTML page. Provided through the body input.

bodystr

This parameter is used for embedding in the provided head_tpl template. It contains the full body of the HTML page.

head_valuesdict, optional

Additional substitutions in head_tpl. Default={}.

Note

This can be used to provide additional values with custom templates.

get_iframe(width=None, height=None)[source]#

Get the document wrapped in an inline frame.

For inserting in another HTML page of for display in a Jupyter notebook.

Parameters:
widthint or None, optional

Width of the inline frame. Default=None.

heightint or None, optional

Height of the inline frame. Default=None.

Returns:
wrappedstr

Raw HTML code for the inline frame.

get_standalone()[source]#

Returns the plot in an HTML page.

open_in_browser(file_name=None, temp_file_lifetime=30)[source]#

Save the plot to a temporary HTML file and open it in a browser.

Parameters:
file_namestr or None, optional

HTML file to use as a temporary file. Default=None.

temp_file_lifetimefloat, optional

Time, in seconds, after which the temporary file is removed. If None, it is never removed. Default=30.

remove_temp_file()[source]#

Remove the temporary file created by open_in_browser, if necessary.

resize(width, height)[source]#

Resize the plot displayed in a Jupyter notebook.

Parameters:
widthint

New width of the plot.

heightint

New height of the plot.

save_as_html(file_name)[source]#

Save the plot in an HTML file, that can later be opened in a browser.

Parameters:
file_namestr

Path to the HTML file used for saving.

Examples using nilearn.reporting.HTMLReport#

Decoding of a dataset after GLM fit for signal extraction

Decoding of a dataset after GLM fit for signal extraction

Decoding of a dataset after GLM fit for signal extraction
Extracting signals of a probabilistic atlas of functional regions

Extracting signals of a probabilistic atlas of functional regions

Extracting signals of a probabilistic atlas of functional regions
Default Mode Network extraction of ADHD dataset

Default Mode Network extraction of ADHD dataset

Default Mode Network extraction of ADHD dataset
Simple example of two-session fMRI model fitting

Simple example of two-session fMRI model fitting

Simple example of two-session fMRI model fitting
First level analysis of a complete BIDS dataset from openneuro

First level analysis of a complete BIDS dataset from openneuro

First level analysis of a complete BIDS dataset from openneuro
Voxel-Based Morphometry on OASIS dataset

Voxel-Based Morphometry on OASIS dataset

Voxel-Based Morphometry on OASIS dataset
Simple example of NiftiMasker use

Simple example of NiftiMasker use

Simple example of NiftiMasker use
Extracting signals from brain regions using the NiftiLabelsMasker

Extracting signals from brain regions using the NiftiLabelsMasker

Extracting signals from brain regions using the NiftiLabelsMasker
Understanding NiftiMasker and mask computation

Understanding NiftiMasker and mask computation

Understanding NiftiMasker and mask computation