Introduction to JupyterHub#

Written by Luke Chang & Jeremy Huckins

In this course we will primarily be using python to learn about fMRI data analysis. All of the laboratories can be run on your own individual laptops once you have installed Python (preferably via an anaconda distribution. However, the datasets are large and there can be annoying issues with different versions of packages and installing software across different operating systems. We will also occasionally be using additional software that will be called by Python (e.g., preprocessing). We have a docker container available that will contain all of the software and have created tutorials to download the data. In addition, some of the analyses we will run can be very computationally expensive and may exceed the capabilities of your laptop.

To meet these needs, Dartmouth’s Research Computing has generously provided a dedicated server hosted on Google Cloud Platform that will allow us to store data, access specialized software, and run analyses. This means that everyone should be able to run all of the tutorials on their laptops, tablets, etc by accessing notebooks on the jupyterhub server and will not need to install anything beyond a working browser.

Login#

The main portal to access this resource will be through the Jupyterhub interface. This allows you to remotely login in to the server through your browser at https://jhub.dartmouth.edu using your netid. Note that you need to be either on campus or logged into VPN to access the portal. Please let us know if you are having difficulty logging in.

Once you’ve logged in you should see a screen like this.

The shared folder contains all of the relevant notebooks and data for the course. Files in this folder are read only and cannot be modified by students. You will need to copy the file to a different folder on your server, which will cover below.

Every time you log in, jupyterhub will spin up a new server just for you and will update all of the files. Sometimes if a lot of new files have been added they may not have enough time to copy so you may need to log out and back in to make sure everything syncs correctly to your server.

Server#

Every student will be able to have their own personal server to work on. This server is running on Google cloud computing and should have all of the software you need to run the tutorials. If your server is idle for a short amount of time, it will automatically shut down. There are also a limited amount of resources available (e.g., storage, RAM). Each user has access to a small amount of RAM, keep an eye on how much your jobs are using. The server may crash if it exceeds a certain amount.

Jupyter Notebooks#

Jupyter notebooks are a great way to have your code, comments and results show up inline in a web browser. Work for this class will be done in Jupyter notebooks so you can reference what you have done, see the results and someone else could redo it in the future, similar to a typical lab notebook.

Rather than writing and re-writing an entire program, you can write lines of code and run them one at a time. Then, if you need to make a change, you can go back and make your edit and rerun the program again, all in the same window. In our specific case, we are going to use JupyterHub which lets several people access the same computer and data at the same time through a web browser.

Finally, you can view examples and share your work with the world very easily through nbviewer. One easy trick if you use a cloud storage service like dropbox is to paste a link to the dropbox file in nbviewer. These links will persist as long as the file remains being shared via dropbox.

You will not be able to work directly and modify the notebooks in the shared/PSYC60-21F/notebook folder. These will always be updating as we edit them. Instead, make sure you copy the notebooks you are working on to your own personal folder. These can only be viewed and changed by you and won’t be deleted or updated when your server starts. We also recommend saving a backup of these files on your local computer, just in case anything happens to the cloud storage.

Opening a notebook on the server#

Click on shared -> PSYC60-21F -> notebooks. Click on any notebook you would like to open (e.g., 1_Introduction_to_Programming.ipynb). It should open and you will be to view the notebook read-only, which means you will NOT be able to modify it.

Copying Notebook#

For this course, you will need to create a copy of each notebook to your homework folder and work off of the copy. This will allow you to take risks and change the code as well as ensure that your work won’t be deleted when the notebooks update.

Let’s learn how to duplicate the notebook and move it to the homework folder.

  1. In your home directory, you will need to create a folder called homework. Click on New then Folder.

  2. You will need to rename the folder. Check the box next to the new untitled folder, then click Rename.

Now type the new name of the folder, i.e., homework

  1. Let’s practice copying a notebook to your Homework folder. Navigate to shared -> PSYC60-21F -> notebooks, and open the notebook you would like to copy by clicking on it (e.g., 4_ICA.ipynb. Then click File then Save as... button.

  2. You will need to specify the folder and name to save a copy of the notebook. Since we have already created the homework folder in your root directory of your server, we can now save notebooks to that location by specifying the path and the name of the file homework/4_ICA.

Your duplicated notebook is now in your homework folder. You will need to do this for each new notebook assignment.

Alternative to Jupyterhub#

If you use jupyter notebooks on your own computer then you own computer will be doing the processing. If you put your computer to sleep then processing will stop. It will also likely slow down other programs you are using on your computer. I would recommend installing it on your own computer so you can learn more about how to use it, or if you are interested in tinkering with the software or you happen to have a particularly fast/newer computer. We don’t recommend going this route unless you don’t have reliable access to the internet.

Please contact Professor Chang if you want any assistance doing this.

Installing Jupyter Notebooks on your own computer#

  1. Install python. We recommend using the Acaconda Distribution as it comes with most of the relevant scientific computing packages we will be using. Be sure to download Python 3.

Alternative 1: Install jupyter notebook (it comes with Anaconda)

pip install jupyter

Alternative 2: If you already have python installed:

pip install --upgrade pip
pip install jupyter

Starting Jupter Notebooks on your computer#

Open a terminal, navigate to the directory you want to work from then type jupyter notebook or jupyter lab

Python packages for the course#

All of the packages we will be using for the course are in the requirements.txt file of the github repository.

You can install all of the packages using pip. We will download the file from github and parse it and install each package.

import pandas as pd
import requests

requirements = requests.get('https://raw.githubusercontent.com/ljchang/dartbrains/master/requirements.txt').text
requirements = [x for x in requirements.split('\n')][3:-1]

for r in requirements:
    !pip install {r}
Requirement already satisfied: pandas in /Users/lukechang/anaconda3/lib/python3.7/site-packages (1.1.1)
Requirement already satisfied: pytz>=2017.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from pandas) (2020.1)
Requirement already satisfied: python-dateutil>=2.7.3 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from pandas) (2.8.1)
Requirement already satisfied: numpy>=1.15.4 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from pandas) (1.19.1)
Requirement already satisfied: six>=1.5 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from python-dateutil>=2.7.3->pandas) (1.15.0)
Requirement already satisfied: numpy in /Users/lukechang/anaconda3/lib/python3.7/site-packages (1.19.1)
Requirement already satisfied: scipy in /Users/lukechang/anaconda3/lib/python3.7/site-packages (1.5.2)
Requirement already satisfied: numpy>=1.14.5 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from scipy) (1.19.1)
Requirement already satisfied: matplotlib in /Users/lukechang/anaconda3/lib/python3.7/site-packages (3.3.1)
Requirement already satisfied: python-dateutil>=2.1 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib) (2.8.1)
Requirement already satisfied: numpy>=1.15 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib) (1.19.1)
Requirement already satisfied: cycler>=0.10 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib) (1.2.0)
Requirement already satisfied: certifi>=2020.06.20 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib) (2020.6.20)
Requirement already satisfied: pillow>=6.2.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib) (7.2.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib) (2.4.7)
Requirement already satisfied: six>=1.5 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from python-dateutil>=2.1->matplotlib) (1.15.0)
Requirement already satisfied: seaborn in /Users/lukechang/anaconda3/lib/python3.7/site-packages (0.11.0)
Requirement already satisfied: pandas>=0.23 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from seaborn) (1.1.1)
Requirement already satisfied: matplotlib>=2.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from seaborn) (3.3.1)
Requirement already satisfied: numpy>=1.15 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from seaborn) (1.19.1)
Requirement already satisfied: scipy>=1.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from seaborn) (1.5.2)
Requirement already satisfied: pytz>=2017.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from pandas>=0.23->seaborn) (2020.1)
Requirement already satisfied: python-dateutil>=2.7.3 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from pandas>=0.23->seaborn) (2.8.1)
Requirement already satisfied: kiwisolver>=1.0.1 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib>=2.2->seaborn) (1.2.0)
Requirement already satisfied: pillow>=6.2.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib>=2.2->seaborn) (7.2.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib>=2.2->seaborn) (2.4.7)
Requirement already satisfied: certifi>=2020.06.20 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib>=2.2->seaborn) (2020.6.20)
Requirement already satisfied: cycler>=0.10 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib>=2.2->seaborn) (0.10.0)
Requirement already satisfied: six>=1.5 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from python-dateutil>=2.7.3->pandas>=0.23->seaborn) (1.15.0)
Requirement already satisfied: nibabel in /Users/lukechang/anaconda3/lib/python3.7/site-packages (3.1.1)
Requirement already satisfied: packaging>=14.3 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nibabel) (20.4)
Requirement already satisfied: numpy>=1.13 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nibabel) (1.19.1)
Requirement already satisfied: pyparsing>=2.0.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from packaging>=14.3->nibabel) (2.4.7)
Requirement already satisfied: six in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from packaging>=14.3->nibabel) (1.15.0)
Requirement already satisfied: nilearn in /Users/lukechang/anaconda3/lib/python3.7/site-packages (0.6.2)
Requirement already satisfied: scipy>=0.19 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nilearn) (1.5.2)
Requirement already satisfied: nibabel>=2.0.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nilearn) (3.1.1)
Requirement already satisfied: scikit-learn>=0.19 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nilearn) (0.23.2)
Requirement already satisfied: numpy>=1.11 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nilearn) (1.19.1)
Requirement already satisfied: sklearn in /Users/lukechang/anaconda3/lib/python3.7/site-packages/sklearn-0.0-py3.7.egg (from nilearn) (0.0)
Requirement already satisfied: joblib>=0.11 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nilearn) (0.16.0)
Requirement already satisfied: packaging>=14.3 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nibabel>=2.0.2->nilearn) (20.4)
Requirement already satisfied: threadpoolctl>=2.0.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from scikit-learn>=0.19->nilearn) (2.1.0)
Requirement already satisfied: pyparsing>=2.0.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from packaging>=14.3->nibabel>=2.0.2->nilearn) (2.4.7)
Requirement already satisfied: six in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from packaging>=14.3->nibabel>=2.0.2->nilearn) (1.15.0)
Requirement already satisfied: nltools in /Users/lukechang/anaconda3/lib/python3.7/site-packages/nltools-0.4.2-py3.7.egg (0.4.2)
Requirement already satisfied: nibabel>=3.0.1 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nltools) (3.1.1)
Requirement already satisfied: scikit-learn>=0.21.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nltools) (0.23.2)
Requirement already satisfied: nilearn>=0.6.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nltools) (0.6.2)
Requirement already satisfied: pandas>=0.20 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nltools) (1.1.1)
Requirement already satisfied: numpy>=1.9 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nltools) (1.19.1)
Requirement already satisfied: seaborn>=0.7.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nltools) (0.11.0)
Requirement already satisfied: matplotlib>=2.2.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nltools) (3.3.1)
Requirement already satisfied: scipy in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nltools) (1.5.2)
Requirement already satisfied: six in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nltools) (1.15.0)
Requirement already satisfied: pynv in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nltools) (0.2)
Requirement already satisfied: joblib>=0.15 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nltools) (0.16.0)
Requirement already satisfied: deepdish>=0.3.6 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nltools) (0.3.6)
Requirement already satisfied: packaging>=14.3 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nibabel>=3.0.1->nltools) (20.4)
Requirement already satisfied: threadpoolctl>=2.0.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from scikit-learn>=0.21.0->nltools) (2.1.0)
Requirement already satisfied: sklearn in /Users/lukechang/anaconda3/lib/python3.7/site-packages/sklearn-0.0-py3.7.egg (from nilearn>=0.6.0->nltools) (0.0)
Requirement already satisfied: pytz>=2017.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from pandas>=0.20->nltools) (2020.1)
Requirement already satisfied: python-dateutil>=2.7.3 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from pandas>=0.20->nltools) (2.8.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib>=2.2.0->nltools) (2.4.7)
Requirement already satisfied: certifi>=2020.06.20 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib>=2.2.0->nltools) (2020.6.20)
Requirement already satisfied: kiwisolver>=1.0.1 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib>=2.2.0->nltools) (1.2.0)
Requirement already satisfied: pillow>=6.2.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib>=2.2.0->nltools) (7.2.0)
Requirement already satisfied: cycler>=0.10 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib>=2.2.0->nltools) (0.10.0)
Requirement already satisfied: requests>=2.10.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from pynv->nltools) (2.24.0)
Requirement already satisfied: tables in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from deepdish>=0.3.6->nltools) (3.6.1)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from requests>=2.10.0->pynv->nltools) (1.25.10)
Requirement already satisfied: chardet<4,>=3.0.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from requests>=2.10.0->pynv->nltools) (3.0.4)
Requirement already satisfied: idna<3,>=2.5 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from requests>=2.10.0->pynv->nltools) (2.10)
Requirement already satisfied: numexpr>=2.6.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from tables->deepdish>=0.3.6->nltools) (2.7.1)
Requirement already satisfied: nipype in /Users/lukechang/anaconda3/lib/python3.7/site-packages (1.4.2)
Requirement already satisfied: nibabel>=2.1.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (3.1.1)
Requirement already satisfied: simplejson>=3.8.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (3.17.0)
Requirement already satisfied: click>=6.6.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (7.1.2)
Requirement already satisfied: packaging in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (20.4)
Requirement already satisfied: pydotplus in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (2.0.2)
Requirement already satisfied: filelock>=3.0.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (3.0.12)
Requirement already satisfied: python-dateutil>=2.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (2.8.1)
Requirement already satisfied: pydot>=1.2.3 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (1.4.1)
Requirement already satisfied: scipy>=0.14 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (1.5.2)
Requirement already satisfied: traits!=5.0,>=4.6 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (6.0.0)
Requirement already satisfied: prov>=1.5.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (1.5.3)
Requirement already satisfied: numpy>=1.15.3; python_version >= "3.7" in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (1.19.1)
Requirement already satisfied: neurdflib in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (5.0.1)
Requirement already satisfied: networkx>=1.9 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (2.5)
Requirement already satisfied: etelemetry in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (0.2.0)
Requirement already satisfied: six in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from packaging->nipype) (1.15.0)
Requirement already satisfied: pyparsing>=2.0.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from packaging->nipype) (2.4.7)
Requirement already satisfied: lxml>=3.3.5 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from prov>=1.5.2->nipype) (4.5.2)
Requirement already satisfied: rdflib>=4.2.1 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from prov>=1.5.2->nipype) (4.2.2)
Requirement already satisfied: isodate in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from neurdflib->nipype) (0.6.0)
Requirement already satisfied: decorator>=4.3.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from networkx>=1.9->nipype) (4.4.2)
Requirement already satisfied: ci-info in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from etelemetry->nipype) (0.1.1)
Requirement already satisfied: requests in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from etelemetry->nipype) (2.24.0)
Requirement already satisfied: future in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from ci-info->etelemetry->nipype) (0.18.2)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from requests->etelemetry->nipype) (1.25.10)
Requirement already satisfied: certifi>=2017.4.17 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from requests->etelemetry->nipype) (2020.6.20)
Requirement already satisfied: chardet<4,>=3.0.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from requests->etelemetry->nipype) (3.0.4)
Requirement already satisfied: idna<3,>=2.5 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from requests->etelemetry->nipype) (2.10)
Requirement already satisfied: hypertools in /Users/lukechang/anaconda3/lib/python3.7/site-packages (0.6.2)
Requirement already satisfied: matplotlib>=1.5.1 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from hypertools) (3.3.1)
Requirement already satisfied: requests in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from hypertools) (2.24.0)
Requirement already satisfied: deepdish in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from hypertools) (0.3.6)
Requirement already satisfied: scipy>=1.0.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from hypertools) (1.5.2)
Collecting scikit-learn<0.22,>=0.19.1
  Using cached scikit_learn-0.21.3-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (10.5 MB)
Requirement already satisfied: numpy>=1.10.4 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from hypertools) (1.19.1)
Requirement already satisfied: seaborn>=0.8.1 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from hypertools) (0.11.0)
Requirement already satisfied: six in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from hypertools) (1.15.0)
Requirement already satisfied: future in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from hypertools) (0.18.2)
Requirement already satisfied: pandas>=0.18.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from hypertools) (1.1.1)
Requirement already satisfied: PPCA>=0.0.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from hypertools) (0.0.4)
Requirement already satisfied: pillow>=6.2.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib>=1.5.1->hypertools) (7.2.0)
Requirement already satisfied: cycler>=0.10 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib>=1.5.1->hypertools) (0.10.0)
Requirement already satisfied: python-dateutil>=2.1 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib>=1.5.1->hypertools) (2.8.1)
Requirement already satisfied: kiwisolver>=1.0.1 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib>=1.5.1->hypertools) (1.2.0)
Requirement already satisfied: certifi>=2020.06.20 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib>=1.5.1->hypertools) (2020.6.20)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from matplotlib>=1.5.1->hypertools) (2.4.7)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from requests->hypertools) (1.25.10)
Requirement already satisfied: idna<3,>=2.5 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from requests->hypertools) (2.10)
Requirement already satisfied: chardet<4,>=3.0.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from requests->hypertools) (3.0.4)
Requirement already satisfied: tables in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from deepdish->hypertools) (3.6.1)
Requirement already satisfied: joblib>=0.11 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from scikit-learn<0.22,>=0.19.1->hypertools) (0.16.0)
Requirement already satisfied: pytz>=2017.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from pandas>=0.18.0->hypertools) (2020.1)
Requirement already satisfied: numexpr>=2.6.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from tables->deepdish->hypertools) (2.7.1)
Installing collected packages: scikit-learn
  Attempting uninstall: scikit-learn
    Found existing installation: scikit-learn 0.23.2
    Uninstalling scikit-learn-0.23.2:
      Successfully uninstalled scikit-learn-0.23.2
ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

fmriprep 20.0.5 requires indexed-gzip>=0.8.8, which is not installed.
fmriprep 20.0.5 requires nitime, which is not installed.
Successfully installed scikit-learn-0.21.3
Requirement already satisfied: networkx in /Users/lukechang/anaconda3/lib/python3.7/site-packages (2.5)
Requirement already satisfied: decorator>=4.3.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from networkx) (4.4.2)
Requirement already satisfied: scikit-learn in /Users/lukechang/anaconda3/lib/python3.7/site-packages (0.21.3)
Requirement already satisfied: numpy>=1.11.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from scikit-learn) (1.19.1)
Requirement already satisfied: scipy>=0.17.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from scikit-learn) (1.5.2)
Requirement already satisfied: joblib>=0.11 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from scikit-learn) (0.16.0)
Requirement already satisfied: pynv in /Users/lukechang/anaconda3/lib/python3.7/site-packages (0.2)
Requirement already satisfied: requests>=2.10.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from pynv) (2.24.0)
Requirement already satisfied: chardet<4,>=3.0.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from requests>=2.10.0->pynv) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from requests>=2.10.0->pynv) (2020.6.20)
Requirement already satisfied: idna<3,>=2.5 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from requests>=2.10.0->pynv) (2.10)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from requests>=2.10.0->pynv) (1.25.10)
Requirement already satisfied: nipype in /Users/lukechang/anaconda3/lib/python3.7/site-packages (1.4.2)
Requirement already satisfied: click>=6.6.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (7.1.2)
Requirement already satisfied: pydot>=1.2.3 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (1.4.1)
Requirement already satisfied: traits!=5.0,>=4.6 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (6.0.0)
Requirement already satisfied: networkx>=1.9 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (2.5)
Requirement already satisfied: numpy>=1.15.3; python_version >= "3.7" in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (1.19.1)
Requirement already satisfied: prov>=1.5.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (1.5.3)
Requirement already satisfied: packaging in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (20.4)
Requirement already satisfied: simplejson>=3.8.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (3.17.0)
Requirement already satisfied: etelemetry in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (0.2.0)
Requirement already satisfied: neurdflib in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (5.0.1)
Requirement already satisfied: filelock>=3.0.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (3.0.12)
Requirement already satisfied: scipy>=0.14 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (1.5.2)
Requirement already satisfied: pydotplus in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (2.0.2)
Requirement already satisfied: python-dateutil>=2.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (2.8.1)
Requirement already satisfied: nibabel>=2.1.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nipype) (3.1.1)
Requirement already satisfied: pyparsing>=2.1.4 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from pydot>=1.2.3->nipype) (2.4.7)
Requirement already satisfied: decorator>=4.3.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from networkx>=1.9->nipype) (4.4.2)
Requirement already satisfied: rdflib>=4.2.1 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from prov>=1.5.2->nipype) (4.2.2)
Requirement already satisfied: lxml>=3.3.5 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from prov>=1.5.2->nipype) (4.5.2)
Requirement already satisfied: six>=1.9.0 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from prov>=1.5.2->nipype) (1.15.0)
Requirement already satisfied: requests in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from etelemetry->nipype) (2.24.0)
Requirement already satisfied: ci-info in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from etelemetry->nipype) (0.1.1)
Requirement already satisfied: isodate in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from neurdflib->nipype) (0.6.0)
Requirement already satisfied: certifi>=2017.4.17 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from requests->etelemetry->nipype) (2020.6.20)
Requirement already satisfied: idna<3,>=2.5 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from requests->etelemetry->nipype) (2.10)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from requests->etelemetry->nipype) (1.25.10)
Requirement already satisfied: chardet<4,>=3.0.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from requests->etelemetry->nipype) (3.0.4)
Requirement already satisfied: future in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from ci-info->etelemetry->nipype) (0.18.2)
Requirement already satisfied: pybids in /Users/lukechang/anaconda3/lib/python3.7/site-packages (0.10.2)
Requirement already satisfied: numpy in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from pybids) (1.19.1)
Requirement already satisfied: num2words in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from pybids) (0.5.10)
Requirement already satisfied: patsy in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from pybids) (0.5.1)
Requirement already satisfied: bids-validator in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from pybids) (1.4.4)
Requirement already satisfied: sqlalchemy in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from pybids) (1.3.19)
Requirement already satisfied: scipy in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from pybids) (1.5.2)
Requirement already satisfied: pandas>=0.23 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from pybids) (1.1.1)
Requirement already satisfied: nibabel>=2.1 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from pybids) (3.1.1)
Requirement already satisfied: docopt>=0.6.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from num2words->pybids) (0.6.2)
Requirement already satisfied: six in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from patsy->pybids) (1.15.0)
Requirement already satisfied: python-dateutil>=2.7.3 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from pandas>=0.23->pybids) (2.8.1)
Requirement already satisfied: pytz>=2017.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from pandas>=0.23->pybids) (2020.1)
Requirement already satisfied: packaging>=14.3 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from nibabel>=2.1->pybids) (20.4)
Requirement already satisfied: pyparsing>=2.0.2 in /Users/lukechang/anaconda3/lib/python3.7/site-packages (from packaging>=14.3->nibabel>=2.1->pybids) (2.4.7)

Plotting and Atlases#

For most of our labs we will be using Python to plot our data and results. However, it is often useful to have a more interactive experience. We recommend additionally downloading FSLeyes, which is a standalone image viewer developed by FSL. It can be installed by either downloading directly from the website, or using pip.

pip install fsleyes

If you are using a mac, you will likely also need to add an X11 window system such as xQuartz for the viewer to work properly.

References#

Jupyter Dashboard Walkthrough

Jupyter Notebook Manual

Getting Started With Jupyter Notebook

Markdown Cheatsheet

Convert jupyter notebook to slides