Git Product home page Git Product logo

sdc-bids-fmri_old's Introduction

This repository is now deprecated, please see:

https://github.com/carpentries-incubator/SDC-BIDS-fMRI

For the most up to date content regarding this course

Scientific Computing Working Group Workshop on performing analysis of neuroimaging data in Python

Binder

Developed by

Getting workshop material for SciNet workshops


If you're using SciNet's Jupyter System

Instructions with pictures

Open up a terminal and enter the following:

  ssh <user>@teach.scinet.utoronto.ca
  module load anaconda3
  source /scinet/course/ss2019/3/6_mripython/setup_workshop
  python -m ipykernel install --user --name mripython_conda

Open a new terminal and enter the following:

  ssh -L 8888:jupyterhub<X>:8000 <user>@teach.scinet.utoronto.ca -N

Where <X> is a number between 1-6.

If nothing happens that's great! Now open up your favourite browser and enter the following in your address bar:

  https://localhost:8888

You're ready to go!


If you're using Binder

Click the following button: Binder

This will open up a jupyter terminal for you. Then just hit:

  • New --> Terminal

This will open up a terminal. Once you're in here type the following:

./setup_workshop

Then leave it running in the background and switch tabs over back to the previous tab (says "Home" on Chrome)




Getting workshop material for CAMH Workshops

Method 1: Downloading directly from the repository

On the GitHub repo (this page), click the green button that says "Clone or download", then click Download ZIP. Once downloaded, extract the ZIP file.

Method 2: Using Git

Using this method requires a (very) useful piece of software called git. The process of installing git depends heavily on whether you're using MacOS, Windows or Linux. Follow the instructions in the link below to set up git on your PC:

Installing Git

Once you've installed git, open up your terminal and do the following:

git clone https://github.com/jerdra/SDC-BIDS-fMRI.git

This will download the repository directly into your current directory.

Setting up Python environment

We use python version 3.6.0, but any newer version should also work (Python 2 versions haven't been tested). There are many methods to setting up a python environment but we'd recommend using some sort of virtual environment as to not break your system python install. Two methods (of many) are listed below:

Method 1: Setting up conda environment (easiest) [Windows, Linux, MacOS]

For easy set-up we recommend Anaconda to manage python packages for scientific computing. Once installed, setting up the python environment can be done quite easily:

Windows
  1. Install Anaconda Python version 3.7
  2. Open Anaconda Navigator
  3. Click on Environments on the left pane
  4. Click Create then type in SDC-BIDS-fMRI
  5. In the SDC-BIDS-fMRI entry click the play button then click Open Terminal
  6. In terminal type:
conda install -y numpy pandas scipy scikit-learn matplotlib jupyter ipykernel nb_conda
conda install -y -c conda-forge awscli
pip install nilearn nibabel
./setup_workshop
  1. Close the terminal, click on the play button again and open Jupyter Notebook
  2. Navigate to SDC-BIDS-fMRI folder you downloaded earlier.
  3. Done!
Linux and MacOS

After installing Anaconda, open terminal and type:

cd SDC-BIDS-fMRI
conda create -p ./sdc_bids_fmri
source activate $(pwd)/sdc_bids_fmri
conda install numpy pandas scipy scikit-learn matplotlib jupyter ipykernel nb_conda
conda install -c conda-forge awscli
pip install nilearn nibabel
./setup_workshop

Method 2: Using pyenv (my favourite) [Linux, MacOS]

An alternative method uses pyenv with pyenv virtualenv. This is a favourite because it seamlessly integrates multiple python versions and environments into your system while maintaining use of pip (instead of conda).

cd SDC-BIDS-fMRI
pyenv virtualenv 3.6.0 sdc_bids_fmri
echo sdc_bids_fmri > .python-version
pip install --requirement requirements.txt
./setup_workshop

Finally open up the jupyter notebook to explore the tutorials:

cd SD-BIDS-fMRI

#Include below line if using anaconda environment
source activate $(pwd)/sdc_bids_fmri

jupyter notebook

Reference

[1] Gorgolewski KJ, Durnez J and Poldrack RA. Preprocessed Consortium for Neuropsychiatric Phenomics dataset [version 2; referees: 2 approved]. F1000Research 2017, 6:1262 (https://doi.org/10.12688/f1000research.11964.2)

sdc-bids-fmri_old's People

Contributors

jerdra avatar josephmje avatar kaitj avatar ostanley avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

sdc-bids-fmri_old's Issues

Ep 01 | Exercise 2

  • discuss properties of numpy arrays
  • play around with different properties on nifti data array

Ep 01 | Visualizing

  • skip matplotlib example and visualize with nibabel instead
  • visualize slice that was pulled from Exercise 3

Ep 02 | Exercise 1

  • convert to 2 step operation
  • switch colours of the mask
  • apply mask to data

Ep 01 | Exercise 3

  • show an example of slicing
  • exercise to pull out a slice along a different dimension

Ep 03

  • migrate to Erin's course
  • will have some semblance of it at the beginning when downloading data
  • create notebook to demonstrate datalad and s3

Ep 01 | Exercise 1

  • discuss properties of dictionaries beforehand
  • show an example of how to access a dictionary key

Ep 04

Currently, this notebook is in slide format. @jerdra can you post a link?

Decide where we want this. Before manipulating images or is its current spot ok?

Ep 01 | Masking

@jerdra not sure what you meant by reshape command here

  • explain benefits of masking (operations on data are only applied within masked area, results in faster performance)

Ep 01 | Affine

  • include better explanation of affine transform
  • explain reference space/world-coordinates/data space

Ep 02 | Resampling

  • add photo example of resampling (can we make or find a gif?)
  • explain what 'normalization' is

Ep 02 | Challenge

  • break down into commented steps that the learners need to fill out
  • remind learners to visualize each step

Ep 07

Better explanation of NiftisLabelMasker is needed!

  • Exercises should be done for confound set-up to reinforce what they've learned previously. Possibly with fill in the blanks?

Exercise

  • This last exercise with computing the outputs should be done as a fill in the blank if possible. With a lot of guidance in filling out the array we're collecting.

Connectivity Measure

  • Explain connectivity matrix!

  • The plotting code is confusing, just use seaborn?

This section needs a bit of work on clarity.

Ep 06

Applying Parcellations

  • Show images of parcellations to guide the motivation of it.

Visualizing ROIs

  • Do fill in the blanks style for the exercise for better guidance.

Ep 05

Pandas concepts to move to intro dataset notebook

  • read_csv
  • head
  • selecting columns
  • creating a new column
  • row indexing

  • Include information about what exactly is a motion confounder and the types of motion confounders.
  • Visualize how time series changes depending on whether you apply a low pass filter, high pass filter, detrending, standardize.
  • Is TR ever explained anywhere?

Setting up Motion Estimates

  • Fix typo "language-python"
  • More explanation about each column being a confounder, and the fact that you have to select which ones to use rather than using all of them.

The Yeo 2011 Schema

  • Dummy TR -- should visualization of selecting a voxel then looking at time series showing intensity drop off.

Setting up Confound Variables for Regression

  • Then make an exercise for selecting the columns that we want to use for confound regression.

Calculating Temporal Derivatives

  • Find a better way to do this. Get a better explanation, instead of temporal derivatives, talk about change in confound value over time.

Dummy TR Drop

  • Make this an exercise instead, how do we pick volumes after the 5th frame?

Applying Confound Regression

  • Skip the second part about using nilearn.signal.clean this is no longer relevant as relevant with newer versions of nibabel.

Exercise Idea?

  • Applying confound regression to a new data image, fill in the blanks style?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.