Skip to content

Commit

Permalink
Merge pull request #23 from josephmje/gh-pages
Browse files Browse the repository at this point in the history
MISC: File organization and binder updates
  • Loading branch information
josephmje authored May 27, 2021
2 parents bf7cbe2 + 2b46270 commit ec87810
Show file tree
Hide file tree
Showing 15 changed files with 116 additions and 14 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/notebook.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Test notebooks

on:
push
push:
paths: "*.ipynb"

jobs:
build:
test-notebooks:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
strategy:
Expand All @@ -26,28 +27,25 @@ jobs:
uses: actions/cache@v2
id: cache
with:
path: .cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ env.pythonLocation }}-
# Install all requirements to run these tests.
- name: Install requirements
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
pip3 install virtualenv
virtualenv ~/dc_venv
pip install -r requirements.txt
pip install pytest nbval
# Download the necessary data
- name: Download data
run: |
osf -p cmq8a clone ./data
datalad install
# Run the actual tests of all the Python Notebooks.
- name: Test Notebooks
run: |
source ~/dc_venv/bin/activate
pytest --nbval-lax -v code/*/*.ipynb
pytest --nbval-lax -v code/*_solutions.ipynb
4 changes: 3 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
carpentry: "incubator"

# Overall title for pages.
title: "Introduction to MRI Data Analysis"
title: "Introduction to Working with MRI Data in Python"

# Life cycle stage of the lesson
# possible values: "pre-alpha", "alpha", "beta", "stable"
Expand Down Expand Up @@ -70,7 +70,9 @@ collections:

# Manual episode order
episode_order:
- introduction
- anatomy-of-nifti
- data-organization
- open-mri-datasets

# Set the default layout for things in the episodes collection.
Expand Down
11 changes: 11 additions & 0 deletions _episodes/data-organization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: "Data Organization with BIDS"
teaching: 30
exercises: 15
questions:
- ""
objectives:
- ""
keypoints:
- ""
---
47 changes: 47 additions & 0 deletions _episodes/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: "Neuroimaging Fundamentals"
teaching: 20
exercises: 10
questions:
- ""
objectives:
- ""
keypoints:
- ""
---

## Why Python?

- free, open source
- one platform for data pre-processing, visualization and analysis
- reproducible code
- large number of user-developed packages (eg. nibabel, nilearn)
- easy interaction with state-of-the art neuroimaging software (eg. FSL, ANTS)

## Types of MR Scans

![mr-scan-types](../fig/mr_scan_types.png){:class="img-responsive"}

anat

func

dwi

## Neuroimaging File Formats

|Format Name | File Extension | Origin |
|---|---|---|
| Analyze | .img/.hdr | Analyze Software, Mayo Clinic |
| DICOM | none | ACR/NEMA Consortium |
| NIfTI | .nii or .img/.hdr | Neuroimaging Informatics Technology Initiative |
| MINC | .mnc | Montreal Neurological Institute |
| NRRD | .nrrd | |

![dicom-to-nifti](../fig/dicom_to_nifti.png){:class="img-responsive"}

From the MRI scanner, images are initially collected in the DICOM format and can be converted to NIfTI using [dcm2niix](https://github.com/rordenlab/dcm2niix).

## Intro to NIfTI

NIfTI is one of the most ubiquitous file formats for storing neuroimaging data. We'll cover a few details to get started working with them. If you're interested in learning more about NIfTI images, we highly recommend [this blog post about the NIfTI format](http://brainder.org/2012/09/23/the-nifti-file-format/).
11 changes: 11 additions & 0 deletions _episodes/reproducible-workflows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: "Reproducible Workflows"
teaching: 30
exercises: 15
questions:
- ""
objectives:
- ""
keypoints:
- ""
---
1 change: 1 addition & 0 deletions binder/apt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tree
21 changes: 21 additions & 0 deletions binder/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: dataviz_python

channels:
- default
- conda-forge

dependencies:
- python=3.8.*
- pip
- git
- git-annex
- datalad=0.14.4
- matplotlib
- nibabel
- numpy
- pandas
- texinfo

- pip:
- pybids
- datalad-installer
11 changes: 11 additions & 0 deletions binder/postBuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Git set up
git config --global --add user.name "Ford Escort"
git config --global --add user.email [email protected]

# Get data

openneuro_dataset=ds000030

datalad clone "https://github.com/OpenNeuroDatasets/${openneuro_dataset}.git" "data/${openneuro_dataset}/"
datalad get data/${openneuro_dataset}/sub-01/anat/*
datalad get data/${openneuro_dataset}/sub-01/func/sub-01_task-compL1_run-1_bold.*
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permalink: index.html # Is the only page that doesn't follow the pattern /:path
The goal of this lesson is to provide an introduction to the core concepts involved in analyzing magnetic resonance imaging (MRI) data.
It is intended for learners with no prior experience working with MRI data.

The lesson will introduce different types of MRI modalities and how they can be easily organized and shared. This lesson is also a pre-requisite for [Functional MRI Data Analysis][inc-fmri] and [Diffusion MRI Data Analysis][inc-dmri], which go more in-depth into some specific MRI modalities.
The lesson will introduce different types of MRI modalities and how they can be easily organized and shared. This lesson is also a pre-requisite for the [Structural][inc-smri], [Functional][inc-fmri] and [Diffusion][inc-dmri] MRI Data Analysis lessons, which go more in-depth into some specific MRI modalities.

Over the past decade, the neuroimaging field has produced (and continues to produce) incredible amounts of data about the brain. As a result, the scientific community has developed a diverse set of tools to facilitate the access, analysis and visualization of this data. This lesson will start you on a path towards using these tools effectively in your own work.

Expand All @@ -27,5 +27,6 @@ To get started, follow the directions on the [Setup][lesson-setup] page to insta

[swc-python]: https://swcarpentry.github.io/python-novice-inflammation
[swc-shell]: https://swcarpentry.github.io/shell-novice
[inc-smri]: https://carpentries-incubator.github.io/SDC-BIDS-sMRI
[inc-fmri]: https://carpentries-incubator.github.io/SDC-BIDS-fMRI
[inc-dmri]: https://carpentries-incubator.github.io/SDC-BIDS-dMRI
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
awscli
datalad
matplotlib
nibabel
numpy
pandas
pybids
pybids

0 comments on commit ec87810

Please sign in to comment.