Commit f1a842ea authored by Saad Jbabdi's avatar Saad Jbabdi Committed by Paul McCarthy
Browse files

corrected typos and added 2 exercises

parent 798511ea
......@@ -2,38 +2,39 @@
# `nilearn`
`nilearn` is python package that provides **statistical** and **machine learning** tools for working with neurimaging data.
`nilearn` is a python package that provides **statistical** and **machine learning** tools for working with neuroimaging data.
According to https://nilearn.github.io/:
>
> Nilearn enables approachable and versatile analyses of brain volumes. It provides **statistical** and **machine-learning** tools, with instructive documentation & open community.
>
> It supports general linear model (GLM) based analysis and leverages the scikit-learn Python toolbox for multivariate statistics with applications such as predictive modelling, classification, decoding, or connectivity analysis.
However, `nilearn` also provides a very convenient set of visualisation routines for neuorimaing data. This notebook will focus on these visualisation tools.
However, `nilearn` also provides a very convenient set of visualisation routines for neuroimaging data. This notebook will focus on these visualisation tools.
`nilearn` has very good documentation, and the examples below borrow heavily from the visulisation documentation: https://nilearn.github.io/plotting/index.html
`nilearn` has very good documentation, and the examples below borrow heavily from the visualisation documentation: https://nilearn.github.io/plotting/index.html
## This notebook
1. Plotting an anatomical image
2. Plotting a statistical map
4. 2D maximum intensity projection
5. Surfaces
3. 2D maximum intensity projection
4. Surfaces
Firstly we will import the necessary packages for this notebook:
%% Cell type:code id: tags:
``` python
import os
from nilearn import plotting, datasets, surface
import matplotlib as mpl
import matplotlib.pyplot as plt
%matplotlib inline
# get path to FSL installation for the FSLDIR environment variable
FSLDIR = os.environ['FSLDIR']
## figure styling
......@@ -99,11 +100,11 @@
- `'y'` - coronal
- `'z'` - axial
- `'ortho'` - three cuts are performed in orthogonal directions
- `'tiled'` - three cuts are performed and arranged in a 2x2 grid
In this instance, we five `cut_coords` an scalar integer that indicates the number of slices to show in the axial view.
In this instance, we give `cut_coords` a scalar integer that indicates the number of slices to show in the axial view.
%% Cell type:code id: tags:
``` python
plotting.plot_anat(
......@@ -115,11 +116,11 @@
)
```
%% Cell type:markdown id: tags:
In this example a `display` object is returned by `plot_anat`. We can use this object to update/amend the plot. Here we add an overlay of the *HarvardOxford* atlas that ships with `FSL` to the image.
In the example below, a `display` object is returned by `plot_anat`. We can use this object to update/amend the plot. Here we add an overlay of the *HarvardOxford* atlas that ships with `FSL` to the image.
We also use the `display` object to save the plot as a `*.png` image.
%% Cell type:code id: tags:
......@@ -143,13 +144,31 @@
display.savefig('myplot.png')
```
%% Cell type:markdown id: tags:
>
> **Exercise:**
>
> Create a PNG figure that displays the same **Harvard-Oxford** parcellation, using a different colormap, and axial images in a 3x5 grid.
>
%% Cell type:code id: tags:
``` python
# YOUR CODE HERE
```
%% Cell type:markdown id: tags:
## Plotting a statistical map
The examples in this section demonstrate how to plot an statistical map as an overlay on an anatomical image. Both images must be in the same space.
The examples in this section demonstrate how to plot a statistical map as an overlay on an anatomical image. Both images must be in the same space.
First we will download a motor task statistical map from NeuroVault.
> **Note:** We use a method from [`nilearn`](https://nilearn.github.io/index.html) called [`fetch_neurovault_motor_task`](https://nilearn.github.io/modules/generated/nilearn.datasets.fetch_neurovault_motor_task.html) to download the statistical map.
......@@ -312,6 +331,19 @@
view.open_in_browser() # view interactive plot inline
```
%% Cell type:markdown id: tags:
>
> **Exercise:**
>
> Visualise thee **Harvard-Oxford** atlas on a surface in the weeb Browser
%% Cell type:code id: tags:
``` python
# YOUR CODE HERE
```
%% Cell type:markdown id: tags:
That's all folks....
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment