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.
- nilearn.interfaces.bids.save_glm_to_bids(model, contrasts, contrast_types=None, out_dir='.', prefix=None)[source]#
Save GLM results to BIDS-like files.
New in version 0.9.2.
First- or second-level model from which to save outputs.
stror array of shape (n_col) or
stror array of shape (n_col)) or
Contrast definitions. This may be one of the following:
A list of strings
A dictionary of contrast name: contrast weight key-value pairs. The contrast weights may be strings, lists, or arrays. Arrays may be 1D or 2D, with 1D arrays typically being t-contrasts and 2D arrays typically being F-contrasts.
- contrast_typesNone or
An optional dictionary mapping some or all of the contrast names to specific contrast types (‘t’ or ‘F’). If None, all contrast types will be automatically inferred based on the contrast arrays (1D arrays are t-contrasts, 2D arrays are F-contrasts). Keys in this dictionary must match the keys in the
contrastsdictionary, but only those contrasts for which contrast type must be explicitly set need to be included. Default is None.
Output directory for files. Default is current working directory.
stror None, optional
String to prepend to generated filenames. If a string is provided, ‘_’ will be added to the end. Default is None.
The files generated by this function are a best approximation of appropriate names for GLM-based BIDS derivatives. However, BIDS does not currently have GLM-based derivatives supported in the specification, and there is no guarantee that the files created by this function will be BIDS-compatible if and when the specification supports model derivatives.
This function writes files for the following:
Modeling software information (
Model-level metadata (
Model design matrix (
Model design matrix figure (
Model error (
Model r-squared (
Contrast ‘parameter estimates’ (
Variance of the contrast parameter estimates (
Contrast test statistics (
Contrast p- and z-values (
Contrast weights figure (
First level analysis of a complete BIDS dataset from openneuro