.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/04_glm_first_level/plot_bids_features.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. or to run this example in your browser via Binder .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_04_glm_first_level_plot_bids_features.py: First level analysis of a complete BIDS dataset from openneuro ============================================================== Full step-by-step example of fitting a :term:`GLM` to perform a first level analysis in an openneuro :term:`BIDS` dataset. We demonstrate how :term:`BIDS` derivatives can be exploited to perform a simple one subject analysis with minimal code. Details about the :term:`BIDS` standard are available at `https://bids.neuroimaging.io/ `_. We also demonstrate how to download individual groups of files from the Openneuro s3 bucket. More specifically: 1. Download an :term:`fMRI` :term:`BIDS` dataset with derivatives from openneuro. 2. Extract first level model objects automatically from the :term:`BIDS` dataset. 3. Demonstrate Quality assurance of Nilearn estimation against available FSL. estimation in the openneuro dataset. 4. Display contrast plot and uncorrected first level statistics table report. .. GENERATED FROM PYTHON SOURCE LINES 26-37 Fetch openneuro :term:`BIDS` dataset ------------------------------------ We download one subject from the ``stopsignal`` task in the ds000030 :term:`BIDS` dataset available in openneuro. This dataset contains the necessary information to run a statistical analysis using Nilearn. The dataset also contains statistical results from a previous FSL analysis that we can employ for comparison with the Nilearn estimation. For more information, see the :ref:`dataset description `. .. GENERATED FROM PYTHON SOURCE LINES 37-75 .. code-block:: Python from nilearn.datasets import ( fetch_ds000030_urls, fetch_openneuro_dataset, select_from_index, ) _, urls = fetch_ds000030_urls() # Only keep the files for the ``stopsignal`` task that are actually # needed for this example: the raw functional data and events, # the relevant fMRIPrep derivatives, and the FSL ``stopsignal.feat`` # derivatives used later on for comparison. # Restricting the download with a ``inclusion_filters`` this way, # rather than trying to list every folder to exclude, # avoids pulling in the (much larger) derivatives # of the other tasks acquired for this subject. inclusion_patterns = ["*sub-*stopsignal*"] # Some fMRIPrep and FSL derivatives are are not used in that example. exclusion_patterns = [ "*_space-T1w*", "*_space-fsaverage*", "*cope*gz", "*jpg", "*png", "*txt", "*tiff", "*gif", "*res4D*", ] urls = select_from_index( urls, inclusion_filters=inclusion_patterns, exclusion_filters=exclusion_patterns, n_subjects=1, ) data_dir, _ = fetch_openneuro_dataset(urls=urls) .. rst-class:: sphx-glr-script-out .. code-block:: none [fetch_ds000030_urls] Dataset directory found: /home/runner/work/nilearn/nilearn/nilearn_data/ds000030/ds000030_R1.0.4/uncompressed [fetch_openneuro_dataset] Dataset directory found: /home/runner/work/nilearn/nilearn/nilearn_data/ds000030/ds000030_R1.0.4/uncompressed .. GENERATED FROM PYTHON SOURCE LINES 76-88 Obtain FirstLevelModel objects automatically and fit arguments -------------------------------------------------------------- From the dataset directory we automatically obtain FirstLevelModel objects with their subject_id filled from the :term:`BIDS` dataset. Moreover we obtain, for each model, the list of run images and their respective events and confound regressors. Those are inferred from the confounds.tsv files available in the :term:`BIDS` dataset. To get the first level models we have to specify the dataset directory, the task_label and the space_label as specified in the file names. We also have to provide the folder with the desired derivatives, that in this case were produced by the :term:`fMRIPrep` :term:`BIDS` app. .. GENERATED FROM PYTHON SOURCE LINES 88-109 .. code-block:: Python from nilearn.glm.first_level import first_level_from_bids task_label = "stopsignal" space_label = "MNI152NLin2009cAsym" derivatives_folder = "derivatives/fmriprep" ( models, models_run_imgs, models_events, models_confounds, ) = first_level_from_bids( data_dir, task_label, space_label, mask_img="derivatives", smoothing_fwhm=5.0, derivatives_folder=derivatives_folder, n_jobs=2, verbose=1, ) .. rst-class:: sphx-glr-script-out .. code-block:: none /home/runner/work/nilearn/nilearn/examples/04_glm_first_level/plot_bids_features.py:98: UserWarning: No bold.json found in BIDS folder in: /home/runner/work/nilearn/nilearn/nilearn_data/ds000030/ds000030_R1.0.4/uncompressed/derivatives/fmriprep. /home/runner/work/nilearn/nilearn/examples/04_glm_first_level/plot_bids_features.py:98: UserWarning: 'slice_time_ref' not provided and cannot be inferred from metadata. It will be assumed that the slice timing reference is 0.0 percent of the repetition time. If it is not the case it will need to be set manually in the generated list of models. [first_level_from_bids] Found the following 1 preprocessed BOLD files - for subject 10159 - for filter: [('task', 'stopsignal'), ('space', 'MNI152NLin2009cAsym')]: - /home/runner/work/nilearn/nilearn/nilearn_data/ds000030/ds000030_R1.0.4/uncompressed/derivatives/fmriprep/sub-10159/func/sub-10159_task-stopsignal_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz [first_level_from_bids] Found the following 1 events files - for subject 10159 - for filter: [('task', 'stopsignal')]: - /home/runner/work/nilearn/nilearn/nilearn_data/ds000030/ds000030_R1.0.4/uncompressed/sub-10159/func/sub-10159_task-stopsignal_events.tsv [first_level_from_bids] Found the following 1 confounds files - for subject 10159 - for filter: [('task', 'stopsignal')]: - /home/runner/work/nilearn/nilearn/nilearn_data/ds000030/ds000030_R1.0.4/uncompressed/derivatives/fmriprep/sub-10159/func/sub-10159_task-stopsignal_desc-confounds_regressors.tsv [first_level_from_bids] Found the following 1 masks files - for subject 10159 - for filter: [('task', 'stopsignal'), ('space', 'MNI152NLin2009cAsym')]: - /home/runner/work/nilearn/nilearn/nilearn_data/ds000030/ds000030_R1.0.4/uncompressed/derivatives/fmriprep/sub-10159/func/sub-10159_task-stopsignal_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz .. GENERATED FROM PYTHON SOURCE LINES 110-111 Access the model and model arguments of the subject and process events. .. GENERATED FROM PYTHON SOURCE LINES 111-137 .. code-block:: Python model, imgs, events, confounds = ( models[0], models_run_imgs[0], models_events[0], models_confounds[0], ) subject = f"sub-{model.subject_label}" model.minimize_memory = False # override default from pathlib import Path from nilearn.interfaces.fsl import get_design_from_fslmat fsl_design_matrix_path = ( Path(data_dir) / "derivatives" / "task" / subject / "stopsignal.feat" / "design.mat" ) design_matrix = get_design_from_fslmat( fsl_design_matrix_path, column_names=None ) .. GENERATED FROM PYTHON SOURCE LINES 138-141 We identify the columns of the Go and StopSuccess conditions of the design matrix inferred from the FSL file, to use them later for contrast definition. .. GENERATED FROM PYTHON SOURCE LINES 141-148 .. code-block:: Python design_columns = [ f"cond_{int(i):02}" for i in range(len(design_matrix.columns)) ] design_columns[0] = "Go" design_columns[4] = "StopSuccess" design_matrix.columns = design_columns .. GENERATED FROM PYTHON SOURCE LINES 149-152 First level model estimation (one subject) ------------------------------------------ We fit the first level model for one subject. .. GENERATED FROM PYTHON SOURCE LINES 152-154 .. code-block:: Python model.fit(imgs, design_matrices=[design_matrix]) .. rst-class:: sphx-glr-script-out .. code-block:: none /home/runner/work/nilearn/nilearn/examples/04_glm_first_level/plot_bids_features.py:152: UserWarning: If design matrices are supplied, [t_r] will be ignored. /home/runner/work/nilearn/nilearn/examples/04_glm_first_level/plot_bids_features.py:152: RuntimeWarning: [MultiNiftiMasker.fit] Generation of a mask has been requested (imgs != None) while a mask was given at masker creation. Given mask will be used. [FirstLevelModel.fit] Computing run 1 out of 1 runs (go take a coffee, a big one). [FirstLevelModel.fit] Performing mask computation. [FirstLevelModel.fit] Masking took 1 seconds. [FirstLevelModel.fit] Performing GLM computation. [FirstLevelModel.fit] GLM took 3 seconds. [FirstLevelModel.fit] Computation of 1 runs done in 00 HR 00 MIN 05 SEC. .. raw:: html
First Level Model
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.


.. GENERATED FROM PYTHON SOURCE LINES 155-157 Then we compute the StopSuccess - Go contrast. We can use the column names of the design matrix. .. GENERATED FROM PYTHON SOURCE LINES 157-159 .. code-block:: Python z_map = model.compute_contrast("StopSuccess - Go") .. GENERATED FROM PYTHON SOURCE LINES 160-164 Visualize results ----------------- Let's have a look at the Nilearn estimation and the FSL estimation available in the dataset. .. GENERATED FROM PYTHON SOURCE LINES 164-195 .. code-block:: Python import matplotlib.pyplot as plt import nibabel as nib from scipy.stats import norm from nilearn.plotting import plot_glass_brain, show fsl_z_map = nib.load( Path(data_dir) / "derivatives" / "task" / subject / "stopsignal.feat" / "stats" / "zstat12.nii.gz" ) plot_glass_brain( z_map, threshold=norm.isf(0.001), title='Nilearn Z map of "StopSuccess - Go" (unc p<0.001)', plot_abs=False, display_mode="ortho", ) plot_glass_brain( fsl_z_map, threshold=norm.isf(0.001), title='FSL Z map of "StopSuccess - Go" (unc p<0.001)', plot_abs=False, display_mode="ortho", ) .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/04_glm_first_level/images/sphx_glr_plot_bids_features_001.png :alt: plot bids features :srcset: /auto_examples/04_glm_first_level/images/sphx_glr_plot_bids_features_001.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/04_glm_first_level/images/sphx_glr_plot_bids_features_002.png :alt: plot bids features :srcset: /auto_examples/04_glm_first_level/images/sphx_glr_plot_bids_features_002.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 196-197 We show the agreement between the 2 estimations. .. GENERATED FROM PYTHON SOURCE LINES 197-210 .. code-block:: Python from nilearn.plotting import plot_bland_altman, plot_img_comparison plot_img_comparison( z_map, fsl_z_map, model.masker_, ref_label="Nilearn", src_label="FSL" ) plot_bland_altman( z_map, fsl_z_map, model.masker_, ref_label="Nilearn", src_label="FSL" ) show() .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/04_glm_first_level/images/sphx_glr_plot_bids_features_003.png :alt: Pearson's R: 0.97, Histogram of imgs values :srcset: /auto_examples/04_glm_first_level/images/sphx_glr_plot_bids_features_003.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/04_glm_first_level/images/sphx_glr_plot_bids_features_004.png :alt: plot bids features :srcset: /auto_examples/04_glm_first_level/images/sphx_glr_plot_bids_features_004.png :class: sphx-glr-multi-img .. GENERATED FROM PYTHON SOURCE LINES 211-221 Saving model outputs to disk ---------------------------- It can be useful to quickly generate a portable, ready-to-view report with most of the pertinent information. We can do this by saving the output of the GLM to disk including an HTML report. This is easy to do if you have a fitted model and the list of contrasts, which we do here. .. GENERATED FROM PYTHON SOURCE LINES 221-237 .. code-block:: Python from nilearn.glm import save_glm_to_bids output_dir = Path.cwd() / "results" / "plot_bids_features" output_dir.mkdir(exist_ok=True, parents=True) stat_threshold = norm.isf(0.001) save_glm_to_bids( model, contrasts="StopSuccess - Go", contrast_types={"StopSuccess - Go": "t"}, out_dir=output_dir / "derivatives" / "nilearn_glm", threshold=stat_threshold, cluster_threshold=10, ) .. rst-class:: sphx-glr-script-out .. code-block:: none /home/runner/work/nilearn/nilearn/examples/04_glm_first_level/plot_bids_features.py:228: UserWarning: Contrast name "StopSuccess - Go" changed to "stopsuccessMinusGo" [save_glm_to_bids] Saving mask... [save_glm_to_bids] Generating design matrices figures... [save_glm_to_bids] Generating contrast matrices figures... [save_glm_to_bids] Saving contrast-level statistical maps... [save_glm_to_bids] Saving model level statistical maps... [save_glm_to_bids] Generating HTML... /home/runner/work/nilearn/nilearn/examples/04_glm_first_level/plot_bids_features.py:228: UserWarning: 'threshold=3.090232306167813' is not used with 'height_control='fpr''. 'threshold' is only used when 'height_control=None'. 'threshold' was set to 'None'. .. raw:: html
First Level Model
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.


.. GENERATED FROM PYTHON SOURCE LINES 238-239 View the generated files .. GENERATED FROM PYTHON SOURCE LINES 239-242 .. code-block:: Python files = sorted((output_dir / "derivatives" / "nilearn_glm").glob("**/*")) print("\n".join([str(x.relative_to(output_dir)) for x in files])) .. rst-class:: sphx-glr-script-out .. code-block:: none derivatives/nilearn_glm/dataset_description.json derivatives/nilearn_glm/sub-10159 derivatives/nilearn_glm/sub-10159/report.html derivatives/nilearn_glm/sub-10159/statmap.json derivatives/nilearn_glm/sub-10159/sub-10159_task-stopsignal_space-MNI152NLin2009cAsym_contrast-stopsuccessMinusGo_clusters.json derivatives/nilearn_glm/sub-10159/sub-10159_task-stopsignal_space-MNI152NLin2009cAsym_contrast-stopsuccessMinusGo_clusters.tsv derivatives/nilearn_glm/sub-10159/sub-10159_task-stopsignal_space-MNI152NLin2009cAsym_contrast-stopsuccessMinusGo_design.png derivatives/nilearn_glm/sub-10159/sub-10159_task-stopsignal_space-MNI152NLin2009cAsym_contrast-stopsuccessMinusGo_stat-effect_statmap.nii.gz derivatives/nilearn_glm/sub-10159/sub-10159_task-stopsignal_space-MNI152NLin2009cAsym_contrast-stopsuccessMinusGo_stat-p_statmap.nii.gz derivatives/nilearn_glm/sub-10159/sub-10159_task-stopsignal_space-MNI152NLin2009cAsym_contrast-stopsuccessMinusGo_stat-t_statmap.nii.gz derivatives/nilearn_glm/sub-10159/sub-10159_task-stopsignal_space-MNI152NLin2009cAsym_contrast-stopsuccessMinusGo_stat-variance_statmap.nii.gz derivatives/nilearn_glm/sub-10159/sub-10159_task-stopsignal_space-MNI152NLin2009cAsym_contrast-stopsuccessMinusGo_stat-z_statmap.nii.gz derivatives/nilearn_glm/sub-10159/sub-10159_task-stopsignal_space-MNI152NLin2009cAsym_corrdesign.png derivatives/nilearn_glm/sub-10159/sub-10159_task-stopsignal_space-MNI152NLin2009cAsym_design.json derivatives/nilearn_glm/sub-10159/sub-10159_task-stopsignal_space-MNI152NLin2009cAsym_design.png derivatives/nilearn_glm/sub-10159/sub-10159_task-stopsignal_space-MNI152NLin2009cAsym_design.tsv derivatives/nilearn_glm/sub-10159/sub-10159_task-stopsignal_space-MNI152NLin2009cAsym_mask.nii.gz derivatives/nilearn_glm/sub-10159/sub-10159_task-stopsignal_space-MNI152NLin2009cAsym_stat-errorts_statmap.nii.gz derivatives/nilearn_glm/sub-10159/sub-10159_task-stopsignal_space-MNI152NLin2009cAsym_stat-rsquared_statmap.nii.gz .. GENERATED FROM PYTHON SOURCE LINES 243-249 Simple statistical report of thresholded contrast ------------------------------------------------- We display the :term:`contrast` plot and table with cluster information. Here we will the image directly from the results saved to disk. .. GENERATED FROM PYTHON SOURCE LINES 249-273 .. code-block:: Python from nilearn.plotting import plot_contrast_matrix plot_contrast_matrix("StopSuccess - Go", design_matrix) z_map = ( output_dir / "derivatives" / "nilearn_glm" / "sub-10159" / ( "sub-10159_task-stopsignal_space-MNI152NLin2009cAsym_" "contrast-stopsuccessMinusGo_stat-z_statmap.nii.gz" ) ) plot_glass_brain( z_map, threshold=stat_threshold, plot_abs=False, display_mode="z", figure=plt.figure(figsize=(4, 4)), ) show() .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/04_glm_first_level/images/sphx_glr_plot_bids_features_005.png :alt: plot bids features :srcset: /auto_examples/04_glm_first_level/images/sphx_glr_plot_bids_features_005.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/04_glm_first_level/images/sphx_glr_plot_bids_features_006.png :alt: plot bids features :srcset: /auto_examples/04_glm_first_level/images/sphx_glr_plot_bids_features_006.png :class: sphx-glr-multi-img .. GENERATED FROM PYTHON SOURCE LINES 274-300 The saved results include a table of activated clusters. .. note:: This table can also be generated by using the function :func:`nilearn.reporting.get_clusters_table`. .. code-block:: python from nilearn.reporting import get_clusters_table table = get_clusters_table( z_map, stat_threshold=norm.isf(0.001), cluster_threshold=10 ) .. seealso:: The results saved to disk and the output of get_clusters_table do not contain the anatomical location of the clusters. To get the names of the location of the clusters according to one or several atlases, we recommend using the `atlasreader package `_. .. GENERATED FROM PYTHON SOURCE LINES 300-317 .. code-block:: Python import pandas as pd table_file = ( output_dir / "derivatives" / "nilearn_glm" / "sub-10159" / ( "sub-10159_task-stopsignal_space-MNI152NLin2009cAsym_" "contrast-stopsuccessMinusGo_clusters.tsv" ) ) table = pd.read_csv(table_file, sep="\t") table .. raw:: html
Cluster ID X Y Z Peak Stat Cluster Size (mm3)
0 1 15.0 -42.0 90.0 8320.601938 386532.0
1 1a -21.0 15.0 78.0 691.384452 NaN
2 1b 9.0 -51.0 86.0 536.276418 NaN
3 1c -21.0 -33.0 90.0 479.390772 NaN
4 2 18.0 -96.0 34.0 40.887537 1368.0
5 2a 27.0 -93.0 30.0 40.380410 NaN
6 2b 33.0 -90.0 38.0 31.390222 NaN
7 2c 9.0 -96.0 34.0 12.089279 NaN
8 3 -51.0 -69.0 -50.0 36.062351 828.0
9 4 42.0 -87.0 34.0 29.799179 504.0
10 4a 39.0 -93.0 26.0 13.547523 NaN
11 5 63.0 -54.0 50.0 22.556574 576.0
12 5a 66.0 -36.0 50.0 16.328296 NaN
13 5b 63.0 -45.0 54.0 13.731456 NaN
14 6 33.0 -78.0 -54.0 20.190935 936.0
15 7 69.0 -51.0 34.0 15.496225 432.0
16 8 -45.0 -51.0 -46.0 12.949460 468.0
17 9 66.0 -51.0 10.0 11.288989 432.0
18 10 39.0 3.0 -38.0 10.639699 720.0
19 10a 27.0 6.0 -42.0 7.669797 NaN
20 11 -69.0 -27.0 46.0 9.515234 468.0
21 11a -69.0 -36.0 42.0 7.484886 NaN
22 11b -69.0 -30.0 34.0 6.158432 NaN
23 12 -24.0 -3.0 -38.0 8.399317 360.0
24 12a -33.0 -6.0 -38.0 8.186419 NaN
25 13 -45.0 6.0 42.0 7.232974 396.0
26 14 -15.0 -57.0 -10.0 7.195093 396.0
27 15 -3.0 42.0 26.0 6.714833 468.0
28 15a -6.0 42.0 18.0 4.408391 NaN
29 16 -3.0 12.0 54.0 5.883419 396.0
30 16a 3.0 18.0 54.0 5.321565 NaN
31 17 -3.0 9.0 6.0 5.772909 468.0


.. GENERATED FROM PYTHON SOURCE LINES 318-321 We can get a latex table from a Pandas Dataframe for display and publication purposes. .. GENERATED FROM PYTHON SOURCE LINES 321-323 .. code-block:: Python print(table.to_latex()) .. rst-class:: sphx-glr-script-out .. code-block:: none \begin{tabular}{llrrrrr} \toprule & Cluster ID & X & Y & Z & Peak Stat & Cluster Size (mm3) \\ \midrule 0 & 1 & 15.000000 & -42.000000 & 90.000000 & 8320.601938 & 386532.000000 \\ 1 & 1a & -21.000000 & 15.000000 & 78.000000 & 691.384452 & NaN \\ 2 & 1b & 9.000000 & -51.000000 & 86.000000 & 536.276418 & NaN \\ 3 & 1c & -21.000000 & -33.000000 & 90.000000 & 479.390772 & NaN \\ 4 & 2 & 18.000000 & -96.000000 & 34.000000 & 40.887537 & 1368.000000 \\ 5 & 2a & 27.000000 & -93.000000 & 30.000000 & 40.380410 & NaN \\ 6 & 2b & 33.000000 & -90.000000 & 38.000000 & 31.390222 & NaN \\ 7 & 2c & 9.000000 & -96.000000 & 34.000000 & 12.089279 & NaN \\ 8 & 3 & -51.000000 & -69.000000 & -50.000000 & 36.062351 & 828.000000 \\ 9 & 4 & 42.000000 & -87.000000 & 34.000000 & 29.799179 & 504.000000 \\ 10 & 4a & 39.000000 & -93.000000 & 26.000000 & 13.547523 & NaN \\ 11 & 5 & 63.000000 & -54.000000 & 50.000000 & 22.556574 & 576.000000 \\ 12 & 5a & 66.000000 & -36.000000 & 50.000000 & 16.328296 & NaN \\ 13 & 5b & 63.000000 & -45.000000 & 54.000000 & 13.731456 & NaN \\ 14 & 6 & 33.000000 & -78.000000 & -54.000000 & 20.190935 & 936.000000 \\ 15 & 7 & 69.000000 & -51.000000 & 34.000000 & 15.496225 & 432.000000 \\ 16 & 8 & -45.000000 & -51.000000 & -46.000000 & 12.949460 & 468.000000 \\ 17 & 9 & 66.000000 & -51.000000 & 10.000000 & 11.288989 & 432.000000 \\ 18 & 10 & 39.000000 & 3.000000 & -38.000000 & 10.639699 & 720.000000 \\ 19 & 10a & 27.000000 & 6.000000 & -42.000000 & 7.669797 & NaN \\ 20 & 11 & -69.000000 & -27.000000 & 46.000000 & 9.515234 & 468.000000 \\ 21 & 11a & -69.000000 & -36.000000 & 42.000000 & 7.484886 & NaN \\ 22 & 11b & -69.000000 & -30.000000 & 34.000000 & 6.158432 & NaN \\ 23 & 12 & -24.000000 & -3.000000 & -38.000000 & 8.399317 & 360.000000 \\ 24 & 12a & -33.000000 & -6.000000 & -38.000000 & 8.186419 & NaN \\ 25 & 13 & -45.000000 & 6.000000 & 42.000000 & 7.232974 & 396.000000 \\ 26 & 14 & -15.000000 & -57.000000 & -10.000000 & 7.195093 & 396.000000 \\ 27 & 15 & -3.000000 & 42.000000 & 26.000000 & 6.714833 & 468.000000 \\ 28 & 15a & -6.000000 & 42.000000 & 18.000000 & 4.408391 & NaN \\ 29 & 16 & -3.000000 & 12.000000 & 54.000000 & 5.883419 & 396.000000 \\ 30 & 16a & 3.000000 & 18.000000 & 54.000000 & 5.321565 & NaN \\ 31 & 17 & -3.000000 & 9.000000 & 6.000000 & 5.772909 & 468.000000 \\ \bottomrule \end{tabular} .. GENERATED FROM PYTHON SOURCE LINES 324-335 You can also print the output to markdown, if you have the `tabulate` dependencies installed. .. code-block:: bash pip install tabulate .. code-block:: python table.to_markdown() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 26.488 seconds) **Estimated memory usage:** 768 MB .. _sphx_glr_download_auto_examples_04_glm_first_level_plot_bids_features.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/nilearn/nilearn/0.14.1?urlpath=lab/tree/notebooks/auto_examples/04_glm_first_level/plot_bids_features.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_bids_features.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_bids_features.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_bids_features.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_