Note

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

3.11.5. nistats.reporting.make_glm_report

nistats.reporting.make_glm_report(model, contrasts, title=None, bg_img=<MNI152Template>, threshold=3.09, alpha=0.001, cluster_threshold=0, height_control='fpr', min_distance=8.0, plot_type='slice', display_mode=None, report_dims=(1600, 800))

Returns HTMLDocument object for a report which shows all important aspects of a fitted GLM. The object can be opened in a browser, displayed in a notebook, or saved to disk as a standalone HTML file.

Examples:

report = make_glm_report(model, contrasts) report.open_in_browser() report.save_as_html(destination_path)

Parameters
model: FirstLevelModel or SecondLevelModel object

A fitted first or second level model object. Must have the computed design matrix(ces).

contrasts: Dict[string, ndarray] or String or List[String] or ndarray or

List[ndarray]

Contrasts information for a first or second level model.

Example:

Dict of contrast names and coefficients, or list of contrast names or list of contrast coefficients or contrast name or contrast coefficient

Each contrast name must be a string. Each contrast coefficient must be a list or numpy array of ints.

Contrasts are passed to contrast_def for FirstLevelModel [1] & second_level_contrast for SecondLevelModel [2] .

title: String, optional

If string, represents the web page’s title and primary heading, model type is sub-heading. If None, page titles and headings are autogenerated using contrast names.

bg_img: Niimg-like object

Default is the MNI152 template See http://nilearn.github.io/manipulating_images/input_output.html The background image for mask and stat maps to be plotted on upon. To turn off background image, just pass “bg_img=None”.

threshold: float

Default is 3.09 Cluster forming threshold in same scale as stat_img (either a t-scale or z-scale value). Used only if height_control is None.

alpha: float

Default is 0.001 Number controlling the thresholding (either a p-value or q-value). Its actual meaning depends on the height_control parameter. This function translates alpha to a z-scale threshold.

cluster_threshold: int, optional

Default is 0 Cluster size threshold, in voxels.

height_control: string or None

false positive control meaning of cluster forming threshold: ‘fpr’ (default) or ‘fdr’ or ‘bonferroni’ or None

min_distance: `float`

For display purposes only. Minimum distance between subpeaks in mm. Default is 8 mm.

plot_type: String. [‘slice’ (default) or ‘glass’]

Specifies the type of plot to be drawn for the statistical maps.

display_mode: string

Default is ‘z’ if plot_type is ‘slice’; ‘ ortho’ if plot_type is ‘glass’.

Choose the direction of the cuts: ‘x’ - sagittal, ‘y’ - coronal, ‘z’ - axial, ‘l’ - sagittal left hemisphere only, ‘r’ - sagittal right hemisphere only, ‘ortho’ - three cuts are performed in orthogonal directions.

Possible values are: ‘ortho’, ‘x’, ‘y’, ‘z’, ‘xz’, ‘yx’, ‘yz’, ‘l’, ‘r’, ‘lr’, ‘lzr’, ‘lyr’, ‘lzry’, ‘lyrz’.

report_dims: Sequence[int, int]

Default is (1600, 800) pixels. Specifies width, height (in pixels) of report window within a notebook. Only applicable when inserting the report into a Jupyter notebook. Can be set after report creation using report.width, report.height.

Returns
report_text: HTMLDocument Object

Contains the HTML code for the GLM Report.

References

1

nistats.first_level_model.FirstLevelModel.compute_contrast

2

nistats.second_level_model.SecondLevelModel.compute_contrast