mne.Report

class mne.Report(info_fname=None, subjects_dir=None, subject=None, title=None, cov_fname=None, baseline=None, image_format='png', raw_psd=False, projs=False, verbose=None)[source]

Object for rendering HTML.

Parameters
info_fnameNone | str

Name of the file containing the info dictionary.

subjects_dirstr | pathlib.Path | None

The path to the directory containing the FreeSurfer subjects reconstructions. If None, defaults to the SUBJECTS_DIR environment variable.

subjectstr | None

Subject name.

titlestr

Title of the report.

cov_fnameNone | str

Name of the file containing the noise covariance.

baselineNone | tuple of length 2

The time interval to consider as “baseline” when applying baseline correction. If None, do not apply baseline correction. If a tuple (a, b), the interval is between a and b (in seconds), including the endpoints. If a is None, the beginning of the data is used; and if b is None, it is set to the end of the interval. If (None, None), the entire time interval is used.

Note

The baseline (a, b) includes both endpoints, i.e. all timepoints t such that a <= t <= b.

Correction is applied in the following way to each channel:

  1. Calculate the mean signal of the baseline period.

  2. Subtract this mean from the entire time period.

For Epochs, this algorithm is run on each epoch individually. Defaults to None, i.e. no baseline correction.

image_format‘png’ | ‘svg’ | ‘gif’

Default image format to use (default is 'png'). 'svg' uses vector graphics, so fidelity is higher but can increase file size and browser image rendering time as well.

New in version 0.15.

raw_psdbool | dict

If True, include PSD plots for raw files. Can be False (default) to omit, True to plot, or a dict to pass as kwargs to mne.io.Raw.plot_psd().

New in version 0.17.

projsbool

Whether to include topographic plots of SSP projectors, if present in the data. Defaults to False.

New in version 0.21.

verbosebool | str | int | None

If not None, override default verbose level (see mne.verbose() and Logging documentation for more). If used, it should be passed as a keyword-argument only.

Notes

See Getting started with mne.Report for an introduction to using mne.Report.

New in version 0.8.0.

Attributes
info_fnameNone | str

Name of the file containing the info dictionary.

subjects_dirstr | pathlib.Path | None

The path to the directory containing the FreeSurfer subjects reconstructions. If None, defaults to the SUBJECTS_DIR environment variable.

subjectstr | None

Subject name.

titlestr

Title of the report.

cov_fnameNone | str

Name of the file containing the noise covariance.

baselineNone | tuple of length 2

The time interval to consider as “baseline” when applying baseline correction. If None, do not apply baseline correction. If a tuple (a, b), the interval is between a and b (in seconds), including the endpoints. If a is None, the beginning of the data is used; and if b is None, it is set to the end of the interval. If (None, None), the entire time interval is used.

Note

The baseline (a, b) includes both endpoints, i.e. all timepoints t such that a <= t <= b.

Correction is applied in the following way to each channel:

  1. Calculate the mean signal of the baseline period.

  2. Subtract this mean from the entire time period.

For Epochs, this algorithm is run on each epoch individually. Defaults to None, i.e. no baseline correction.

image_formatstr

Default image format to use.

New in version 0.15.

raw_psdbool | dict

If True, include PSD plots for raw files. Can be False (default) to omit, True to plot, or a dict to pass as kwargs to mne.io.Raw.plot_psd().

New in version 0.17.

projsbool

Whether to include topographic plots of SSP projectors, if present in the data. Defaults to False.

New in version 0.21.

verbosebool | str | int | None

If not None, override default verbose level (see mne.verbose() and Logging documentation for more). If used, it should be passed as a keyword-argument only.

htmllist of str

Contains items of html-page.

includelist of str

Dictionary containing elements included in head.

fnameslist of str

List of file names rendered.

sectionslist of str

List of sections.

langstr

language setting for the HTML file.

Methods

__hash__(/)

Return hash(self).

__len__()

Return the number of files processed by the report.

add_bem(subject, title, *[, subjects_dir, ...])

Render a visualization of the boundary element model (BEM) surfaces.

add_bem_to_section(subject[, caption, ...])

Warning

DEPRECATED: Use add_bem() instead.

add_code(code, title, *[, language, tags, ...])

Add a code snippet (e.g., an analysis script) to the report.

add_covariance(cov, *, info, title[, tags, ...])

Add covariance to the report.

add_custom_css(css)

Add custom CSS to the report.

add_custom_js(js)

Add custom JavaScript to the report.

add_epochs(epochs, title, *[, psd, projs, ...])

Add Epochs to the report.

add_events(events, title, *[, event_id, ...])

Add events to the report.

add_evokeds(evokeds, *[, titles, noise_cov, ...])

Add Evoked objects to the report.

add_figs_to_section(figs, captions[, ...])

Warning

DEPRECATED: Use add_figure() instead.

add_figure(fig, title, *[, caption, ...])

Add figures to the report.

add_forward(forward, title, *[, subject, ...])

Add a forward solution.

add_html(html, title, *[, tags, replace])

Add HTML content to the report.

add_htmls_to_section(htmls, captions[, ...])

Warning

DEPRECATED: Use add_html() instead.

add_ica(ica, title, *, inst[, picks, ...])

Add (a fitted) ICA to the report.

add_image(image, title, *[, caption, tags, ...])

Add an image (e.g., PNG or JPEG pictures) to the report.

add_images_to_section(fnames, captions[, ...])

Warning

DEPRECATED: Use add_image() instead.

add_inverse_operator(inverse_operator, title, *)

Add an inverse operator.

add_projs(*, info[, projs, topomap_kwargs, ...])

Render (SSP) projection vectors.

add_raw(raw, title, *[, psd, projs, ...])

Add Raw objects to the report.

add_slider_to_section(figs[, captions, ...])

Warning

DEPRECATED: Use add_figure() instead.

add_stc(stc, title, *[, subject, ...])

Add a SourceEstimate (STC) to the report.

add_sys_info(title, *[, tags])

Add a MNE-Python system information to the report.

add_trans(trans, *, info, title[, subject, ...])

Add a coregistration visualization to the report.

parse_folder(data_path[, pattern, n_jobs, ...])

Render all the files in the folder.

remove([caption, section, title, tags, ...])

Remove elements from the report.

save([fname, open_browser, overwrite, ...])

Save the report and optionally open it in browser.

__len__()[source]

Return the number of files processed by the report.

Returns
n_filesint

The number of files processed.

add_bem(subject, title, *, subjects_dir=None, decim=2, width=512, n_jobs=1, tags=('bem',), replace=False)[source]

Render a visualization of the boundary element model (BEM) surfaces.

Parameters
subjectstr

The FreeSurfer subject name.

titlestr

The title corresponding to the BEM image.

subjects_dirstr | pathlib.Path | None

The path to the directory containing the FreeSurfer subjects reconstructions. If None, defaults to the SUBJECTS_DIR environment variable.

decimint

Use this decimation factor for generating MRI/BEM images (since it can be time consuming).

widthint

The width of the MRI images (in pixels). Larger values will have clearer surface lines, but will create larger HTML files. Typically a factor of 2 more than the number of MRI voxels along each dimension (typically 512, default) is reasonable.

n_jobsint

The number of jobs to run in parallel (default 1). Requires the joblib package.

tagscollections of str

Tags to add for later interactive filtering.

replacebool

If True, content already present that has the same title will be replaced. Defaults to False, which will cause duplicate entries in the table of contents if an entry for title already exists.

Notes

New in version 0.24.0.

Examples using add_bem:

add_bem_to_section(subject, caption='BEM', section='bem', decim=2, n_jobs=1, subjects_dir=None, replace=False, width=512, verbose=None)[source]

Warning

DEPRECATED: Use add_bem() instead.

Render a bem slider html str.

Parameters
subjectstr

Subject name.

captionstr

A caption for the BEM.

sectionstr

Name of the section. If it already exists, the BEM will be appended to the end of the existing section.

decimint

Use this decimation factor for generating MRI/BEM images (since it can be time consuming).

n_jobsint

The number of jobs to run in parallel (default 1). Requires the joblib package.

subjects_dirstr | pathlib.Path | None

The path to the directory containing the FreeSurfer subjects reconstructions. If None, defaults to the SUBJECTS_DIR environment variable.

replacebool

If True, figures already present that have the same caption will be replaced. Defaults to False.

widthint

The width of the MRI images (in pixels). Larger values will have clearer surface lines, but will create larger HTML files. Typically a factor of 2 more than the number of MRI voxels along each dimension (typically 512, default) is reasonable.

New in version 0.23.

verbosebool | str | int | None

If not None, override default verbose level (see mne.verbose() and Logging documentation for more). If used, it should be passed as a keyword-argument only. Defaults to self.verbose.

Notes

New in version 0.9.0.

add_code(code, title, *, language='python', tags=('code',), replace=False)[source]

Add a code snippet (e.g., an analysis script) to the report.

Parameters
codestr | pathlib.Path

The code to add to the report as a string, or the path to a file as a pathlib.Path object.

Note

Paths must be passed as pathlib.Path object, since strings will be treated as literal code.

titlestr

The title corresponding to the code.

languagestr

The programming language of code. This will be used for syntax highlighting. Can be 'auto' to try to auto-detect the language.

tagscollections of str

Tags to add for later interactive filtering.

replacebool

If True, content already present that has the same title will be replaced. Defaults to False, which will cause duplicate entries in the table of contents if an entry for title already exists.

Notes

New in version 0.24.0.

Examples using add_code:

add_covariance(cov, *, info, title, tags=('covariance',), replace=False)[source]

Add covariance to the report.

Parameters
covpath-like | instance of Covariance

The Covariance to add to the report.

infopath-like | instance of Info

The Info corresponding to cov.

titlestr

The title corresponding to the Covariance object.

tagscollections of str

Tags to add for later interactive filtering.

replacebool

If True, content already present that has the same title will be replaced. Defaults to False, which will cause duplicate entries in the table of contents if an entry for title already exists.

Notes

New in version 0.24.0.

Examples using add_covariance:

add_custom_css(css)[source]

Add custom CSS to the report.

Parameters
cssstr

Style definitions to add to the report. The content of this string will be embedded between HTML <style> and </style> tags.

Notes

New in version 0.23.

add_custom_js(js)[source]

Add custom JavaScript to the report.

Parameters
jsstr

JavaScript code to add to the report. The content of this string will be embedded between HTML <script> and </script> tags.

Notes

New in version 0.23.

add_epochs(epochs, title, *, psd=True, projs=None, tags=('epochs',), replace=False, topomap_kwargs=None)[source]

Add Epochs to the report.

Parameters
epochspath-like | instance of Epochs

The epochs to add to the report.

titlestr

The title to add.

psdbool | None

Whether to add PSD plots.

projsbool | None

Whether to add SSP projector plots if projectors are present in the data. If None, use projs from Report creation.

tagscollections of str

Tags to add for later interactive filtering.

replacebool

If True, content already present that has the same title will be replaced. Defaults to False, which will cause duplicate entries in the table of contents if an entry for title already exists.

topomap_kwargsdict | None

Keyword arguments to pass to topomap functions ( mne.viz.plot_evoked_topomap(), mne.viz.plot_projs_topomap(), etc.).

Notes

New in version 0.24.0.

Examples using add_epochs:

add_events(events, title, *, event_id=None, sfreq, first_samp=0, tags=('events',), replace=False)[source]

Add events to the report.

Parameters
eventspath-like | array, shape (n_events, 3)

An MNE-Python events array.

titlestr

The title corresponding to the events.

event_iddict

A dictionary mapping event names (keys) to event codes (values).

sfreqfloat

The sampling frequency used while recording.

first_sampint

The first sample point in the recording. This corresponds to raw.first_samp on files created with Elekta/Neuromag systems.

tagscollections of str

Tags to add for later interactive filtering.

replacebool

If True, content already present that has the same title will be replaced. Defaults to False, which will cause duplicate entries in the table of contents if an entry for title already exists.

Notes

New in version 0.24.0.

Examples using add_events:

add_evokeds(evokeds, *, titles=None, noise_cov=None, projs=None, n_time_points=None, tags=('evoked',), replace=False, topomap_kwargs=None, n_jobs=1)[source]

Add Evoked objects to the report.

Parameters
evokedspath-like | instance of Evoked | list of Evoked

The evoked data to add to the report. Multiple Evoked objects – as returned from mne.read_evokeds – can be passed as a list.

titlesstr | list of str | None

The titles corresponding to the evoked data. If None, the content of evoked.comment from each evoked will be used as title.

noise_covpath-like | instance of Covariance | None

A noise covariance matrix. If provided, will be used to whiten the evokeds. If None, will fall back to the cov_fname provided upon report creation.

projsbool | None

Whether to add SSP projector plots if projectors are present in the data. If None, use projs from Report creation.

n_time_pointsint | None

The number of equidistant time points to render. If None, will render each Evoked at 21 time points, unless the data contains fewer time points, in which case all will be rendered.

tagscollections of str

Tags to add for later interactive filtering.

replacebool

If True, content already present that has the same title will be replaced. Defaults to False, which will cause duplicate entries in the table of contents if an entry for title already exists.

topomap_kwargsdict | None

Keyword arguments to pass to topomap functions ( mne.viz.plot_evoked_topomap(), mne.viz.plot_projs_topomap(), etc.).

n_jobsint

The number of jobs to run in parallel (default 1). Requires the joblib package.

Notes

New in version 0.24.0.

Examples using add_evokeds:

add_figs_to_section(figs, captions, section='custom', scale=None, image_format=None, comments=None, replace=False, auto_close=True)[source]

Warning

DEPRECATED: Use add_figure() instead.

Append custom user-defined figures.

Parameters
figsmatplotlib.figure.Figure | mlab.Figure | array | list

A figure or a list of figures to add to the report. Each figure in the list can be an instance of matplotlib.figure.Figure, mayavi.core.api.Scene, or numpy.ndarray.

captionsstr | list of str

A caption or a list of captions to the figures.

sectionstr

Name of the section to place the figures in. If it already exists, the figures will be appended to the end of the existing section.

scalefloat | None | callable()

Scale the images maintaining the aspect ratio. If None, no scaling is applied. If float, scale will determine the relative scaling (might not work for scale <= 1 depending on font sizes). If function, should take a figure object as input parameter. Defaults to None.

image_format‘png’ | ‘svg’ | ‘gif’ | None

The image format to be used for the report, can be 'png', 'svg', or 'gif'. None (default) will use the default specified during Report instantiation.

commentsNone | str | list of str

A string of text or a list of strings of text to be appended after the figure.

replacebool

If True, figures already present that have the same caption will be replaced. Defaults to False.

auto_closebool

If True, the plots are closed during the generation of the report. Defaults to True.

add_figure(fig, title, *, caption=None, image_format=None, tags=('custom-figure',), replace=False)[source]

Add figures to the report.

Parameters
figmatplotlib.figure.Figure | mlab.Figure | array | collections of matplotlib.figure.Figure | collections of mlab.Figure | collections of array

One or more figures to add to the report. All figures must be an instance of matplotlib.figure.Figure, mayavi.core.api.Scene, or numpy.ndarray. If multiple figures are passed, they will be added as “slides” that can be navigated using buttons and a slider element.

titlestr

The title corresponding to the figure(s).

captionstr | collections of str | None

The caption(s) to add to the figure(s).

image_format‘png’ | ‘svg’ | ‘gif’ | None

The image format to be used for the report, can be 'png', 'svg', or 'gif'. None (default) will use the default specified during Report instantiation.

tagscollections of str

Tags to add for later interactive filtering.

replacebool

If True, content already present that has the same title will be replaced. Defaults to False, which will cause duplicate entries in the table of contents if an entry for title already exists.

Notes

New in version 0.24.0.

Examples using add_figure:

add_forward(forward, title, *, subject=None, subjects_dir=None, tags=('forward-solution',), replace=False)[source]

Add a forward solution.

Parameters
forwardinstance of Forward | path-like

The forward solution to add to the report.

titlestr

The title corresponding to forward solution.

subjectstr | None

The name of the FreeSurfer subject forward belongs to. If provided, the sensitivity maps of the forward solution will be visualized. If None, will use the value of subject passed on report creation. If supplied, also pass subjects_dir.

subjects_dirpath-like | None

The FreeSurfer SUBJECTS_DIR.

tagscollections of str

Tags to add for later interactive filtering.

replacebool

If True, content already present that has the same title will be replaced. Defaults to False, which will cause duplicate entries in the table of contents if an entry for title already exists.

Notes

New in version 0.24.0.

Examples using add_forward:

add_html(html, title, *, tags=('custom-html',), replace=False)[source]

Add HTML content to the report.

Parameters
htmlstr

The HTML content to add.

titlestr

The title corresponding to html.

tagscollections of str

Tags to add for later interactive filtering.

replacebool

If True, content already present that has the same title will be replaced. Defaults to False, which will cause duplicate entries in the table of contents if an entry for title already exists.

Notes

New in version 0.24.0.

add_htmls_to_section(htmls, captions, section='custom', replace=False)[source]

Warning

DEPRECATED: Use add_html() instead.

Append htmls to the report.

Parameters
htmlsstr | list of str

An html str or a list of html str.

captionsstr | list of str

A caption or a list of captions to the htmls.

sectionstr

Name of the section. If section already exists, the images will be appended to the end of the section.

replacebool

If True, figures already present that have the same caption will be replaced. Defaults to False.

Notes

New in version 0.9.0.

add_ica(ica, title, *, inst, picks=None, ecg_evoked=None, eog_evoked=None, ecg_scores=None, eog_scores=None, n_jobs=1, tags=('ica',), replace=False)[source]

Add (a fitted) ICA to the report.

Parameters
icapath-like | instance of mne.preprocessing.ICA

The fitted ICA to add.

titlestr

The title to add.

instpath-like | mne.io.Raw | mne.Epochs | None

The data to use for visualization of the effects of ICA cleaning. To only plot the ICA component topographies, explicitly pass None.

picksint | list of int | slice | None

Indices of the ICA components to visualize. If None, plot all components. This only affects the behavior of the component topography and properties plots.

ecg_evoked, eog_evokedpath-line | mne.Evoked | None

Evoked signal based on ECG and EOG epochs, respectively. If passed, will be used to visualize the effects of artifact rejection.

ecg_scores, eog_scoresarray of float | list of array of float | None

The scores produced by mne.preprocessing.ICA.find_bads_ecg() and mne.preprocessing.ICA.find_bads_eog(), respectively. If passed, will be used to visualize the scoring for each ICA component.

n_jobsint

The number of jobs to run in parallel (default 1). Requires the joblib package.

tagscollections of str

Tags to add for later interactive filtering.

replacebool

If True, content already present that has the same title will be replaced. Defaults to False, which will cause duplicate entries in the table of contents if an entry for title already exists.

Notes

New in version 0.24.0.

Examples using add_ica:

add_image(image, title, *, caption=None, tags=('custom-image',), replace=False)[source]

Add an image (e.g., PNG or JPEG pictures) to the report.

Parameters
imagepath-like

The image to add.

titlestr

Title corresponding to the images.

captionstr | None

If not None, the caption to add to the image.

tagscollections of str

Tags to add for later interactive filtering.

replacebool

If True, content already present that has the same title will be replaced. Defaults to False, which will cause duplicate entries in the table of contents if an entry for title already exists.

Notes

New in version 0.24.0.

Examples using add_image:

add_images_to_section(fnames, captions, scale=None, section='custom', comments=None, replace=False)[source]

Warning

DEPRECATED: Use add_image() instead.

Append custom user-defined images.

Parameters
fnamesstr | list of str

A filename or a list of filenames from which images are read. Images can be PNG, GIF or SVG.

captionsstr | list of str

A caption or a list of captions to the images.

scalefloat | None

Scale the images maintaining the aspect ratio. Defaults to None. If None, no scaling will be applied.

sectionstr

Name of the section. If section already exists, the images will be appended to the end of the section.

commentsNone | str | list of str

A string of text or a list of strings of text to be appended after the image.

replacebool

If True, figures already present that have the same caption will be replaced. Defaults to False.

add_inverse_operator(inverse_operator, title, *, subject=None, subjects_dir=None, trans=None, tags=('inverse-operator',), replace=False)[source]

Add an inverse operator.

Parameters
inverse_operatorinstance of InverseOperator | path-like

The inverse operator to add to the report.

titlestr

The title corresponding to the inverse operator object.

subjectstr | None

The name of the FreeSurfer subject inverse_op belongs to. If provided, the source space the inverse solution is based on will be visualized. If None, will use the value of subject passed on report creation. If supplied, also pass subjects_dir and trans.

subjects_dirpath-like | None

The FreeSurfer SUBJECTS_DIR.

transpath-like | instance of Transform | None

The head -> MRI transformation for subject.

tagscollections of str

Tags to add for later interactive filtering.

replacebool

If True, content already present that has the same title will be replaced. Defaults to False, which will cause duplicate entries in the table of contents if an entry for title already exists.

Notes

New in version 0.24.0.

Examples using add_inverse_operator:

add_projs(*, info, projs=None, title, topomap_kwargs=None, tags=('ssp',), replace=False)[source]

Render (SSP) projection vectors.

Parameters
infoinstance of Info | path-like

An Info structure or the path of a file containing one. This is required to create the topographic plots.

projsiterable of mne.Projection | path-like | None

The projection vectors to add to the report. Can be the path to a file that will be loaded via mne.read_proj. If None, the projectors are taken from info['projs'].

titlestr

The title corresponding to the Projection object.

topomap_kwargsdict | None

Keyword arguments to pass to topomap functions ( mne.viz.plot_evoked_topomap(), mne.viz.plot_projs_topomap(), etc.).

tagscollections of str

Tags to add for later interactive filtering.

replacebool

If True, content already present that has the same title will be replaced. Defaults to False, which will cause duplicate entries in the table of contents if an entry for title already exists.

Notes

New in version 0.24.0.

Examples using add_projs:

add_raw(raw, title, *, psd=None, projs=None, butterfly=True, tags=('raw',), replace=False, topomap_kwargs=None)[source]

Add Raw objects to the report.

Parameters
rawpath-like | instance of Raw

The data to add to the report.

titlestr

The title corresponding to the raw object.

psdbool | None

Whether to add PSD plots. Overrides the raw_psd parameter passed when initializing the Report. If None, use raw_psd from Report creation.

projsbool | None

Whether to add SSP projector plots if projectors are present in the data. If None, use projs from Report creation.

butterflybool

Whether to add a butterfly plot of the (decimated) data. Can be useful to spot segments marked as “bad” and problematic channels.

tagscollections of str

Tags to add for later interactive filtering.

replacebool

If True, content already present that has the same title will be replaced. Defaults to False, which will cause duplicate entries in the table of contents if an entry for title already exists.

topomap_kwargsdict | None

Keyword arguments to pass to topomap functions ( mne.viz.plot_evoked_topomap(), mne.viz.plot_projs_topomap(), etc.).

Notes

New in version 0.24.0.

Examples using add_raw:

add_slider_to_section(figs, captions=None, section='custom', title='Slider', scale=None, image_format=None, replace=False, auto_close=True)[source]

Warning

DEPRECATED: Use add_figure() instead.

Render a slider of figs to the report.

Parameters
figslist of Figure

Each figure in the list can be an instance of matplotlib.figure.Figure, mayavi.core.api.Scene, or numpy.ndarray.

captionslist of str | list of float | None

A list of captions to the figures. If None, it will default to Data slice [i].

sectionstr

Name of the section. If section already exists, the figures will be appended to the end of the section.

titlestr

The title of the slider.

scalefloat | None | callable()

Scale the images maintaining the aspect ratio. If None, no scaling is applied. If float, scale will determine the relative scaling (might not work for scale <= 1 depending on font sizes). If function, should take a figure object as input parameter. Defaults to None.

image_format‘png’ | ‘svg’ | ‘gif’ | None

The image format to be used for the report, can be 'png', 'svg', or 'gif'. None (default) will use the default specified during Report instantiation.

replacebool

If True, figures already present that have the same caption will be replaced. Defaults to False.

auto_closebool

If True, the plots are closed during the generation of the report. Defaults to True.

New in version 0.23.

Notes

New in version 0.10.0.

add_stc(stc, title, *, subject=None, subjects_dir=None, n_time_points=None, tags=('source-estimate',), replace=False, stc_plot_kwargs=None)[source]

Add a SourceEstimate (STC) to the report.

Parameters
stcpath-like | instance of SourceEstimate

The SourceEstimate to add to the report.

titlestr

The title to add.

subjectstr | None

The name of the FreeSurfer subject the STC belongs to. The name is not stored with the STC data and therefore needs to be specified. If None, will use the value of subject passed on report creation.

subjects_dirpath-like | None

The FreeSurfer SUBJECTS_DIR.

n_time_pointsint | None

The number of equidistant time points to render. If None, will render stc at 51 time points, unless the data contains fewer time points, in which case all will be rendered.

tagscollections of str

Tags to add for later interactive filtering.

replacebool

If True, content already present that has the same title will be replaced. Defaults to False, which will cause duplicate entries in the table of contents if an entry for title already exists.

stc_plot_kwargsdict

Dictionary of keyword arguments to pass to mne.SourceEstimate.plot. Only used when plotting in 3D mode.

Notes

New in version 0.24.0.

Examples using add_stc:

add_sys_info(title, *, tags=('mne-sysinfo',))[source]

Add a MNE-Python system information to the report.

This is a convenience method that captures the output of mne.sys_info and adds it to the report.

Parameters
titlestr

The title to assign.

tagscollections of str

Tags to add for later interactive filtering.

Notes

New in version 0.24.0.

add_trans(trans, *, info, title, subject=None, subjects_dir=None, tags=('coregistration',), replace=False)[source]

Add a coregistration visualization to the report.

Parameters
transpath-like | instance of Transform

The head -> MRI transformation to render.

infopath-like | instance of Info

The Info corresponding to trans.

titlestr

The title to add.

subjectstr | None

The name of the FreeSurfer subject the trans`` belong to. The name is not stored with the trans and therefore needs to be specified. If None, will use the value of subject passed on report creation.

subjects_dirpath-like | None

The FreeSurfer SUBJECTS_DIR.

tagscollections of str

Tags to add for later interactive filtering.

replacebool

If True, content already present that has the same title will be replaced. Defaults to False, which will cause duplicate entries in the table of contents if an entry for title already exists.

Notes

New in version 0.24.0.

Examples using add_trans:

parse_folder(data_path, pattern=None, n_jobs=1, mri_decim=2, sort_content=True, sort_sections=None, on_error='warn', image_format=None, render_bem=True, *, n_time_points_evokeds=None, n_time_points_stcs=None, raw_butterfly=True, stc_plot_kwargs=None, topomap_kwargs=None, verbose=None)[source]

Render all the files in the folder.

Parameters
data_pathstr

Path to the folder containing data whose HTML report will be created.

patternNone | str | list of str

Filename pattern(s) to include in the report. For example, [\*raw.fif, \*ave.fif] will include Raw as well as Evoked files. If None, include all supported file formats.

Changed in version 0.23: Include supported non-FIFF files by default.

n_jobsint

The number of jobs to run in parallel (default 1). Requires the joblib package.

mri_decimint

Use this decimation factor for generating MRI/BEM images (since it can be time consuming).

sort_contentbool

If True, sort the content based on tags in the order: raw -> events -> epochs -> evoked -> covariance -> coregistration -> bem -> forward-solution -> inverse-operator -> source-estimate.

New in version 0.24.0.

sort_sectionsbool

If True, sort the content based on tags in the order: raw -> events -> epochs -> evoked -> covariance -> coregistration -> bem -> forward-solution -> inverse-operator -> source-estimate.

Deprecated since version 0.24.0: This parameter is scheduled for removal. Use sort_content instead.

on_errorstr

What to do if a file cannot be rendered. Can be ‘ignore’, ‘warn’ (default), or ‘raise’.

image_format‘png’ | ‘svg’ | ‘gif’ | None

The image format to be used for the report, can be 'png', 'svg', or 'gif'. None (default) will use the default specified during Report instantiation.

New in version 0.15.

render_bembool

If True (default), try to render the BEM.

New in version 0.16.

n_time_points_evokeds, n_time_points_stcsint | None

The number of equidistant time points to render for Evoked and SourceEstimate data, respectively. If None, will render each Evoked at 21 and each SourceEstimate at 51 time points, unless the respective data contains fewer time points, in which call all will be rendered.

New in version 0.24.0.

raw_butterflybool

Whether to render butterfly plots for (decimated) Raw data.

New in version 0.24.0.

stc_plot_kwargsdict

Dictionary of keyword arguments to pass to mne.SourceEstimate.plot. Only used when plotting in 3D mode.

New in version 0.24.0.

topomap_kwargsdict | None

Keyword arguments to pass to topomap functions ( mne.viz.plot_evoked_topomap(), mne.viz.plot_projs_topomap(), etc.).

New in version 0.24.0.

verbosebool | str | int | None

If not None, override default verbose level (see mne.verbose() and Logging documentation for more). If used, it should be passed as a keyword-argument only. Defaults to self.verbose.

Examples using parse_folder:

remove(caption=None, section=None, *, title=None, tags=None, remove_all=False)[source]

Remove elements from the report.

The element to remove is searched for by its title. Optionally, tags may be specified as well to narrow down the search to elements that have the supplied tags.

Parameters
captionstr

Remove content based on its caption.

Deprecated since version 0.24.0: This parameter is scheduled for removal. Use title instead.

sectionstr | None

If supplied, restrict the operation to elements within the supplied section.

Deprecated since version 0.24.0: This parameter is scheduled for removal. Use tags instead.

titlestr

The title of the element(s) to remove.

New in version 0.24.0.

tagscollections of str | None

If supplied, restrict the operation to elements with the supplied tags.

New in version 0.24.0.

remove_allbool

Controls the behavior if multiple elements match the search criteria. If False (default) only the element last added to the report will be removed. If True, all matches will be removed.

New in version 0.24.0.

Returns
removed_indexint | tuple of int | None

The indices of the elements that were removed, or None if no element matched the search criteria. A tuple will always be returned if remove_all was set to True and at least one element was removed.

Changed in version 0.24.0: Returns tuple if remove_all is True.

save(fname=None, open_browser=True, overwrite=False, sort_content=False, *, verbose=None)[source]

Save the report and optionally open it in browser.

Parameters
fnamepath-like | None

Output filename. If the name ends with .h5 or .hdf5, the report is saved in HDF5 format, so it can later be loaded again with open_report(). For any other suffix, the report will be saved in HTML format. If None and Report.parse_folder() was not called, the report is saved as report.html in the current working directory. If None and Report.parse_folder() was used, the report is saved as report.html inside the data_path supplied to Report.parse_folder().

open_browserbool

Whether to open the rendered HTML report in the default web browser after saving. This is ignored when writing an HDF5 file.

overwritebool

If True (default False), overwrite the destination file if it exists.

sort_contentbool

If True, sort the content based on tags before saving in the order: raw -> events -> epochs -> evoked -> covariance -> coregistration -> bem -> forward-solution -> inverse-operator -> source-estimate.

New in version 0.24.0.

verbosebool | str | int | None

If not None, override default verbose level (see mne.verbose() and Logging documentation for more). If used, it should be passed as a keyword-argument only. Defaults to self.verbose.

Returns
fnamestr

The file name to which the report was saved.

Examples using save:

property tags

All tags currently used in the report.

Examples using mne.Report