{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "# Python - Neuroimaging Workshop DZNE Magdeburg, September 2019\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 & fmriprep, that facilitate the everyday life of a neuroscientist.\n", "\n", "The goal of this 2-day workshop is to introduce participants to the basics of Python, to give them a short overview about relevant neuroimaging software packages and most of all, to teach them everything they need to know about Nipype. Nipype is an open-source software package, that provides a unified way of interfacing with most of the freely available neuroimaging software packages, such as SPM, FSL, AFNI, FreeSurfer, and ANTs.\n", "\n", "The full content of this course, all notebooks and slides can be found on the github repository [github.com/peerherholz/workshop_magdeburg](https://github.com/peerherholz/workshop_magdeburg).\n", "\n", "### Important 1\n", "If you're running this notebook through a docker container, make sure that you used the `-v` flag to mount a folder on your system inside the container. Like this, you will have access to any output that you create within this container. For more, take a look at the [Docker information](https://github.com/peerherholz/workshop_magdeburg#docker).\n", "\n", "### Important 2\n", "If you used the `-v` flag from above to mount the `output` folder, you can use the following command to save all notebooks (with your changes) and slides in the folder `/output/`. **Just don't forget to run this cell before closing the docker container!**" ] }, { "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/* /output/" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Get the saved notebook from the output folder back into this docker image\n", "!cp -R /output/* /home/neuro/" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 1\n", "\n", "

Python Basics\n", "\n", "\n", "### `09:00-10:00` How to set up your system, using Conda and Docker\n", "\n", "There are many ways to create the right computational environment for your research. But if you want to use the newest technologies you will not get around using Docker or Conda.\n", "\n", " - Slides: [Conda and Docker](slides/day1_01_conda_and_docker.html)\n", "\n", "### `10:00-10:15` Coffee & Tea Break\n", "\n", "\n", "### `10:15-11:00` Introduction to Python and Jupyter Notebooks\n", "\n", "This section is meant as a quick introduction to Jupyter Notebooks and Python. What are they, how do they work and why are they so cool?\n", "\n", "- Slides: [Introduction to Python and Jupyter Notebook](slides/day1_02_python_and_jupyter_notebook.html)\n", "- Notebook 1: [Jupyter Notebook](../nipype_tutorial/notebooks/introduction_jupyter-notebook.ipynb)\n", "- Notebook 2: [All about Python](../nipype_tutorial/notebooks/introduction_python.ipynb)\n", "\n", "\n", "### `11:00-12:00` Crash course in scientific toolboxes\n", "\n", "One advantage of Python is the vast availability of toolboxes. There's a toolbox for almost everything! In this section, we want to introduce you to the main scientific toolboxes that every researcher should know.\n", "\n", "- Slides: [Scientific Toolboxes](slides/day1_03_scientific_toolboxes.html)\n", "- Notebook 1: [Numpy](notebooks/python_numpy.ipynb)\n", "- Notebook 2: [Statistics](notebooks/python_statistics.ipynb)\n", "- Notebook 3: [Visualization](notebooks/python_visualization.ipynb)\n", "- Notebook 4: [Scipy](notebooks/python_scipy.ipynb)\n", "- Notebook 5: [Scikit](notebooks/python_scikit.ipynb)\n", "\n", "### `12:00-13:00` Lunch" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Python & Neuroimaging\n", "\n", "### `13:00-14:00` How to handle your MRI data with Nibabel and Nilearn\n", "\n", "It's liberating to have direct access to your neuroimaging data. `Nibabel` and `Nilearn` allow exactly that. With those two neuroimaging packages, you can consider the brain a simple 3D/4D matrix of datapoints and do with it whatever you want.\n", "\n", "- Slides: [Data Manipulation](slides/day1_04_data_manipulation.html)\n", "- Notebook 1: [Nibabel](notebooks/image_manipulation_nibabel.ipynb)\n", "- Notebook 2: [Nilearn](notebooks/image_manipulation_nilearn.ipynb)\n", "\n", "### `14:00-14:15` Coffee & Tea Break\n", "\n", "### `14:15-17:00` Crash course in neuroimaging software toolboxes & machine learning\n", "\n", "There are many different ways to analyze MRI data and many different software to do so. In this section, we want to show you some neuroimaging toolboxes written in Python that allow you to do things like diffusion imaging (`Dipy`), functional connectivity (`Nilearn`) or machine learning (`Nilearn`/`PyMVPA`). This list is by no means exhaustive and we will speak about much more software tomorrow morning.\n", "\n", "- Notebook 1: [Nistats: Functional MRI in Python](notebooks/nistats.ipynb)\n", "- Notebook 2: [Diffusion Imaging with Dipy](notebooks/diffusion_imaging.ipynb)\n", "- Notebook 3: [Functional Connectivity with Nilearn](notebooks/functional_connectivity.ipynb)\n", "\n", "### `15:45-16:00` Coffee & Tea Break\n", "\n", "\n", "- Notebook 4: [Machine Learning Tutorial](notebooks/machine_learning_tutorial.ipynb)\n", "- Notebook 5: [Machine Learning Preparation](notebooks/machine_learning_preparation.ipynb)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Day 2 (morning) - Machine learning continued and everything about Nipype\n", "\n", "### `09:00-10:30` Machine learning continued\n", "\n", "In the first session of the second day, we'll continue with some more machine learning. To this end, we'll explore a new dataset and its analyses using three different software packages: `nilearn`, `PyMVPA` and `Keras`.\n", "\n", "- Notebook 1: [Prediction with Nilearn & PyMVPA](notebooks/machine_learning_nilearn_and_pymvpa.ipynb)\n", "- Notebook 2: [Convoluted Neural Networks with Keras](notebooks/machine_learning_keras.ipynb)\n", "\n", "### `10:30-10:45` coffee break\n", "\n", "### `10:45-11:00` 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](../nipype_tutorial/notebooks/introduction_nipype.html)\n", " - Notebook: [Nipype Showcase](../nipype_tutorial/notebooks/introduction_showcase.ipynb)\n", "\n", "### `11:00-12:00` Building blocks of Nipype: Interfaces & Workflows\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](slides/day2_01_nipype_basics.html)\n", " - Notebook: [Basic Concepts](../nipype_tutorial/index.ipynb)\n", " \n", "### `12:00-13:00` Lunch" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Day 2 (afternoon) - Nipype Hands-On\n", "\n", "### Use what you've learned!\n", "\n", "The goal of this afternoon is that you get your hands dirty with Nipype. For this purpose, you will work on the Hands-on example from the Nipype Tutorial. It contains a complete task-based fMRI analysis, including pre-processing, 1st-level and 2nd-level analysis.\n", "\n", "The goal of this hands-on is to show you a real case example of a pre-processing and analysis pipeline with Nipype. Don't hesitate to ask us if you have questions. And feel free to create your own pipeline from scratch if you want. We're happy to help you to get things going.\n", "\n", "**Important:** Don't forget to use the `-v` flag to run the docker container. Like this, you will have access to changes in the notebook and possible output that you want to keep.\n", "\n", "### `13:00-14:30` Pre-processing Hands-on\n", "* Notebook under: [nipype_tutorial/notebooks/handson_preprocessing.ipynb](../nipype_tutorial/notebooks/handson_preprocessing.ipynb)\n", "\n", "**Note:** Coffee & Tea break can be taken at any time during this lecture.\n", "\n", "### `14:30-15:30` Analysis Hands-on\n", "* Notebook under: [nipype_tutorial/notebooks/handson_analysis.ipynb](../nipype_tutorial/notebooks/handson_analysis.ipynb)\n", "\n", "**Note:** Coffee & Tea break can be taken at any time during this lecture.\n", "\n", "### `15:30-17:00` New innovations in the field \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. Because if you don't use them yet yourself, it's at least important that you've already heard about them.\n", "\n", " - Slides: [What you need to know!](slides/day2_02_neuroimaging_innovations.html) \n", " \n", " The slides are covering the following software:\n", " - [BIDS](http://bids.neuroimaging.io/)\n", " - [pyBIDS](https://incf.github.io/pybids/)\n", " - [BIDS-Apps](http://bids-apps.neuroimaging.io/)\n", " - [MRIQC](https://mriqc.readthedocs.io/en/latest/)\n", " - [fMRIPrep](http://fmriprep.readthedocs.io/en/latest/)\n", " - [C-PAC](https://fcp-indi.github.io/)\n", " - [Mindboggle](http://mindboggle.info/index.html#)\n", " - [Neurodocker](https://github.com/kaczmarj/neurodocker)\n", " - [OpenNeuro.org](https://openneuro.org/)\n", " - [Neurovault](https://neurovault.org/)\n", " - [Datalad](https://www.datalad.org/)\n", " - [Porcupine](https://timvanmourik.github.io/Porcupine/)\n", " - [Neurostars.org](https://neurostars.org/)" ] } ], "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.6.7" } }, "nbformat": 4, "nbformat_minor": 2 }