### Git Commit to Build a Specific Documentation Example Source: https://nilearn.github.io/stable/index.html/ci This Git commit command allows you to trigger the build of a specific documentation example on the CI/CD pipeline. By including `[example] name_of_example.py` in your commit message, you can get quick feedback on changes affecting particular plots without rebuilding the entire documentation. ```bash $ git commit -m "[example] plot_nilearn_101.py" ``` -------------------------------- ### Install Nilearn Documentation Dependencies Source: https://nilearn.github.io/stable/index.html/development Command to install all required Python packages for building Nilearn documentation, including Sphinx and Sphinx-Gallery. ```bash pip install '.[doc]' ``` -------------------------------- ### Maint: Examples Use Pandas Source: https://nilearn.github.io/stable/index.html/changes/whats_new Examples now utilize pandas for handling behavioral information. ```APIDOC Examples: Now use pandas for behavioral information. ``` -------------------------------- ### Nilearn Datasets API: Fetch NeuroVault Example Data Source: https://nilearn.github.io/stable/index.html/changes/whats_new New functions to download simple example data from NeuroVault, specifically for auditory computation and motor tasks. ```APIDOC nilearn.datasets.fetch_neurovault_auditory_computation_task( # Parameters for fetching auditory computation task data ... ) nilearn.datasets.fetch_neurovault_motor_task( # Parameters for fetching motor task data ... ) ``` -------------------------------- ### Install asv package for performance benchmarking Source: https://nilearn.github.io/stable/index.html/development This command installs the 'asv' package, which is a dependency required to run performance benchmarks locally for the Nilearn library. ```bash pip install asv ``` -------------------------------- ### Install Pre-commit Tool Source: https://nilearn.github.io/stable/index.html/development Command to install the pre-commit tool using pip, which manages linters and autoformatters for code quality. ```Shell pip install pre-commit ``` -------------------------------- ### Create and Activate Conda Virtual Environment Source: https://nilearn.github.io/stable/index.html/development Steps to create and activate a Conda virtual environment named 'nilearn' with pip installed, for managing project dependencies in a Conda-based setup. ```Shell conda create -n nilearn pip conda activate nilearn ``` -------------------------------- ### Install Nilearn 0.3.0 Beta Source: https://nilearn.github.io/stable/index.html/changes/whats_new Command to install or upgrade to the 0.3.0 beta version of Nilearn using pip, including pre-release packages. ```Shell pip install --upgrade --pre nilearn ``` -------------------------------- ### Build Modified Documentation Examples with Make Source: https://nilearn.github.io/stable/index.html/development Commands to build only specific modified examples in the documentation using Make, by setting an environment variable for the pattern. ```bash PATTERN='examples/04_glm_first_level/plot_bids_features.py' export PATTERN make -C doc html-modified-examples-only ``` -------------------------------- ### Install Nilearn using Pip Source: https://nilearn.github.io/stable/index.html/quickstart This command installs or upgrades the nilearn library using pip, the Python package installer. Executing this in the proper Python environment ensures nilearn and its dependencies are available for use. ```bash python -m pip install -U nilearn ``` -------------------------------- ### Install Git Pre-commit Hooks Source: https://nilearn.github.io/stable/index.html/development Command to install `pre-commit` hooks, which automatically run linters and other checks before each commit, enforcing code quality and consistency. ```Shell pre-commit install ``` -------------------------------- ### Ensure pip install Nilearn Installs Dependencies Source: https://nilearn.github.io/stable/index.html/changes/whats_new The `pip install nilearn` command now correctly installs all necessary dependencies. This resolves issues where users might have missing packages after installation, ensuring a complete and functional Nilearn environment out-of-the-box. ```Python # Fix: 'pip install nilearn' now installs all necessary dependencies. ``` -------------------------------- ### Verify Nilearn Installation Source: https://nilearn.github.io/stable/index.html/quickstart This Python snippet checks if the nilearn library has been successfully installed by attempting to import it into a Python or iPython session. If no error is raised, the installation is confirmed to be correct. ```python import nilearn ``` -------------------------------- ### Fetch Example fMRI Dataset Source: https://nilearn.github.io/stable/index.html/_downloads/f1b2816325c4af9c73c14789e294718a/plot_copy_headers_math_img Fetches an example fMRI dataset using `nilearn.datasets.fetch_adhd` for demonstration purposes, retrieving data for two subjects. ```python from nilearn.datasets import fetch_adhd dataset = fetch_adhd(n_subjects=2) ``` -------------------------------- ### Fetch Example fMRI Dataset with Nilearn Source: https://nilearn.github.io/stable/index.html/auto_examples/07_advanced/plot_copy_headers_math_img This snippet demonstrates how to fetch an example fMRI dataset, specifically the ADHD dataset, using `nilearn.datasets.fetch_adhd`. This dataset will be used as input for subsequent image processing examples. The output shows the dataset being found or downloaded and extracted. ```Python from nilearn.datasets import fetch_adhd dataset = fetch_adhd(n_subjects=2) ``` -------------------------------- ### Install Pre-commit Hooks Source: https://nilearn.github.io/stable/index.html/development Command to install the pre-commit hooks into the Git repository, enabling automatic execution of checks on staged files before commit. ```Shell pre-commit install ``` -------------------------------- ### Initialize Matplotlib and Nilearn Utilities Source: https://nilearn.github.io/stable/index.html/_downloads/e683e915e3b5161dd3e972449ba770e8/plot_haxby_stimuli This code snippet imports `check_matplotlib` from `nilearn._utils.helpers` to ensure Matplotlib is correctly configured, and then imports `matplotlib.pyplot` as `plt` for general plotting operations. It's a standard setup for plotting in Nilearn examples. ```python from nilearn._utils.helpers import check_matplotlib check_matplotlib() import matplotlib.pyplot as plt ``` -------------------------------- ### Doc: New Beta-Series Modeling Example Source: https://nilearn.github.io/stable/index.html/changes/whats_new A new example has been added to the documentation, demonstrating how to implement common beta series models for task-based functional connectivity and decoding using nilearn. ```Documentation New example added: Beta-Series Modeling for Task-Based Functional Connectivity and Decoding (plot_beta_series.py) Purpose: Demonstrates implementing common beta series models with nilearn. ``` -------------------------------- ### Initial Python Imports for Haxby Dataset Example Source: https://nilearn.github.io/stable/index.html/auto_examples/02_decoding/plot_haxby_multiclass Standard library and Nilearn specific imports required to begin working with the Haxby dataset example, including numerical operations, data manipulation, dataset loading, and plotting utilities. ```Python import numpy as np import pandas as pd from nilearn import datasets from nilearn.plotting import plot_matrix, show ``` -------------------------------- ### Import necessary libraries and check Matplotlib Source: https://nilearn.github.io/stable/index.html/_downloads/8d8ef406b174b8da8ce1825174a990b4/plot_second_level_design_matrix This snippet imports `check_matplotlib` from `nilearn._utils.helpers` and `matplotlib.pyplot` to ensure Matplotlib is available and ready for plotting. It's a common setup for examples that involve visualization. ```Python from nilearn._utils.helpers import check_matplotlib check_matplotlib() import matplotlib.pyplot as plt ``` -------------------------------- ### Example for Hemisphere-wise Connectivity of Yeo 17 Networks Source: https://nilearn.github.io/stable/index.html/changes/whats_new A new example has been added to demonstrate how to compute hemisphere-wise connectivity for the Yeo 17 networks. This provides a practical guide for analyzing functional connectivity within and between hemispheres using this popular parcellation. ```APIDOC Examples: - New example demonstrating hemisphere-wise connectivity computation for Yeo 17 networks ``` -------------------------------- ### Clone Nilearn Repository Source: https://nilearn.github.io/stable/index.html/development Command to clone your forked Nilearn repository from GitHub to your local machine, initiating the development environment setup. ```Shell git clone git@github.com:/nilearn.git ``` -------------------------------- ### Get Metadata Routing for Object Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.maskers.SurfaceMapsMasker Retrieves the metadata routing configuration for the current object. This method is relevant for understanding how metadata is handled, as described in the scikit-learn User Guide on metadata routing. ```APIDOC get_metadata_routing() Returns: routing: MetadataRequest A MetadataRequest encapsulating routing information. ``` -------------------------------- ### Nilearn Private Function File Structure Example Source: https://nilearn.github.io/stable/index.html/development Illustrates the recommended file and directory structure for the Nilearn project, distinguishing between public API components and private internal modules using leading underscores. ```Text nilearn ├── image.py # part of public API ├── __init__.py ├── maskers # part of public API │ ├── __init__.py │ ├── nifti_masker.py # part of public API │ └── _validation.py # private to the maskers module └── _utils.py # private to the nilearn module ``` -------------------------------- ### Nilearn Dataset Fetcher Contribution Guidelines Source: https://nilearn.github.io/stable/index.html/development Outlines the process and considerations for contributing new dataset fetchers to Nilearn. It highlights the use of helper functions from `nilearn.datasets.utils` and the testing methodology involving network mocking. ```APIDOC Nilearn Dataset Fetcher Contribution: Helper Functions (nilearn.datasets.utils): get_dataset_dir(): Function to find a directory where the dataset is or will be stored according to user configuration. fetch_files(): Function to load files from disk or download them if they are missing. Testing: Fetchers are tested without network access; download functions are mocked. request_mocker (pytest fixture): Used to configure what fake data is returned by mocked download functions. Defined in nilearn.datasets.tests._testing. Information on usage is available in the module's docstrings and the Sender class. ``` -------------------------------- ### Install Nilearn in Editable Development Mode Source: https://nilearn.github.io/stable/index.html/development Command to install the local forked version of Nilearn in editable mode, including development dependencies, allowing code changes to reflect immediately without reinstallation. ```Shell pip install -e '.[dev]' ``` -------------------------------- ### Fetch BIDS Language Localizer Dataset Source: https://nilearn.github.io/stable/index.html/modules/datasets Downloads an example BIDS-formatted dataset for language localization studies. ```APIDOC fetch_bids_langloc_dataset([data_dir, verbose]) Description: Download language localizer example bids dataset. ``` -------------------------------- ### Downloading Nilearn Tutorial Datasets Source: https://nilearn.github.io/stable/index.html/_downloads/0a08d2a6f3fe90c61fff00f683f2fa0a/plot_3d_and_4d_niimg This snippet demonstrates how to download sample neuroimaging datasets using Nilearn's `datasets` module. It shows how to load a sample motor activation image and assigns its file path to a variable. ```Python from nilearn import datasets tmap_filename = datasets.load_sample_motor_activation_image() ``` -------------------------------- ### Example for Recursive Feature Elimination (RFE) Exercise Source: https://nilearn.github.io/stable/index.html/auto_examples/02_decoding/plot_simulated_data This snippet provides a commented-out import statement for `RFE` from `sklearn.feature_selection`, serving as a starting point for an exercise to implement recursive feature elimination with SVM. ```python # from sklearn.feature_selection import RFE ``` -------------------------------- ### nilearn.decomposition.CanICA.get_metadata_routing: Get Metadata Routing Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.decomposition.CanICA Retrieves the metadata routing configuration for the object. This is relevant for understanding how metadata is handled within scikit-learn's routing mechanism, as described in the User Guide. ```APIDOC nilearn.decomposition.CanICA.get_metadata_routing() -> MetadataRequest Returns: routing: A MetadataRequest encapsulating routing information. ``` -------------------------------- ### Setup Python Virtual Environment with venv Source: https://nilearn.github.io/stable/index.html/quickstart This snippet demonstrates how to create and activate a new Python virtual environment using the `venv` module, which is part of the standard library. This isolates project dependencies and prevents conflicts with system-wide packages. ```bash python3 -m venv / source //bin/activate ``` -------------------------------- ### Nilearn Plotting Displays API Reference Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.datasets.fetch_neurovault_ids This section lists classes and functions related to displaying neuroimaging data, including various slicer types for orthogonal, mosaic, and tiled views, and utilities for getting projectors and slicers. ```APIDOC nilearn.plotting.displays.OrthoSlicer nilearn.plotting.displays.MosaicSlicer nilearn.plotting.displays.TiledSlicer nilearn.plotting.displays.XSlicer nilearn.plotting.displays.XZSlicer nilearn.plotting.displays.YXSlicer nilearn.plotting.displays.YZSlicer nilearn.plotting.displays.YSlicer nilearn.plotting.displays.ZSlicer nilearn.plotting.displays.get_projector nilearn.plotting.displays.get_slicer ``` -------------------------------- ### Fix: `pip install nilearn` dependency installation Source: https://nilearn.github.io/stable/index.html/changes/whats_new The `pip install nilearn` command now correctly installs all necessary dependencies, resolving issues where required packages were missing after installation. ```Shell pip install nilearn ``` -------------------------------- ### Save Surface Plot Figure Source: https://nilearn.github.io/stable/index.html/_downloads/75c41fcf0724c3f100a53491002cb9fa/plot_3d_map_to_surface_projection This snippet provides an example of how to save the generated surface plot figure to a file. It notes that saving a static version of a Plotly figure requires the `kaleido` package to be installed, mimicking the saving behavior of a Matplotlib figure. ```python # Save the figure as we would do with a matplotlib figure. # Uncomment the following line to save the previous figure to file # fig.savefig("both_hemisphere.png") ``` -------------------------------- ### Fetch Haxby Dataset Subjects 1 and 2 with nilearn Source: https://nilearn.github.io/stable/index.html/_downloads/6fec7790891f3596540387e9e6ab4153/plot_nilearn_101 Utilizes `nilearn.datasets.fetch_haxby` to download and load the Haxby dataset for specific subjects, preparing data for multi-volume processing. ```python from nilearn import datasets haxby = datasets.fetch_haxby(subjects=[1, 2]) ``` -------------------------------- ### Initialize Decoder for Surface Data Source: https://nilearn.github.io/stable/index.html/_downloads/4bb4f5d3d978c5c5149e5b4d5078d2b9/plot_surface_image_and_maskers Imports the `Decoder` class from `nilearn.decoding`, indicating the start of a section on applying decoding techniques directly to surface data, similar to how it's used for volume images. ```python from nilearn.decoding import Decoder ``` -------------------------------- ### Create basic contrasts from design matrix columns Source: https://nilearn.github.io/stable/index.html/_downloads/af0e1828cbbff81b7ed334306fbfe12c/plot_localizer_surface_analysis This code generates a dictionary of basic contrasts, where each contrast corresponds to a single column in the GLM's design matrix. It iterates through the design matrix columns and assigns the corresponding row from the identity contrast matrix. This provides a starting point for more complex contrast definitions. ```python basic_contrasts = { column: contrast_matrix[i] for i, column in enumerate(design_matrix.columns) } ``` -------------------------------- ### Prepare to Display ROI on Brain Surface (Python) Source: https://nilearn.github.io/stable/index.html/auto_examples/01_plotting/plot_surf_stat_map This code imports necessary plotting functions from `nilearn.plotting` to visualize the selected region of interest (ROI) on the brain surface. It sets the stage for plotting, indicating that the example will focus on displaying and computing results specifically for the left hemisphere. This snippet is a setup for a visualization step. ```Python from nilearn.plotting import plot_surf_roi, show # For this example we will only show # and compute results # on the left hemisphere ``` -------------------------------- ### Plot statistical map on cortical mesh using nilearn.plotting.plot_surf_stat_map with Plotly Source: https://nilearn.github.io/stable/index.html/plotting/index This snippet demonstrates using `nilearn.plotting.plot_surf_stat_map` with the `engine` parameter set to 'plotly' to display a statistical map over a cortical mesh. It requires the `plotly` library to be installed. The example loads a surface mesh and a statistical map, then plots it on the right hemisphere with a background map and colorbar. ```Python from nilearn import plotting, datasets, surface fsaverage = datasets.fetch_surf_fsaverage() motor_images = datasets.fetch_neurovault_motor_task() mesh = surface.load_surf_mesh(fsaverage.pial_right) map = surface.vol_to_surf(motor_images.images[0], mesh) fig = plotting.plot_surf_stat_map(mesh, map, hemi='right', view='lateral', colorbar=True, threshold=1.2, bg_map=fsaverage.sulc_right, engine='plotly') fig.show() ``` -------------------------------- ### Documentation Removal: Plotting connectomes example Source: https://nilearn.github.io/stable/index.html/changes/whats_new The example `examples/03_connectivity/plot_sphere_based_connectome.py` which used the Seitzman atlas has been removed. The atlas data was unsuitable for the method, and the example was redundant. ```APIDOC Removed Example: - examples/03_connectivity/plot_sphere_based_connectome.py Reason: Unsuitable atlas data, redundant example. ``` -------------------------------- ### Downloading tutorial datasets from Internet with Nilearn Source: https://nilearn.github.io/stable/index.html/_downloads/e4487c04e02c0104bf4c972c1ba12985/plot_3d_and_4d_niimg Nilearn provides functions to download public datasets. This snippet demonstrates how to load a sample motor activation image and checks its default download location. ```python from nilearn import datasets tmap_filename = datasets.load_sample_motor_activation_image() ``` -------------------------------- ### Nilearn Interfaces API Reference Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.plotting.displays.PlotlySurfaceFigure API documentation for the `nilearn.interfaces` module, which handles loading components from various data interfaces, including BIDS and fMRIPrep, and interacting with FSL. ```APIDOC nilearn.interfaces: Loading components from interfaces - nilearn.interfaces.bids.get_bids_files - nilearn.interfaces.bids.parse_bids_filename - nilearn.interfaces.bids.save_glm_to_bids - nilearn.interfaces.fmriprep.load_confounds - nilearn.interfaces.fmriprep.load_confounds_strategy - nilearn.interfaces.fsl.get_design_from_fslmat ``` -------------------------------- ### Documentation: Combine GLM examples into `plot_two_runs_model` Source: https://nilearn.github.io/stable/index.html/changes/whats_new The GLM examples `plot_fixed_effect` and `plot_fiac_analysis` have been combined into a single, more comprehensive example named `plot_two_runs_model`. This streamlines the documentation and provides a unified demonstration. ```Documentation GLM Examples: plot_fixed_effect.py (merged) plot_fiac_analysis.py (merged) -> plot_two_runs_model.py (new combined example) ``` -------------------------------- ### Build Nilearn Documentation (No Plots, No Report) Source: https://nilearn.github.io/stable/index.html/development An even quicker command to build Nilearn documentation by skipping plots and report generation. ```bash make html-noplot-noreport ``` -------------------------------- ### Print Dataset Information Source: https://nilearn.github.io/stable/index.html/_downloads/22639334ce8d30070c745bfc1e0d1bc8/plot_second_level_association_test Displays the file path of the first NIfTI contrast image from the loaded Localizer dataset, providing basic information about the data location. ```python print( "First contrast nifti image (3D) is located " f"at: {localizer_dataset.cmaps[0]}" ) ``` -------------------------------- ### Install Nilearn Alpha Release 0.5.0a0 Source: https://nilearn.github.io/stable/index.html/changes/whats_new Command to install a specific alpha release version (0.5.0a0) of the Nilearn library using pip. This version is an unstable pre-release and requires explicit version specification for installation. ```bash pip install nilearn==0.5.0a0 ``` -------------------------------- ### Import Matplotlib and Nilearn Utilities for Plotting Source: https://nilearn.github.io/stable/index.html/_downloads/a2efc9d71ef42cf20866631f0b99c2ae/plot_second_level_design_matrix This snippet imports necessary libraries for the example. It uses `check_matplotlib` from `nilearn._utils.helpers` to ensure Matplotlib is available on the system, and then imports `matplotlib.pyplot` for general plotting functionalities required later in the example. ```python from nilearn._utils.helpers import check_matplotlib check_matplotlib() import matplotlib.pyplot as plt ``` -------------------------------- ### Fetch Language Localizer Demo Dataset Source: https://nilearn.github.io/stable/index.html/modules/datasets Downloads a demonstration dataset for language localizer experiments. ```APIDOC fetch_language_localizer_demo_dataset([...]) Description: Download language localizer demo dataset. ``` -------------------------------- ### Nilearn Interfaces for Loading Components API Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.maskers.NiftiMasker API documentation for interfaces in Nilearn, designed to facilitate loading components from various data formats and tools. This includes utilities for interacting with BIDS datasets and FMRIPREP outputs. ```APIDOC nilearn.interfaces.bids.get_bids_files ``` ```APIDOC nilearn.interfaces.bids.parse_bids_filename ``` ```APIDOC nilearn.interfaces.bids.save_glm_to_bids ``` ```APIDOC nilearn.interfaces.fmriprep.load_confounds ``` ```APIDOC nilearn.interfaces.fmriprep.load_confounds_strategy ``` ```APIDOC nilearn.interfaces.fsl.get_design_from_fslmat ``` -------------------------------- ### Fetch example BIDS dataset using Nilearn Source: https://nilearn.github.io/stable/index.html/_downloads/8e127caad0b44a1f573bdc738726019c/plot_surface_bids_analysis This snippet demonstrates how to download a simplified BIDS dataset for illustrative purposes using `nilearn.datasets.fetch_language_localizer_demo_dataset`. The dataset contains only essential information to run a statistical analysis with Nilearn, including bold.json, events.tsv, preproc.nii, and confounds.tsv files. ```python from nilearn.datasets import fetch_language_localizer_demo_dataset data = fetch_language_localizer_demo_dataset(legacy_output=False) ``` -------------------------------- ### nilearn.interfaces API Reference Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.datasets.fetch_haxby API documentation for loading components from various interfaces in nilearn, including BIDS, fMRIPrep, and FSL related functions. ```APIDOC nilearn.interfaces: - bids: - get_bids_files - parse_bids_filename - save_glm_to_bids - fmriprep: - load_confounds - load_confounds_strategy - fsl: - get_design_from_fslmat ``` -------------------------------- ### Verify Matplotlib Installation Source: https://nilearn.github.io/stable/index.html/auto_examples/07_advanced/plot_localizer_mass_univariate_methods This snippet imports and calls a helper function from Nilearn to check for Matplotlib installation, which is often a dependency for plotting functionalities. ```Python from nilearn._utils.helpers import check_matplotlib check_matplotlib() ``` -------------------------------- ### Build Nilearn Documentation (No Plots) Source: https://nilearn.github.io/stable/index.html/development Command to build Nilearn documentation quickly by skipping the generation of plots, useful for faster local review. ```bash make html-noplot ``` -------------------------------- ### Nilearn Interfaces Module API Reference Source: https://nilearn.github.io/stable/index.html/developers/group_sparse_covariance API documentation for the `nilearn.interfaces` module, which handles loading components from various interfaces, including BIDS and fMRIPrep data. ```APIDOC nilearn.interfaces: Loading components from interfaces - nilearn.interfaces.bids.get_bids_files - nilearn.interfaces.bids.parse_bids_filename - nilearn.interfaces.bids.save_glm_to_bids - nilearn.interfaces.fmriprep.load_confounds - nilearn.interfaces.fmriprep.load_confounds_strategy - nilearn.interfaces.fsl.get_design_from_fslmat ``` -------------------------------- ### Get Estimator Parameters (get_params) Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.decoding.SpaceNetClassifier Get parameters for this estimator. This method returns the parameters for the estimator and its contained subobjects if 'deep' is True. ```APIDOC get_params(deep: bool = True) Parameters: deep: bool, default=True If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns: params: dict Parameter names mapped to their values. ``` -------------------------------- ### Check Installed Nilearn Version (pip) Source: https://nilearn.github.io/stable/index.html/development Command to display information about the installed Nilearn package, including its version, using `pip show`. ```Shell pip show nilearn ``` -------------------------------- ### Build Nilearn Documentation with Sphinx (Windows/No Make) Source: https://nilearn.github.io/stable/index.html/development Alternative command to build the full Nilearn documentation using Sphinx directly, useful for environments without Make installed (e.g., Windows). ```bash python3 -m sphinx -b html -d _build/doctrees . _build/html ``` -------------------------------- ### Nilearn Interfaces Module API Reference Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.decomposition.DictLearning Lists functions for loading components from various interfaces, including BIDS and fMRIPrep, within the `nilearn.interfaces` module. ```APIDOC nilearn.interfaces: nilearn.interfaces.bids: - get_bids_files - parse_bids_filename - save_glm_to_bids nilearn.interfaces.fmriprep: - load_confounds - load_confounds_strategy nilearn.interfaces.fsl: - get_design_from_fslmat ``` -------------------------------- ### Nilearn Interfaces for Data Loading API Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.decoding.DecoderRegressor API documentation for the `nilearn.interfaces` module, which facilitates loading components from various data interfaces, including BIDS, fMRIPrep, and FSL. ```APIDOC nilearn.interfaces.bids.get_bids_files ``` ```APIDOC nilearn.interfaces.bids.parse_bids_filename ``` ```APIDOC nilearn.interfaces.bids.save_glm_to_bids ``` ```APIDOC nilearn.interfaces.fmriprep.load_confounds ``` ```APIDOC nilearn.interfaces.fmriprep.load_confounds_strategy ``` ```APIDOC nilearn.interfaces.fsl.get_design_from_fslmat ``` -------------------------------- ### Maintenance: Connectivity examples dataset update Source: https://nilearn.github.io/stable/index.html/changes/whats_new All connectivity examples have been updated to use the brain development fMRI dataset instead of the ADHD dataset. ```APIDOC Connectivity Examples: Dataset changed from ADHD to brain development fMRI. ``` -------------------------------- ### Example Output: Matplotlib Label Object Source: https://nilearn.github.io/stable/index.html/auto_examples/03_connectivity/plot_seed_to_voxel_correlation An example of the text object returned by Matplotlib's `ylabel` function, indicating the label set for the y-axis. ```Output Text(18.166999999999994, 0.5, 'Normalized signal') ``` -------------------------------- ### Nilearn Interfaces for Loading Components API Reference Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.plotting.plot_event API documentation for Nilearn's interfaces module, facilitating loading components from external formats like BIDS and FSL, and handling fMRIPrep confounds. ```APIDOC nilearn.interfaces: - bids.get_bids_files - bids.parse_bids_filename - bids.save_glm_to_bids - fmriprep.load_confounds - fmriprep.load_confounds_strategy - fsl.get_design_from_fslmat ``` -------------------------------- ### Get parameters for NiftiMasker estimator Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.maskers.NiftiMasker Get parameters for this estimator. If deep is True, will return the parameters for this estimator and contained subobjects that are estimators. ```APIDOC get_params(deep=True) Parameters: deep: bool, default=True If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns: params: dict Parameter names mapped to their values. ``` -------------------------------- ### Compare performance of different image loading functions with asv Source: https://nilearn.github.io/stable/index.html/development Run the 'compare_load' benchmark to evaluate and compare the performance of image loading using 'nilearn.image.load_img' versus 'nibabel.loadsave.load'. ```bash asv run -b compare_load ``` -------------------------------- ### Fetch Language Localizer Demo Dataset (nilearn.datasets) Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.surface.SurfaceImage Fetches a demonstration dataset for language localizer tasks, useful for testing and learning. This function downloads the necessary files and returns a dictionary-like object containing paths to the dataset. ```APIDOC nilearn.datasets.fetch_language_localizer_demo_dataset(data_dir=None, resume=True, verbose=1) data_dir: str, optional Path to the directory where data should be downloaded. If None, it uses nilearn's default data directory. resume: bool, default=True If True, resume downloading if the file already exists. verbose: int, default=1 Verbosity level (0-3). ``` -------------------------------- ### Nilearn Interfaces Module API Reference Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.datasets.select_from_index API documentation for the nilearn.interfaces module, which provides utilities for loading components and interacting with external data formats and tools like BIDS and FSL. ```APIDOC nilearn.interfaces.bids.get_bids_files nilearn.interfaces.bids.parse_bids_filename nilearn.interfaces.bids.save_glm_to_bids nilearn.interfaces.fmriprep.load_confounds nilearn.interfaces.fmriprep.load_confounds_strategy nilearn.interfaces.fsl.get_design_from_fslmat ``` -------------------------------- ### Fetch Example BIDS Dataset with Nilearn Source: https://nilearn.github.io/stable/index.html/auto_examples/07_advanced/plot_surface_bids_analysis This Python snippet demonstrates how to download a simplified BIDS-compliant fMRI dataset using Nilearn's `fetch_language_localizer_demo_dataset` function. The dataset is designed for illustrative purposes, providing necessary files like `bold.json`, `events.tsv`, `preproc.nii`, and `confounds.tsv` for statistical analysis. ```python from nilearn.datasets import fetch_language_localizer_demo_dataset data = fetch_language_localizer_demo_dataset(legacy_output=False) ``` -------------------------------- ### Check Installed Nilearn Version (Python) Source: https://nilearn.github.io/stable/index.html/development Python command to import Nilearn and print its `__version__` attribute, verifying the installed package version programmatically. ```Python python -c "import nilearn; print(nilearn.__version__)" ``` -------------------------------- ### Import nilearn library Source: https://nilearn.github.io/stable/index.html/introduction Demonstrates the basic step of importing the `nilearn` library into a Python environment, which is necessary before using any of its functionalities. ```python import nilearn ``` -------------------------------- ### Custom Averaging Function Example for Nilearn Plotting Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.plotting.plot_surf A Python example of a custom function that can be passed as 'avg_method' to average vertex values for surface plotting in Nilearn. ```Python def custom_function(vertices): return vertices[0] * vertices[1] * vertices[2] ``` -------------------------------- ### Nilearn Example Datasets Source: https://nilearn.github.io/stable/index.html/modules/description/bids_langloc This section lists various neuroimaging datasets available for use with the Nilearn library, often used in examples and tutorials for fMRI and M/EEG analysis. ```APIDOC localizer first level dataset Miyawaki 2008 dataset SPM auditory dataset SPM multimodal dataset NKI enhanced surface dataset Brainomics Localizer MegaTrawls Network Matrices HCP Mixed gambles statistical maps OASIS volume based morphometry maps Neurovault statistical maps ``` -------------------------------- ### API Reference: nilearn.datasets.fetch_localizer_contrasts Source: https://nilearn.github.io/stable/index.html/modules/index API documentation for the `nilearn.datasets.fetch_localizer_contrasts` function within the Nilearn library. ```APIDOC nilearn.datasets.fetch_localizer_contrasts ``` -------------------------------- ### Install Python Tabulate Library Source: https://nilearn.github.io/stable/index.html/auto_examples/04_glm_first_level/plot_bids_features This snippet provides the command to install the `tabulate` Python library using pip. The `tabulate` library is used for pretty-printing tabular data. ```bash pip install tabulate ``` -------------------------------- ### Load Localizer Contrasts with Nilearn Source: https://nilearn.github.io/stable/index.html/_downloads/22639334ce8d30070c745bfc1e0d1bc8/plot_second_level_association_test Loads the Localizer dataset contrasts, specifically for the 'left button press (auditory cue)' task, using `nilearn.datasets.fetch_localizer_contrasts`. It initializes the dataset for a specified number of subjects. ```python from nilearn.datasets import fetch_localizer_contrasts n_samples = 94 localizer_dataset = fetch_localizer_contrasts( ["left button press (auditory cue)"], n_subjects=n_samples, ) ``` -------------------------------- ### Install Tabulate for Markdown Table Export Source: https://nilearn.github.io/stable/index.html/_downloads/8ff74e423338ffab362778cbddf34aa4/plot_bids_features This command installs the `tabulate` Python package, which is necessary for exporting Pandas DataFrames to Markdown format. ```bash pip install tabulate ``` -------------------------------- ### Nilearn Interfaces API Reference Source: https://nilearn.github.io/stable/index.html/auto_examples/02_decoding/index Lists functions for loading components from various interfaces in Nilearn, including BIDS and fMRIPrep related utilities. ```APIDOC nilearn.interfaces: - bids.get_bids_files - bids.parse_bids_filename - bids.save_glm_to_bids - fmriprep.load_confounds - fmriprep.load_confounds_strategy ``` -------------------------------- ### Install Jinja2 for LaTeX Table Export Source: https://nilearn.github.io/stable/index.html/_downloads/8ff74e423338ffab362778cbddf34aa4/plot_bids_features This command installs the `jinja2` Python package, which is required for exporting Pandas DataFrames to LaTeX format. ```bash pip install jinja2 ``` -------------------------------- ### Nilearn Interfaces for Loading Components API Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.image.index_img API documentation for loading components from various interfaces within the nilearn.interfaces module, including BIDS-related functions for file handling and GLM saving, and fmriprep/FSL confound loading utilities. ```APIDOC nilearn.interfaces.bids: - get_bids_files() - parse_bids_filename() - save_glm_to_bids() nilearn.interfaces.fmriprep: - load_confounds() - load_confounds_strategy() nilearn.interfaces.fsl: - get_design_from_fslmat() ``` -------------------------------- ### NiftiSpheresMasker: Generate Report Example Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.maskers.NiftiSpheresMasker Demonstrates how to use the `generate_report` method of `NiftiSpheresMasker` to create a report, specifically showing an example of displaying the first 16 spheres. ```Python masker.generate_report(16) ``` -------------------------------- ### Nilearn Interfaces API Reference Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.image.math_img Lists functions available in the `nilearn.interfaces` module for loading components and interacting with external data formats and tools, including BIDS, fMRIPrep, and FSL. ```Python nilearn.interfaces.bids: get_bids_files() parse_bids_filename() save_glm_to_bids() nilearn.interfaces.fmriprep: load_confounds() load_confounds_strategy() nilearn.interfaces.fsl: get_design_from_fslmat() ``` -------------------------------- ### Nilearn Data Interfaces Module API Reference Source: https://nilearn.github.io/stable/index.html/modules/generated_reports/masker_reports_examples API documentation for the nilearn.interfaces module, focusing on loading components from external interfaces, including BIDS and fMRIPrep datasets. ```APIDOC nilearn.interfaces: bids: get_bids_files() parse_bids_filename() save_glm_to_bids() fmriprep: load_confounds() load_confounds_strategy() ``` -------------------------------- ### Example Output: Matplotlib Label Object (Second Plot) Source: https://nilearn.github.io/stable/index.html/auto_examples/03_connectivity/plot_seed_to_voxel_correlation An example of the text object returned by Matplotlib's `ylabel` function for the second plot, indicating the label set for the y-axis. ```Output Text(18.166999999999994, 0.5, 'Normalized signal') ``` -------------------------------- ### Import Necessary Libraries for Surface Operations Source: https://nilearn.github.io/stable/index.html/_downloads/86209da35571218f88badf29f7fb7dcb/plot_surface_projection_strategies Imports `numpy` for numerical operations, `matplotlib.pyplot` and `matplotlib.tri` for plotting and triangulation, and `nilearn.surface.surface` for surface-related functionalities. ```python import numpy as np from matplotlib import pyplot as plt from matplotlib import tri from nilearn.surface import surface ``` -------------------------------- ### Verify Matplotlib Installation for Nilearn Source: https://nilearn.github.io/stable/index.html/auto_examples/03_connectivity/plot_data_driven_parcellations This snippet ensures that Matplotlib is correctly installed and configured for use with nilearn. It calls `check_matplotlib()` from `nilearn._utils.helpers` to perform this verification, which is a common prerequisite for plotting functionalities within the library. ```python from nilearn._utils.helpers import check_matplotlib check_matplotlib() ``` -------------------------------- ### Fix typographic error in ADHD DMN example documentation Source: https://nilearn.github.io/stable/index.html/changes/whats_new A typographic error on the 'Default Mode Network extraction of ADHD dataset' example page has been corrected, improving documentation clarity. ```Documentation Documentation update for 'Default Mode Network extraction of ADHD dataset' example. ``` -------------------------------- ### Example Changelog Entry in Nilearn latest.rst Source: https://nilearn.github.io/stable/index.html/development This snippet demonstrates a typical entry in the `nilearn/doc/changes/latest.rst` changelog file. It shows how to use a badge, describe the fix, and link to the GitHub pull request and author profile. ```reStructuredText - :bdg-dark:`Code` Fix off-by-one error when setting ticks in :func:`~plotting.plot_surf` (:gh:`3105` by `Dimitri Papadopoulos Orfanos`_). ``` -------------------------------- ### Documentation Update: Decoding examples use Nilearn Decoders Source: https://nilearn.github.io/stable/index.html/changes/whats_new Documentation examples `plot_decoding_tutorial`, `plot_haxby_decoder`, `plot_haxby_different_estimators`, `plot_haxby_full_analysis`, and `plot_oasis_vbm` now utilize `nilearn.decoding.Decoder` and `nilearn.decoding.DecoderRegressor` instead of scikit-learn's SVC and SVR. ```APIDOC Documentation Examples: - plot_decoding_tutorial - plot_haxby_decoder - plot_haxby_different_estimators - plot_haxby_full_analysis - plot_oasis_vbm Updated to use: - nilearn.decoding.Decoder - nilearn.decoding.DecoderRegressor Replaces: sklearn.svm.SVC, sklearn.svm.SVR ``` -------------------------------- ### Ensuring Matplotlib Configuration for Nilearn Examples Source: https://nilearn.github.io/stable/index.html/auto_examples/06_manipulating_images/plot_nifti_labels_simple This snippet includes a utility function call to `check_matplotlib()` from `nilearn._utils.helpers`. This ensures that Matplotlib is correctly configured, which is often a prerequisite for plotting and visualization functions within Nilearn examples. ```python from nilearn._utils.helpers import check_matplotlib check_matplotlib() ``` -------------------------------- ### Nilearn Data Interfaces API Source: https://nilearn.github.io/stable/index.html/auto_examples/06_manipulating_images/plot_roi_extraction Lists functions within the `nilearn.interfaces` module for loading components and interacting with various data formats and tools, including BIDS, fMRIPrep, and FSL. ```APIDOC nilearn.interfaces.bids.get_bids_files nilearn.interfaces.bids.parse_bids_filename nilearn.interfaces.bids.save_glm_to_bids nilearn.interfaces.fmriprep.load_confounds nilearn.interfaces.fmriprep.load_confounds_strategy nilearn.interfaces.fsl.get_design_from_fslmat ``` -------------------------------- ### Prepare Matplotlib for nilearn Examples Source: https://nilearn.github.io/stable/index.html/auto_examples/05_glm_second_level/plot_second_level_design_matrix This snippet ensures that Matplotlib is available and imported, which is a prerequisite for running nilearn examples that involve plotting. It uses a helper function from nilearn to check for Matplotlib's presence. ```Python from nilearn._utils.helpers import check_matplotlib check_matplotlib() import matplotlib.pyplot as plt ``` -------------------------------- ### Create and Activate Python Virtual Environment (venv) Source: https://nilearn.github.io/stable/index.html/development Steps to create and activate a Python virtual environment named 'nilearn' using the `venv` module, isolating project dependencies for a clean development setup. ```Shell python3 -m venv nilearn source nilearn/bin/activate ``` -------------------------------- ### Build Nilearn Documentation (Strict Mode) Source: https://nilearn.github.io/stable/index.html/development Command to build the full Nilearn documentation in strict HTML mode using Make, ensuring all warnings are treated as errors. ```bash make html-strict ``` -------------------------------- ### NiftiMapsMasker.generate_report Usage Examples Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.maskers.NiftiMapsMasker Examples demonstrating how to use the `generate_report` method of `NiftiMapsMasker` to control which maps are displayed in the generated HTML report. It shows how to display all maps, specific maps by index, or a specified number of initial maps. ```python masker.generate_report("all") ``` ```python masker.generate_report([6, 3, 12]) ``` ```python masker.generate_report(16) ``` -------------------------------- ### API Reference for nilearn.datasets.load_sample_motor_activation_image Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.regions.Parcellations Provides an API reference for the `load_sample_motor_activation_image` function within the `nilearn.datasets` module, used for loading sample motor activation images. ```APIDOC nilearn.datasets.load_sample_motor_activation_image ``` -------------------------------- ### Example for copy_header_from Parameter in math_img Source: https://nilearn.github.io/stable/index.html/changes/whats_new An example has been added to illustrate the usage of the new `copy_header_from` parameter in the `math_img` function. This helps users understand how to ensure consistent image headers when performing mathematical operations on images. ```APIDOC nilearn.image.math_img: - New parameter: copy_header_from Examples: - New example demonstrating usage of copy_header_from ``` -------------------------------- ### Print Dataset Information Source: https://nilearn.github.io/stable/index.html/_downloads/2b5d485614d16f2dd7cc6203f2cdb7f9/plot_second_level_association_test Prints the file path of the first contrast NIfTI image (3D) from the loaded Localizer dataset. ```python print( "First contrast nifti image (3D) is located " f"at: {localizer_dataset.cmaps[0]}" ) ``` -------------------------------- ### Example: Create SurfaceImage from Volume Image Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.surface.SurfaceImage This Python example demonstrates how to create a `SurfaceImage` instance from a volumetric image using the `from_volume` class method. It utilizes `load_fsaverage` for a standard brain surface mesh and `load_sample_motor_activation_image` for sample volumetric data. ```python from nilearn.surface import SurfaceImage from nilearn.datasets import load_fsaverage from nilearn.datasets import load_sample_motor_activation_image fsavg = load_fsaverage() vol_img = load_sample_motor_activation_image() img = SurfaceImage.from_volume(fsavg["white_matter"], vol_img) img img = SurfaceImage.from_volume( ``` -------------------------------- ### Example for Decoder Object with Scikit-Learn Pipeline Source: https://nilearn.github.io/stable/index.html/changes/whats_new A new example has been added to provide a clearer understanding of the `Decoder` object by demonstrating its underlying steps through a Scikit-Learn pipeline. This helps users integrate `Decoder` into standard machine learning workflows. ```APIDOC nilearn.decoding.Decoder: - New example demonstrating underlying steps via a Scikit-Learn pipeline ``` -------------------------------- ### API Reference: nilearn.datasets.load_sample_motor_activation_image Source: https://nilearn.github.io/stable/index.html/modules/index API documentation for the `nilearn.datasets.load_sample_motor_activation_image` function within the Nilearn library. ```APIDOC nilearn.datasets.load_sample_motor_activation_image ``` -------------------------------- ### Nilearn Interfaces for Loading Components API Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.plotting.plot_surf API documentation for the `nilearn.interfaces` module, which facilitates loading components and interacting with external data formats and tools like BIDS and FSL. ```APIDOC Module: nilearn.interfaces Sub-modules and Functions: - bids.get_bids_files() - bids.parse_bids_filename() - bids.save_glm_to_bids() - fmriprep.load_confounds() - fmriprep.load_confounds_strategy() - fsl.get_design_from_fslmat() ``` -------------------------------- ### Adapt Plotting Examples for Parametric Modulation Source: https://nilearn.github.io/stable/index.html/changes/whats_new Existing examples for plotting events and design matrices have been adapted to demonstrate the use of parametric modulation. Additionally, the `plot_event` function now supports modulation of events, enhancing its flexibility for visualizing GLM components. ```APIDOC nilearn.plotting.plot_event: - Now supports modulation of events Examples: - Adapted examples for plotting events and design matrices to include parametric modulation ``` -------------------------------- ### Fix ImportError for nose without Matplotlib Source: https://nilearn.github.io/stable/index.html/changes/whats_new Nilearn no longer raises an `ImportError` related to `nose` when Matplotlib is not installed. This resolves an unnecessary dependency check, allowing Nilearn to be imported without Matplotlib if `nose` is also not present, improving installation flexibility. ```Python # Fix: ImportError for nose when Matplotlib is not installed is resolved. ``` -------------------------------- ### Nilearn Datasets: Fetch Brain Development fMRI Data Source: https://nilearn.github.io/stable/index.html/changes/whats_new The new `nilearn.datasets.fetch_development_fmri` function allows downloading movie-watching fMRI data from children and adults. This light-weight dataset is designed for teaching and examples, and it is now used in connectivity examples instead of the ADHD dataset. ```APIDOC nilearn.datasets.fetch_development_fmri(*args, **kwargs) ``` -------------------------------- ### Nilearn Interfaces API Reference Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.plotting.displays.ZProjector API documentation for loading components from various interfaces in Nilearn, including BIDS, fMRIPrep, and FSL. ```APIDOC nilearn.interfaces.bids.get_bids_files ``` ```APIDOC nilearn.interfaces.bids.parse_bids_filename ``` ```APIDOC nilearn.interfaces.bids.save_glm_to_bids ``` ```APIDOC nilearn.interfaces.fmriprep.load_confounds ``` ```APIDOC nilearn.interfaces.fmriprep.load_confounds_strategy ``` ```APIDOC nilearn.interfaces.fsl.get_design_from_fslmat ``` -------------------------------- ### Nilearn Interfaces API Reference Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.datasets.fetch_localizer_calculation_task API documentation for the `nilearn.interfaces` module, which facilitates loading components and interacting with external data formats and tools like BIDS, fMRIPrep, and FSL. ```APIDOC nilearn.interfaces.bids.get_bids_files ``` ```APIDOC nilearn.interfaces.bids.parse_bids_filename ``` ```APIDOC nilearn.interfaces.bids.save_glm_to_bids ``` ```APIDOC nilearn.interfaces.fmriprep.load_confounds ``` ```APIDOC nilearn.interfaces.fmriprep.load_confounds_strategy ``` ```APIDOC nilearn.interfaces.fsl.get_design_from_fslmat ``` -------------------------------- ### Maintenance: Adopt Tox for development and update plotting dependencies Source: https://nilearn.github.io/stable/index.html/changes/whats_new Nilearn's development and testing environments now utilize Tox for improved management and consistency. Additionally, all plotting Python dependencies, including Matplotlib and Plotly, are now automatically installed when using `pip install nilearn[plotting]`. ```Shell Development Environment: - Switched to Tox for environment management. Dependencies: - `pip install nilearn[plotting]` now installs matplotlib AND plotly. ``` -------------------------------- ### Nilearn Interfaces API Reference Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.decoding.FREMRegressor API documentation for loading components from various external interfaces in Nilearn. This includes utilities for interacting with BIDS datasets (getting files, parsing filenames, saving GLM results), fMRIPrep outputs (loading confounds), and FSL (getting design matrices). ```APIDOC nilearn.interfaces.bids.get_bids_files ``` ```APIDOC nilearn.interfaces.bids.parse_bids_filename ``` ```APIDOC nilearn.interfaces.bids.save_glm_to_bids ``` ```APIDOC nilearn.interfaces.fmriprep.load_confounds ``` ```APIDOC nilearn.interfaces.fmriprep.load_confounds_strategy ``` ```APIDOC nilearn.interfaces.fsl.get_design_from_fslmat ``` -------------------------------- ### Nilearn Interfaces API Reference Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.plotting.view_markers API documentation for Nilearn's interfaces module, which facilitates loading components from external data formats and tools like BIDS and FMRIPREP, and interacting with FSL. ```APIDOC nilearn.interfaces.bids.get_bids_files nilearn.interfaces.bids.parse_bids_filename nilearn.interfaces.bids.save_glm_to_bids nilearn.interfaces.fmriprep.load_confounds nilearn.interfaces.fmriprep.load_confounds_strategy nilearn.interfaces.fsl.get_design_from_fslmat ``` -------------------------------- ### Fetch Language Localizer Demo Dataset (nilearn.datasets) Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.image.iter_img Fetches a demonstration language localizer dataset. This function downloads and caches the dataset for example use. ```APIDOC nilearn.datasets.fetch_language_localizer_demo_dataset() ``` -------------------------------- ### Example: Transform voxel coordinates to MNI brain space Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.image.coord_transform This Python example demonstrates how to use `nilearn.image.coord_transform` to convert a specific voxel coordinate (50, 50, 50) into its corresponding MNI brain space coordinate. It utilizes the affine matrix obtained from a loaded MNI152 template image, showcasing a practical application of the function. ```Python from nilearn import datasets, image niimg = datasets.load_mni152_template() # Find the MNI coordinates of the voxel (50, 50, 50) image.coord_transform(50, 50, 50, niimg.affine) # Expected output: (-48.0, -84.0, -22.0) ``` -------------------------------- ### Nilearn Interfaces Module API Reference Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.glm.first_level.run_glm API documentation for the `nilearn.interfaces` module, which handles loading components from various neuroimaging data interfaces. This includes functions for interacting with BIDS datasets (getting files, parsing filenames, saving GLM results) and fMRIPrep outputs (loading confounds, strategies), as well as FSL integration (getting design from FSLmat). ```APIDOC nilearn.interfaces.bids: get_bids_files() parse_bids_filename() save_glm_to_bids() nilearn.interfaces.fmriprep: load_confounds() load_confounds_strategy() nilearn.interfaces.fsl: get_design_from_fslmat() ``` -------------------------------- ### Nilearn Interfaces Module API Reference Source: https://nilearn.github.io/stable/index.html/modules/generated/nilearn.datasets.fetch_oasis_vbm API documentation for the nilearn.interfaces module, which facilitates loading components from various external interfaces. This includes utilities for interacting with BIDS datasets and FSL design matrices, as well as loading confounds from fMRIPrep outputs. ```APIDOC nilearn.interfaces.bids.get_bids_files nilearn.interfaces.bids.parse_bids_filename nilearn.interfaces.bids.save_glm_to_bids nilearn.interfaces.fmriprep.load_confounds nilearn.interfaces.fmriprep.load_confounds_strategy nilearn.interfaces.fsl.get_design_from_fslmat ``` -------------------------------- ### Git Commit to Trigger Full Documentation Build Source: https://nilearn.github.io/stable/index.html/ci Use this Git commit command to request a full build of the documentation on the CI/CD pipeline. Including `[full doc]` in the commit message ensures all documentation files and examples are rebuilt from scratch, which is useful for comprehensive changes but can take over 90 minutes. ```bash $ git commit -m "[full doc] request full build" ``` -------------------------------- ### Nilearn Interfaces API Reference Source: https://nilearn.github.io/stable/index.html/auto_examples/06_manipulating_images/plot_threshold_image API documentation for functions that provide interfaces to external data formats and tools within nilearn. This includes utilities for interacting with BIDS (Brain Imaging Data Structure) datasets to get files, parse filenames, and save GLM results, as well as functions for loading confounds from fMRIPrep outputs and getting design matrices from FSL. ```APIDOC nilearn.interfaces: bids.get_bids_files() bids.parse_bids_filename() bids.save_glm_to_bids() fmriprep.load_confounds() fmriprep.load_confounds_strategy() fsl.get_design_from_fslmat() ```