{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# An introduction to Nilearn\n",
"This notebook is about the amazing [nilearn](https://nilearn.github.io/) Python package for applying statistical learning techniques (from GLMs to multivariate \"decoding\" and connectivity techniques) to neuroimaging data. In addition, it features all kinds of neat functionality like automic fetching of publicly available data, (interactive) visualization of brain images, and easy image operations.\n",
"\n",
"In this tutorial, we'll walk you through the basics of the package's functionality in a step-by-step fashion. Notably, this notebook contains several exercises (which we call \"ToDos\"), which are meant to make this tutorial more interactive! Also, this tutorial is merely an introduction to (parts of) the Nilearn package. We strongly recommend checking out the excellent [user guide](https://nilearn.github.io/user_guide.html) and [example gallery](https://nilearn.github.io/auto_examples/index.html) on the Nilearn website if you want to delve deeper into the package's (more advanced) features.\n",
"\n",
"**Contents**\n",
"1. What is Nilearn?\n",
"2. Data formats\n",
"3. Data visualization\n",
"4. Image manipulation\n",
"5. Region extraction\n",
"6. Connectome/connectivity analyses\n",
"\n",
"**Estimated time needed to complete**: 1-3 hours (depending on your experience with Python)
\n",
"**Credits**: if you end up using `nilearn` in your work, please cite the corresponding [article](https://www.frontiersin.org/articles/10.3389/fninf.2014.00014/full).
"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Let's see whether Nilearn is installed\n",
"try:\n",
" import nilearn\n",
"except ImportError:\n",
" # if not, install it using pip\n",
" !pip install nilearn"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## What is Nilearn?\n",
"Nilearn is one of the packages in the growing [\"nipy\" ecosystem](https://nipy.org/) of Python packages for neuroimaging analysis (see also [MNE](https://mne.tools/stable/index.html), [nistats](https://nistats.github.io/), [nipype](https://nipype.readthedocs.io/en/latest), [nibabel](https://nipy.org/nibabel/), and [dipy](http://dipy.org/)). Specifically, Nilearn provides tools for analysis techniques like functional connectivity, multivariate (machine-learning based) \"decoding\", but also more \"basic\" tools like image manipulation and visualization."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"