Day 3: version control / diagnostics

3 / 6 / 2015

Reading

We are going to start getting used to the git version control system this week.

Git is an essential tool for anyone using code and data, and you will find yourself using this tool all the time, so it is important to invest time learning how to use git.

To use git, it is very important to understand the basic ideas behind it.

So, please read the The git parable – an excellent introduction to the ideas behind git. I’ve added some illustrations from slides from a talk by Johan Herland – I did not add some of the later slides to our local copy of the git parable page, but you may well find them useful for illustrating the last few sections of the git parable.

Day

  • Loading data with nibabel;

  • Four dimensions is space then time;

  • Slicing over arbitrary dimensions (including time);

  • Using boolean arrays for indexing;

  • Python functions;

  • Exercises:

    • standard deviation per volume;
    • making an spm_global function.
  • Python modules and packages;

  • Exercises:

    • make notebook code into self-contained module.
  • Starting with version control;

  • Make new git repository;

  • Add module to git repository;

  • Commit;

Exercises

The usual instructions:

  • cd pna/pna2015
  • git pull
  • cd day3
  • ipython notebook

There is a web page listing of the exercise files at https://github.com/practical-neuroimaging/pna2015/tree/master/day3