mne.Report#
- class mne.Report(info_fname=None, subjects_dir=None, subject=None, title=None, cov_fname=None, baseline=None, image_format='auto', raw_psd=False, projs=False, *, img_max_width=850, img_max_res=100, collapse=(), verbose=None)[source]#
Object for rendering HTML.
- Parameters:
- info_fname
None|str Name of the file containing the info dictionary.
- subjects_dirpath-like |
None The path to the directory containing the FreeSurfer subjects reconstructions. If
None, defaults to theSUBJECTS_DIRenvironment variable.- subject
str|None Subject name.
- title
str Title of the report.
- cov_fname
None|str Name of the file containing the noise covariance.
- baseline
None|tupleof 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 betweenaandb(in seconds), including the endpoints. IfaisNone, the beginning of the data is used; and ifbisNone, it is set to the end of the data. If(None, None), the entire time interval is used.Note
The baseline
(a, b)includes both endpoints, i.e. all timepointstsuch thata <= t <= b.Correction is applied in the following way to each channel:
Calculate the mean signal of the baseline period.
Subtract this mean from the entire time period.
For
Epochs, this algorithm is run on each epoch individually. Defaults toNone, i.e. no baseline correction.- image_format‘png’ | ‘svg’ | ‘webp’ | ‘auto’
Default image format to use (default is
'auto', which will use'webp'if available and'png'otherwise).'svg'uses vector graphics, so fidelity is higher but can increase file size and browser image rendering time as well.New in v0.15.
Changed in version 1.3: Added support for
'webp'format, removed support for GIF, and set the default to'auto'.- 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
kwargstomne.time_frequency.Spectrum.plot().New in v0.17.
Changed in version 1.4: kwargs are sent to
spectrum.plotinstead ofraw.plot_psd.- projsbool
Whether to include topographic plots of SSP projectors, if present in the data. Defaults to
False.New in v0.21.
- img_max_width
int|None Maximum image width in pixels.
New in v1.9.
- img_max_res
float|None Maximum image resolution in dots per inch.
New in v1.9.
- collapse
tupleofstr|str Tuple of elements to collapse by default. Defaults to an empty tuple. For now the only option it can contain is “section”.
New in v1.9.
- verbosebool |
str|int|None Control verbosity of the logging output. If
None, use the default verbosity level. See the logging documentation andmne.verbose()for details. Should only be passed as a keyword argument.
- info_fname
- Attributes:
- info_fname
None|str Name of the file containing the info dictionary.
- subjects_dirpath-like |
None The path to the directory containing the FreeSurfer subjects reconstructions. If
None, defaults to theSUBJECTS_DIRenvironment variable.- subject
str|None Subject name.
- title
str Title of the report.
- cov_fname
None|str Name of the file containing the noise covariance.
- baseline
None|tupleof 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 betweenaandb(in seconds), including the endpoints. IfaisNone, the beginning of the data is used; and ifbisNone, it is set to the end of the data. If(None, None), the entire time interval is used.Note
The baseline
(a, b)includes both endpoints, i.e. all timepointstsuch thata <= t <= b.Correction is applied in the following way to each channel:
Calculate the mean signal of the baseline period.
Subtract this mean from the entire time period.
For
Epochs, this algorithm is run on each epoch individually. Defaults toNone, i.e. no baseline correction.- image_format
str Default image format to use.
New in v0.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
kwargstomne.time_frequency.Spectrum.plot().New in v0.17.
Changed in version 1.4: kwargs are sent to
spectrum.plotinstead ofraw.plot_psd.- projsbool
Whether to include topographic plots of SSP projectors, if present in the data. Defaults to
False.New in v0.21.
- verbosebool |
str|int|None Control verbosity of the logging output. If
None, use the default verbosity level. See the logging documentation andmne.verbose()for details. Should only be passed as a keyword argument.htmllistofstrA list of HTML representations for all content elements.
- include
listofstr Dictionary containing elements included in head.
- fnames
listofstr List of file names rendered.
- sections
listofstr List of sections.
- lang
str language setting for the HTML file.
- img_max_width
int|None Maximum image width in pixels.
New in v1.9.
- img_max_res
float|None Maximum image resolution in dots per inch.
New in v1.9.
- collapse
tupleofstr Tuple of elements to collapse by default. See above.
New in v1.9.
- info_fname
Methods
__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_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
Epochsto the report.add_events(events, title, *[, event_id, ...])Add events to the report.
add_evokeds(evokeds, *[, titles, noise_cov, ...])Add
Evokedobjects to the report.add_figure(fig, title, *[, caption, ...])Add figures to the report.
add_forward(forward, title, *[, subject, ...])Add a forward solution.
add_html(html, title, *[, tags, section, ...])Add HTML content to the report.
add_ica(ica, title, *, inst[, picks, ...])Add (a fitted)
ICAto the report.add_image(image, title, *[, caption, tags, ...])Add an image (e.g., PNG or JPEG pictures) to the report.
add_inverse_operator(inverse_operator, title, *)Add an inverse operator.
add_projs(*, info, title[, projs, ...])Render (SSP) projection vectors.
add_raw(raw, title, *[, psd, projs, ...])Add
Rawobjects to the report.add_stc(stc, title, *[, subject, ...])Add a
SourceEstimate(STC) to the report.add_sys_info(title, *[, tags, replace])Add a MNE-Python system information to the report.
add_trans(trans, *, info, title[, subject, ...])Add a coregistration visualization to the report.
copy()Return a deepcopy of the report.
Get the content of the report.
parse_folder(data_path[, pattern, n_jobs, ...])Render all the files in the folder.
remove(*[, title, tags, remove_all])Remove elements from the report.
reorder(order)Reorder the report content.
save([fname, open_browser, overwrite, ...])Save the report and optionally open it in browser.
Notes
See Getting started with mne.Report for an introduction to using
mne.Report.New in v0.8.0.
- __len__()[source]#
Return the number of files processed by the report.
- Returns:
- n_files
int The number of files processed.
- n_files
- add_bem(subject, title, *, subjects_dir=None, decim=2, width=512, n_jobs=None, tags=('bem',), section=None, replace=False)[source]#
Render a visualization of the boundary element model (BEM) surfaces.
- Parameters:
- subject
str The FreeSurfer subject name.
- title
str The title corresponding to the BEM image.
- subjects_dirpath-like |
None The path to the directory containing the FreeSurfer subjects reconstructions. If
None, defaults to theSUBJECTS_DIRenvironment variable.- decim
int Use this decimation factor for generating MRI/BEM images (since it can be time consuming).
- width
int 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_jobs
int|None The number of jobs to run in parallel. If
-1, it is set to the number of CPU cores. Requires thejoblibpackage.None(default) is a marker for ‘unset’ that will be interpreted asn_jobs=1(sequential execution) unless the call is performed under ajoblib.parallel_configcontext manager that sets another value forn_jobs.- tagsarray_like of
str|str Tags to add for later interactive filtering. Must not contain spaces.
- section
str|None The name of the section (or content block) to add the content to. This feature is useful for grouping multiple related content elements together under a single, collapsible section. Each content element will retain its own title and functionality, but not appear separately in the table of contents. Hence, using sections is a way to declutter the table of contents, and to easy navigation of the report.
New in v1.1.
New in v1.9.
- replacebool
If
True, content already present that has the sametitleandsectionwill be replaced. Defaults toFalse, which will cause duplicate entries in the table of contents if an entry fortitlealready exists.
- subject
Notes
New in v0.24.0.
Examples using
add_bem:
- add_code(code, title, *, language='python', tags=('code',), section=None, replace=False)[source]#
Add a code snippet (e.g., an analysis script) to the report.
- Parameters:
- code
str|pathlib.Path The code to add to the report as a string, or the path to a file as a
pathlib.Pathobject.Note
Paths must be passed as
pathlib.Pathobject, since strings will be treated as literal code.- title
str The title corresponding to the code.
- language
str The programming language of
code. This will be used for syntax highlighting. Can be'auto'to try to auto-detect the language.- tagsarray_like of
str|str Tags to add for later interactive filtering. Must not contain spaces.
- section
str|None The name of the section (or content block) to add the content to. This feature is useful for grouping multiple related content elements together under a single, collapsible section. Each content element will retain its own title and functionality, but not appear separately in the table of contents. Hence, using sections is a way to declutter the table of contents, and to easy navigation of the report.
New in v1.1.
New in v1.9.
- replacebool
If
True, content already present that has the sametitleandsectionwill be replaced. Defaults toFalse, which will cause duplicate entries in the table of contents if an entry fortitlealready exists.
- code
Notes
New in v0.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
Covarianceto add to the report.- infopath-like | instance of
Info The
Infocorresponding tocov.- title
str The title corresponding to the
Covarianceobject.- tagsarray_like of
str|str Tags to add for later interactive filtering. Must not contain spaces.
- replacebool
If
True, content already present that has the sametitleandsectionwill be replaced. Defaults toFalse, which will cause duplicate entries in the table of contents if an entry fortitlealready exists.
- covpath-like | instance of
Notes
New in v0.24.0.
Examples using
add_covariance:
- add_custom_css(css)[source]#
Add custom CSS to the report.
- Parameters:
- css
str Style definitions to add to the report. The content of this string will be embedded between HTML
<style>and</style>tags.
- css
Notes
New in v0.23.
- add_custom_js(js)[source]#
Add custom JavaScript to the report.
- Parameters:
- js
str JavaScript code to add to the report. The content of this string will be embedded between HTML
<script>and</script>tags.
- js
Notes
New in v0.23.
- add_epochs(epochs, title, *, psd=True, projs=None, image_kwargs=None, topomap_kwargs=None, drop_log_ignore=('IGNORED',), tags=('epochs',), replace=False)[source]#
Add
Epochsto the report.- Parameters:
- epochspath-like | instance of
Epochs The epochs to add to the report.
- title
str The title to add.
- psdbool |
float If a float, the duration of data to use for creation of PSD plots, in seconds. PSD will be calculated on as many epochs as required to cover at least this duration. Epochs will be picked across the entire time range in equally-spaced distance.
Note
In rare edge cases, we may not be able to create a grid of equally-spaced epochs that cover the entire requested time range. In these situations, a warning will be emitted, informing you about the duration that’s actually being used.
If
True, add PSD plots based on allepochs. IfFalse, do not add PSD plots.- projsbool |
None Whether to add SSP projector plots if projectors are present in the data. If
None, useprojsfromReportcreation.- image_kwargs
dict|None Keyword arguments to pass to the “epochs image”-generating function (
mne.Epochs.plot_image()). Keys are channel types, values are dicts containing kwargs to pass. For example, to use the rejection limits per channel type you could pass:image_kwargs=dict( grad=dict(vmin=-reject['grad'], vmax=-reject['grad']), mag=dict(vmin=-reject['mag'], vmax=reject['mag']), )
New in v1.7.
- topomap_kwargs
dict|None Keyword arguments to pass to the topomap-generating functions.
- drop_log_ignorearray_like of
str The drop reasons to ignore when creating the drop log bar plot. All epochs for which a drop reason listed here appears in
epochs.drop_logwill be excluded from the drop log plot.- tagsarray_like of
str|str Tags to add for later interactive filtering. Must not contain spaces.
- replacebool
If
True, content already present that has the sametitleandsectionwill be replaced. Defaults toFalse, which will cause duplicate entries in the table of contents if an entry fortitlealready exists.
- epochspath-like | instance of
Notes
New in v0.24.
Examples using
add_epochs:
- add_events(events, title, *, event_id=None, sfreq, first_samp=0, color=None, tags=('events',), section=None, replace=False)[source]#
Add events to the report.
- Parameters:
- eventspath-like |
array, shape (n_events, 3) An MNE-Python events array.
- title
str The title corresponding to the events.
- event_id
dict A dictionary mapping event names (keys) to event codes (values).
- sfreq
float The sampling frequency used while recording.
- first_samp
int The first sample point in the recording. This corresponds to
raw.first_sampon files created with Elekta/Neuromag systems.- color
dict|None Dictionary of event_id integers as keys and colors as values. This parameter is directly passed to
mne.viz.plot_events().New in v1.8.0.
- tagsarray_like of
str|str Tags to add for later interactive filtering. Must not contain spaces.
- section
str|None The name of the section (or content block) to add the content to. This feature is useful for grouping multiple related content elements together under a single, collapsible section. Each content element will retain its own title and functionality, but not appear separately in the table of contents. Hence, using sections is a way to declutter the table of contents, and to easy navigation of the report.
New in v1.1.
New in v1.9.
- replacebool
If
True, content already present that has the sametitleandsectionwill be replaced. Defaults toFalse, which will cause duplicate entries in the table of contents if an entry fortitlealready exists.
- eventspath-like |
Notes
New in v0.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=None)[source]#
Add
Evokedobjects to the report.- Parameters:
- evokedspath-like | instance of
Evoked|listofEvoked The evoked data to add to the report. Multiple
Evokedobjects – as returned frommne.read_evokeds– can be passed as a list.- titles
str|listofstr|None The titles corresponding to the evoked data. If
None, the content ofevoked.commentfrom 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. IfNone, will fall back to thecov_fnameprovided upon report creation.- projsbool |
None Whether to add SSP projector plots if projectors are present in the data. If
None, useprojsfromReportcreation.- n_time_points
int|None The number of equidistant time points to render. If
None, will render eachEvokedat 21 time points, unless the data contains fewer time points, in which case all will be rendered.- tagsarray_like of
str|str Tags to add for later interactive filtering. Must not contain spaces.
- replacebool
If
True, content already present that has the sametitleandsectionwill be replaced. Defaults toFalse, which will cause duplicate entries in the table of contents if an entry fortitlealready exists.- topomap_kwargs
dict|None Keyword arguments to pass to the topomap-generating functions.
- n_jobs
int|None The number of jobs to run in parallel. If
-1, it is set to the number of CPU cores. Requires thejoblibpackage.None(default) is a marker for ‘unset’ that will be interpreted asn_jobs=1(sequential execution) unless the call is performed under ajoblib.parallel_configcontext manager that sets another value forn_jobs.
- evokedspath-like | instance of
Notes
New in v0.24.0.
Examples using
add_evokeds:
- add_figure(fig, title, *, caption=None, image_format=None, tags=('custom-figure',), section=None, replace=False)[source]#
Add figures to the report.
- Parameters:
- fig
matplotlib.figure.Figure|Figure3D|array| array_like ofmatplotlib.figure.Figure| array_like ofFigure3D| array_like ofarray One or more figures to add to the report. All figures must be an instance of
matplotlib.figure.Figure,mne.viz.Figure3D, ornumpy.ndarray. If multiple figures are passed, they will be added as “slides” that can be navigated using buttons and a slider element.- title
str The title corresponding to the figure(s).
- caption
str| array_like ofstr|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 duringReportinstantiation.- tagsarray_like of
str|str Tags to add for later interactive filtering. Must not contain spaces.
- section
str|None The name of the section (or content block) to add the content to. This feature is useful for grouping multiple related content elements together under a single, collapsible section. Each content element will retain its own title and functionality, but not appear separately in the table of contents. Hence, using sections is a way to declutter the table of contents, and to easy navigation of the report.
New in v1.1.
- replacebool
If
True, content already present that has the sametitleandsectionwill be replaced. Defaults toFalse, which will cause duplicate entries in the table of contents if an entry fortitlealready exists.
- fig
Notes
New in v0.24.0.
Examples using
add_figure:
- add_forward(forward, title, *, subject=None, subjects_dir=None, plot=False, tags=('forward-solution',), section=None, replace=False)[source]#
Add a forward solution.
- Parameters:
- forwardinstance of
Forward| path-like The forward solution to add to the report.
- title
str The title corresponding to forward solution.
- subject
str|None The name of the FreeSurfer subject
forwardbelongs to. IfNone, will use the value ofsubjectpassed on report creation.- subjects_dirpath-like |
None The FreeSurfer
SUBJECTS_DIR.- plotbool
If True, plot the source space of the forward solution.
New in v1.10.
- tagsarray_like of
str|str Tags to add for later interactive filtering. Must not contain spaces.
- section
str|None The name of the section (or content block) to add the content to. This feature is useful for grouping multiple related content elements together under a single, collapsible section. Each content element will retain its own title and functionality, but not appear separately in the table of contents. Hence, using sections is a way to declutter the table of contents, and to easy navigation of the report.
New in v1.1.
New in v1.9.
- replacebool
If
True, content already present that has the sametitleandsectionwill be replaced. Defaults toFalse, which will cause duplicate entries in the table of contents if an entry fortitlealready exists.
- forwardinstance of
Notes
New in v0.24.0.
Examples using
add_forward:
- add_html(html, title, *, tags=('custom-html',), section=None, replace=False)[source]#
Add HTML content to the report.
- Parameters:
- html
str The HTML content to add.
- title
str The title corresponding to
html.- tagsarray_like of
str|str Tags to add for later interactive filtering. Must not contain spaces.
- section
str|None The name of the section (or content block) to add the content to. This feature is useful for grouping multiple related content elements together under a single, collapsible section. Each content element will retain its own title and functionality, but not appear separately in the table of contents. Hence, using sections is a way to declutter the table of contents, and to easy navigation of the report.
New in v1.1.
New in v1.3.
- replacebool
If
True, content already present that has the sametitleandsectionwill be replaced. Defaults toFalse, which will cause duplicate entries in the table of contents if an entry fortitlealready exists.
- html
Notes
New in v0.24.0.
Examples using
add_html:
- add_ica(ica, title, *, inst, picks=None, ecg_evoked=None, eog_evoked=None, ecg_scores=None, eog_scores=None, n_jobs=None, tags=('ica',), replace=False)[source]#
Add (a fitted)
ICAto the report.- Parameters:
- icapath-like | instance of
mne.preprocessing.ICA The fitted ICA to add.
- title
str 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.- picks
int|listofint|slice|None Indices of the independent components (ICs) to visualize. If an integer, represents the index of the IC to pick. Multiple ICs can be selected using a list of int or a slice. The indices are 0-indexed, so
picks=1will pick the second IC:ICA001.Nonewill pick all independent components in the order fitted. 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_scores
arrayoffloat|listofarrayoffloat|None The scores produced by
mne.preprocessing.ICA.find_bads_ecg()andmne.preprocessing.ICA.find_bads_eog(), respectively. If passed, will be used to visualize the scoring for each ICA component.- n_jobs
int|None The number of jobs to run in parallel. If
-1, it is set to the number of CPU cores. Requires thejoblibpackage.None(default) is a marker for ‘unset’ that will be interpreted asn_jobs=1(sequential execution) unless the call is performed under ajoblib.parallel_configcontext manager that sets another value forn_jobs.- tagsarray_like of
str|str Tags to add for later interactive filtering. Must not contain spaces.
- replacebool
If
True, content already present that has the sametitleandsectionwill be replaced. Defaults toFalse, which will cause duplicate entries in the table of contents if an entry fortitlealready exists.
- icapath-like | instance of
Notes
New in v0.24.0.
Examples using
add_ica:
- add_image(image, title, *, caption=None, tags=('custom-image',), section=None, replace=False)[source]#
Add an image (e.g., PNG or JPEG pictures) to the report.
- Parameters:
- imagepath-like
The image to add.
- title
str Title corresponding to the images.
- caption
str|None If not
None, the caption to add to the image.- tagsarray_like of
str|str Tags to add for later interactive filtering. Must not contain spaces.
- section
str|None The name of the section (or content block) to add the content to. This feature is useful for grouping multiple related content elements together under a single, collapsible section. Each content element will retain its own title and functionality, but not appear separately in the table of contents. Hence, using sections is a way to declutter the table of contents, and to easy navigation of the report.
New in v1.1.
- replacebool
If
True, content already present that has the sametitleandsectionwill be replaced. Defaults toFalse, which will cause duplicate entries in the table of contents if an entry fortitlealready exists.
Notes
New in v0.24.0.
Examples using
add_image:
- add_inverse_operator(inverse_operator, title, *, subject=None, subjects_dir=None, trans=None, plot=False, tags=('inverse-operator',), section=None, replace=False)[source]#
Add an inverse operator.
- Parameters:
- inverse_operatorinstance of
InverseOperator| path-like The inverse operator to add to the report.
- title
str The title corresponding to the inverse operator object.
- subject
str|None The name of the FreeSurfer subject
inverse_opbelongs to IfNone, will use the value ofsubjectpassed on report creation.- subjects_dirpath-like |
None The FreeSurfer
SUBJECTS_DIR.- transpath-like | instance of
Transform|None Deprecated and will be removed in 1.11. The trans stored in the inverse operator will be used instead.
- plotbool
If True, plot the source space of the inverse operator.
New in v1.10.
- tagsarray_like of
str|str Tags to add for later interactive filtering. Must not contain spaces.
- section
str|None The name of the section (or content block) to add the content to. This feature is useful for grouping multiple related content elements together under a single, collapsible section. Each content element will retain its own title and functionality, but not appear separately in the table of contents. Hence, using sections is a way to declutter the table of contents, and to easy navigation of the report.
New in v1.1.
New in v1.9.
- replacebool
If
True, content already present that has the sametitleandsectionwill be replaced. Defaults toFalse, which will cause duplicate entries in the table of contents if an entry fortitlealready exists.
- inverse_operatorinstance of
Notes
New in v0.24.0.
Examples using
add_inverse_operator:
- add_projs(*, info, title, projs=None, topomap_kwargs=None, tags=('ssp',), joint=False, picks_trace=None, section=None, replace=False)[source]#
Render (SSP) projection vectors.
- Parameters:
- infoinstance of
Info| instance ofEvoked| path-like An
Infostructure or the path of a file containing one.- title
str The title corresponding to the
Projectionobject.- 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. IfNone, the projectors are taken frominfo['projs'].- topomap_kwargs
dict|None Keyword arguments to pass to the topomap-generating functions.
- tagsarray_like of
str|str Tags to add for later interactive filtering. Must not contain spaces.
- jointbool
If True (default False), plot the projectors using
mne.viz.plot_projs_joint(), otherwise usemne.viz.plot_projs_topomap(). If True, theninfomust be an instance ofmne.Evoked.New in v1.9.
- picks_trace
str| array_like |slice|None Channels to show alongside the projected time courses. Typically these are the ground-truth channels for an artifact (e.g.,
'eog'or'ecg'). Slices and lists of integers will be interpreted as channel indices. In lists, channel type strings (e.g.,['meg', 'eeg']) will pick channels of those types, channel name strings (e.g.,['MEG0111', 'MEG2623']will pick the given channels. Can also be the string values'all'to pick all channels, or'data'to pick data channels. None (default) will pick no channels. Only used whenjoint=True.New in v1.9.
- section
str|None The name of the section (or content block) to add the content to. This feature is useful for grouping multiple related content elements together under a single, collapsible section. Each content element will retain its own title and functionality, but not appear separately in the table of contents. Hence, using sections is a way to declutter the table of contents, and to easy navigation of the report.
New in v1.1.
New in v1.9.
- replacebool
If
True, content already present that has the sametitleandsectionwill be replaced. Defaults toFalse, which will cause duplicate entries in the table of contents if an entry fortitlealready exists.
- infoinstance of
Notes
New in v0.24.0.
Examples using
add_projs:
- add_raw(raw, title, *, psd=None, projs=None, butterfly=True, scalings=None, tags=('raw',), replace=False, topomap_kwargs=None)[source]#
Add
Rawobjects to the report.- Parameters:
- rawpath-like | instance of
Raw The data to add to the report.
- title
str The title corresponding to the
rawobject.- psdbool |
None Whether to add PSD plots. Overrides the
raw_psdparameter passed when initializing theReport. IfNone, useraw_psdfromReportcreation.- projsbool |
None Whether to add SSP projector plots if projectors are present in the data. If
None, useprojsfromReportcreation.- butterflybool |
int Whether to add butterfly plots of the data. Can be useful to spot problematic channels. If
True, 10 equally-spaced 1-second segments will be plotted. If an integer, specifies the number of 1-second segments to plot. Larger numbers may take a considerable amount of time if the data contains many sensors. You can disable butterfly plots altogether by passingFalse.- scalings‘auto’ |
dict|None Scaling factors for the traces. If a dictionary where any value is
'auto', the scaling factor is set to match the 99.5th percentile of the respective data. If'auto', all scalings (for all channel types) are set to'auto'. If any values are'auto'and the data is not preloaded, a subset up to 100 MB will be loaded. IfNone, defaults to:dict(mag=1e-12, grad=4e-11, eeg=20e-6, eog=150e-6, ecg=5e-4, emg=1e-3, ref_meg=1e-12, misc=1e-3, stim=1, resp=1, chpi=1e-4, whitened=1e2)
Note
A particular scaling value
scorresponds to half of the visualized signal range around zero (i.e. from0to+sor from0to-s). For example, the default scaling of20e-6(20µV) for EEG signals means that the visualized range will be 40 µV (20 µV in the positive direction and 20 µV in the negative direction).- tagsarray_like of
str|str Tags to add for later interactive filtering. Must not contain spaces.
- replacebool
If
True, content already present that has the sametitleandsectionwill be replaced. Defaults toFalse, which will cause duplicate entries in the table of contents if an entry fortitlealready exists.- topomap_kwargs
dict|None Keyword arguments to pass to the topomap-generating functions.
- rawpath-like | instance of
Notes
New in v0.24.0.
Examples using
add_raw:
- add_stc(stc, title, *, subject=None, subjects_dir=None, n_time_points=None, tags=('source-estimate',), replace=False, section=None, stc_plot_kwargs=None)[source]#
Add a
SourceEstimate(STC) to the report.- Parameters:
- stcpath-like | instance of
SourceEstimate The
SourceEstimateto add to the report.- title
str The title to add.
- subject
str|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 ofsubjectpassed on report creation.- subjects_dirpath-like |
None The FreeSurfer
SUBJECTS_DIR.- n_time_points
int|None The number of equidistant time points to render. If
None, will renderstcat 51 time points, unless the data contains fewer time points, in which case all will be rendered.- tagsarray_like of
str|str Tags to add for later interactive filtering. Must not contain spaces.
- replacebool
If
True, content already present that has the sametitleandsectionwill be replaced. Defaults toFalse, which will cause duplicate entries in the table of contents if an entry fortitlealready exists.- section
str|None The name of the section (or content block) to add the content to. This feature is useful for grouping multiple related content elements together under a single, collapsible section. Each content element will retain its own title and functionality, but not appear separately in the table of contents. Hence, using sections is a way to declutter the table of contents, and to easy navigation of the report.
New in v1.1.
New in v1.9.
- stc_plot_kwargs
dict Dictionary of keyword arguments to pass to
mne.SourceEstimate.plot. Only used when plotting in 3D mode.
- stcpath-like | instance of
Notes
New in v0.24.0.
Examples using
add_stc:
- add_sys_info(title, *, tags=('mne-sysinfo',), replace=False)[source]#
Add a MNE-Python system information to the report.
This is a convenience method that captures the output of
mne.sys_infoand adds it to the report.- Parameters:
- title
str The title to assign.
- tagsarray_like of
str|str Tags to add for later interactive filtering. Must not contain spaces.
- replacebool
If
True, content already present that has the sametitleandsectionwill be replaced. Defaults toFalse, which will cause duplicate entries in the table of contents if an entry fortitlealready exists.
- title
Notes
New in v0.24.0.
- add_trans(trans, *, info, title, subject=None, subjects_dir=None, alpha=None, coord_frame='mri', plot_kwargs=None, tags=('coregistration',), section=None, replace=False)[source]#
Add a coregistration visualization to the report.
- Parameters:
- transpath-like |
dict| instance ofTransform|"fsaverage"|None If str, the path to the head<->MRI transform
*-trans.fiffile produced during coregistration. Can also be'fsaverage'to use the built-in fsaverage transformation. If trans is None, an identity matrix is assumed. “auto” will load trans from the FreeSurfer directory specified bysubjectandsubjects_dirparameters.Changed in version 1.10: Support for ‘fsaverage’ argument.
- infopath-like | instance of
Info The
Infocorresponding totrans.- title
str The title to add.
- subject
str|None The name of the FreeSurfer subject the
transbelongs to. The name is not stored with thetransand therefore needs to be specified. IfNone, will use the value ofsubjectpassed on report creation.- subjects_dirpath-like |
None The FreeSurfer
SUBJECTS_DIR.- alpha
float|None The level of opacity to apply to the head surface. If a float, must be between 0 and 1 (inclusive), where 1 means fully opaque. If
None, will use the MNE-Python default value. See alsoplot_kwargs.- coord_frame‘auto’ | ‘head’ | ‘meg’ | ‘mri’
Coordinate frame used for plotting. See
mne.viz.plot_alignment()andplot_kwargs.- plot_kwargs
dict|None Plotting arguments to be passed to
mne.viz.plot_alignment(). Ifalphais notNone, it will override a potentialplot_kwargs["alpha"]. Thecoord_framekey word argument always overrides a potentialplot_kwargs["coord_frame"]. IfNone, this defaults todict(dig=True, meg=("helmet", "sensors"), show_axes=True).New in v1.10.
- tagsarray_like of
str|str Tags to add for later interactive filtering. Must not contain spaces.
- section
str|None The name of the section (or content block) to add the content to. This feature is useful for grouping multiple related content elements together under a single, collapsible section. Each content element will retain its own title and functionality, but not appear separately in the table of contents. Hence, using sections is a way to declutter the table of contents, and to easy navigation of the report.
New in v1.1.
New in v1.9.
- replacebool
If
True, content already present that has the sametitleandsectionwill be replaced. Defaults toFalse, which will cause duplicate entries in the table of contents if an entry fortitlealready exists.
- transpath-like |
Notes
New in v0.24.0.
Examples using
add_trans:
- copy()[source]#
Return a deepcopy of the report.
- Returns:
- reportinstance of
Report The copied report.
- reportinstance of
- property html#
A list of HTML representations for all content elements.
- parse_folder(data_path, pattern=None, n_jobs=None, mri_decim=2, sort_content=True, *, on_error='warn', image_format=None, render_bem=True, plot_src=False, 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_pathpath-like
Path to the folder containing data whose HTML report will be created.
- pattern
None|str|listofstr Filename global pattern(s) to include in the report. For example,
['\*raw.fif', '\*ave.fif']will includeRawas well asEvokedfiles. IfNone, include all supported file formats.Changed in version 0.23: Include supported non-FIFF files by default.
- n_jobs
int|None The number of jobs to run in parallel. If
-1, it is set to the number of CPU cores. Requires thejoblibpackage.None(default) is a marker for ‘unset’ that will be interpreted asn_jobs=1(sequential execution) unless the call is performed under ajoblib.parallel_configcontext manager that sets another value forn_jobs.- mri_decim
int 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 v0.24.0.
- on_error
'ignore'|'warn'|'raise' 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 duringReportinstantiation.New in v0.15.
- render_bembool
If True (default), try to render the BEM.
New in v0.16.
- plot_srcbool
If True (default False), plot the source space when adding a forward or inverse.
New in v1.10.
- n_time_points_evokeds, n_time_points_stcs
int|None The number of equidistant time points to render for
EvokedandSourceEstimatedata, respectively. IfNone, will render eachEvokedat 21 and eachSourceEstimateat 51 time points, unless the respective data contains fewer time points, in which case all will be rendered.New in v0.24.0.
- raw_butterflybool
Whether to render butterfly plots for (decimated)
Rawdata.New in v0.24.0.
- stc_plot_kwargs
dict Dictionary of keyword arguments to pass to
mne.SourceEstimate.plot. Only used when plotting in 3D mode.New in v0.24.0.
- topomap_kwargs
dict|None Keyword arguments to pass to the topomap-generating functions.
New in v0.24.0.
- verbosebool |
str|int|None Control verbosity of the logging output. If
None, use the default verbosity level. See the logging documentation andmne.verbose()for details. Should only be passed as a keyword argument.
Examples using
parse_folder:
- remove(*, 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:
- title
str The title of the element(s) to remove.
New in v0.24.0.
- tagsarray_like of
str|str|None If supplied, restrict the operation to elements with the supplied tags.
New in v0.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. IfTrue, all matches will be removed.New in v0.24.0.
- title
- Returns:
- reorder(order)[source]#
Reorder the report content.
- Parameters:
- orderarray_like of
int The indices of the new order (as if you were reordering an array). For example if there are 4 elements in the report,
order=[3, 0, 1, 2]would take the last element and move it to the front. In other words,elements = [elements[ii] for ii in order]].
- orderarray_like of
Notes
New in v1.7.
- 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
.h5or.hdf5, the report is saved in HDF5 format, so it can later be loaded again withopen_report(). For any other suffix, the report will be saved in HTML format. IfNoneandReport.parse_folder()was not called, the report is saved asreport.htmlin the current working directory. IfNoneandReport.parse_folder()was used, the report is saved asreport.htmlinside thedata_pathsupplied toReport.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 v0.24.0.
- verbosebool |
str|int|None Control verbosity of the logging output. If
None, use the default verbosity level. See the logging documentation andmne.verbose()for details. Should only be passed as a keyword argument.
- fnamepath-like |
- Returns:
- fname
str The file name to which the report was saved.
- fname
Examples using
save:
- property tags#
A sorted tuple of all tags currently used in the report.