{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "# MRI analysis in Python using Nipype, Nilearn and more\n", "\n", "### workshop at the Weizmann Institute of Science, October 2021\n", "\n", "`Python` is on its way to become the most used programming language in `neuroscience`. It is easy to understand, can be learned rather quickly and has a very strong and helpful community behind it. There exist many amazing `neuroimaging` software packages, such as `Nipype`, `Nilearn`, `fMRIPrep` and more which facilitate the everyday life of a neuroscientist.\n", "\n", "The goal of this 2-day workshop is to introduce participants to many different `neuroimaging toolboxes`, the Python framework around it and everything you need to know about [Nipype](https://nipype.readthedocs.io/en/latest/) to start creating your own `pipelines` and optimizing your `workflows`.\n", "\n", "
\n", "

General information, overview, setup instructions and content

\n", "All information regarding the workshop, including a general overview, setup instructions, content and access to it can be found on the workshop web page: https://peerherholz.github.io/workshop_weizmann/index.html.\n", "
" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Save the workshop and nipype_tutorial content into your output folder\n", "!cp -R /home/neuro/workshop/* /output/" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "

Save your notes and changes

\n", "Alternatively, if you just want to ensure that you have a backup of each notebook (including your changes, notes and outputs), you can also download each notebook individually by clicking on the menu: File > Download as > Notebook (.ipynb) or HTML (.html).\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Schedule - Day 1 - October 24th, 10 AM - 2 PM IST

\n", "\n", "

Workshop overview

\n", "\n", "- Slides: [Workshop overview](https://docs.google.com/presentation/d/1nC1_u3eywwEMXtNaA__iffXtVYwSAg0j2gIOpyoVFYs/present?usp=sharing)\n", "\n", "\n", "

10-11 Explore MRI data with Nibabel and Nilearn

\n", "\n", "Having direct access to your neuroimaging data can be quite liberating. `Nibabel` and `Nilearn` allow exactly that. With those two neuroimaging packages, you can consider any brain image, a simple 3D/4D matrix of voxel values, which you can transform and move around like you would do with any other toolbox.\n", "\n", "- Notebook 1: [Nibabel](data/image_manipulation_nibabel.ipynb)\n", "- Notebook 2: [Nilearn](data/image_manipulation_nilearn.ipynb)\n", " \n", "

This section involves exercises and individual exploration of notebooks.

\n", "\n", "\n", "

11-11:30 Introduction to Nipype

\n", "\n", "In this short introduction, we will show you what Nipype is and why you should use it. It contains a powerful short example that shows the strength behind Nipype.\n", "\n", "- Slides: [Short introduction to Nipype](https://docs.google.com/presentation/d/1hgXLxHqsQ6h3tj5E7GPtenFdPRI6vu_paJ3XEWfQxrg/present?usp=sharing)\n", "- Notebook: [Nipype Showcase](nipype/notebooks/introduction_showcase.ipynb)\n", "\n", "

11:30-12:30 Exploration of Nipype's building blocks

\n", "\n", "Nipype can be learned very quickly, but it's nonetheless important that you know about some of the main building blocks.\n", "\n", "- Slides: [Interfaces & Workflows](https://docs.google.com/presentation/d/1EJzWtTJ6he5jF-wS4o1xrn86CfNOrLbRBwKexfq_HNI/present?usp=sharing)\n", "- Notebook: [Basic Concepts](nipype/index.ipynb)\n", "\n", "

This section involves exercises and individual exploration of notebooks.

\n", "\n", "

12:30-1:30 Creating a Nipype Pipeline from A-Z

\n", "\n", "- Notebook: [Creating a `Nipype preprocessing pipeline`](nipype/notebooks/handson_preprocessing.ipynb)\n", "- Notebook: [Creating a `Nipype analysis pipeline`](nipype/notebooks/handson_analysis.ipynb)\n", "\n", "

This section involves exercises and individual exploration of notebooks.

\n", "\n", "\n", "

1:30-2 Complex processing pipelines based on Nipype

\n", "\n", "There are many new and innovative `neuroimaging` resources & softwares, such as `BIDS`, `fMRIPrep`, `MRIQC`, `OpenNeuro`, etc. And many of them wouldn't be possible without `Nipype` and the open-source `neuroimaging` community. In this section, we want to introduce you to some toolboxes and software packages that entail complex processing pipelines based on `Nipype`. If you don't already use them yet yourself, you certainly want to be aware about them!\n", "\n", "- Slides: [Complex processing pipelines based on `Nipype`](https://docs.google.com/presentation/d/1yZVl4MFkYY36Ic-1JknMwlhZTygh2Vrjd3KoJu0E_n0/present?usp=sharing)\n", "\n", "

2-... Open ended for questions

" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Schedule - Day 2 - October 31st, 10 AM - 2 PM IST

\n", "\n", "\n", "

10-11 PyBIDS and statistical analysis of fMRI data

\n", "\n", "- Notebook 1: [PyBIDS](advanced/pybids.ipynb)\n", "- Notebook 2: [Statistical analysis of fMRI data](advanced/statistical_analyses_MRI.ipynb)\n", "\n", "

This section involves exercises and individual exploration of notebooks.

\n", "\n", "\n", "

11-12 Functional connectivity

\n", "\n", "In this section we will focus on `resting-state fMRI analysis`, in particular `functional connectivity analysis`. The goal of this section is to show you some capabilities of `Nilearn`.\n", "\n", "- Notebook: [Functional Connectivity with Nilearn](advanced/functional_connectivity.ipynb)\n", "\n", "

This section involves exercises and individual exploration of notebooks.

\n", "\n", "

12-1 Machine learning I

\n", "\n", "Within this section we will explore how some `machine learning approaches` can be applied to `fMRI` data. More precisely, we will have a look at `\"classic\" machine learning` using `Nilearn` and `deep learning` using `Keras`. The aim of this section is to provide you with some insights on how `python` can be use to run these analyses on `neuroimaging` data. \n", "\n", "- Notebook 1: [Preparation](advanced/machine_learning_preparation.ipynb)\n", "- Notebook 2: [Prediction with Nilearn](advanced/machine_learning_nilearn.ipynb)\n", "- Notebook 3: [Deep Learning](advanced/machine_learning_keras.ipynb)\n", "\n", "

1-1:30 Machine learning II

\n", "\n", "Beside applying `machine learning approaches` directly within `neuroimaging` data more and more research also investigates the feasibility of using `neuroimaging` data to `predict` or `discover` certain `non-neuroimaging variables` such as different demographic information, disease & disorder status/progression, etc. . To give you a rough idea of how this can be done, we will go through an example within which we'll try to predict the `age` of participants based on `resting-state fMRI`. \n", "\n", "- Notebook 2: [Predicting age with machine learning with Nilearn](advanced/predicting_age_with_machine_learning.ipynb)\n", "\n", "

This section involves exercises and individual exploration of notebooks.

\n", "\n", "

1:30-2 The python-neuroimaging ecosystem

\n", "\n", "This presentation more or less continues the presentation from the first session but focuses on the versatile set of `python packages` available for `neuroimaging`.\n", "\n", "- Slides: [The python-neuroimaging ecosystem](https://docs.google.com/presentation/d/1fzDsz0pOwsza6MvyuPlTxCrtK81RXKtjVUlMsDdJ6Vg/present?usp=sharing)\n", "\n", "

2-... Open ended for questions

" ] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.8" } }, "nbformat": 4, "nbformat_minor": 2 }