Merge pull request #175 from matthew-brett/image-rollaxis-refactor

RF: Image rollaxis refactor

Image rollaxis had a signature confusingly different from np.rollaxis, and made strong assumptions about the matching of input and output.

Refactored axis match detection and then replace rollaxis with 'rollimg' with signature similar to np.rollaxis.
ENH: add ability to name coordmap / sys products

Add keyword arguments to coordmap and coordsys product functions to
allow naming of the product.
RF: rename input coordsys for images to 'voxels'

Was called 'array'.  Well, I guess it's not so different.
DOC+WIP: working out how to load / save nifti

Plan for how we go from nifti conventions to nipy images and back again.
ENH: add principled load / save of nifti features

Try and work out a principled way of dealing with the various features
of nifti that allow us to guess whether we have a time axis, axes other
than time and space, units and so on.
ENH: add warning for unhandled intent codes

We don't handle any nifti intent codes. We could; for example, if the
intent code is 3 ('t test') we'd expect the 4th dimension of the dataset
to be length 1 (not time), and the 5th dimension of the dataset to be 1
or 2 in length, 1 for just the t value, 2 for the t value and the
degrees of freedom for a each voxel.  We could then give the 4th
dimension in our nipy image a label like 't params'.  But maybe that's
for another day, and when we see that these codes are being used.
TEST: extending tests of nifti loading; enforce 3D

Test that the image is at least 3D.  Test setting of toffset, spaces.
TEST: add tests for micron, meter space scaling

Space units implied to be mm, but can be implicitly set to meters or
microns.  Probably won't happen, but warn and scale if it does.
TEST: add tests for loading dim_info from nifti

Nifti can specify phase, frequency and slice axes.
RF: remove unused old nifti_ref tests
BF+TEST: fix bug for no time dimensions < 7

Test was only testing 7 dimensions, which just happened not to expose
the bug.  Expand tests and fix.
TEST: re-enable load / save tests for reordering

Jonathan disabled these tests when the nifti save did not reorder the
data axes according to x, y, z.  It looks like the old code left the
input axes as (x, y, z) in the first 3, but in any order.  The current
code does reorder to (x, y, z) exactly, and I adapted the tests to this.
Also, we now use the nifti ``toffset`` for time offset.
DOC: clean up nifti nipy conversion docstrings

Remove duplicate algorithm description from module docstring, leaving
main description of algorithms in the function docstrings, with some
cleanup.
TEST+RF: refactor and rething axis matching tests

Refactor axis matching tests after thinking about what they should do.

Add tests for too many dimensions.

Add tests for pixdims with added no-time axis.

Clean up docstrings.
BF: simple fixes for change in default axis naming

After nifti to nipy refactor, default input axis 3 is 't' instead of 'l'
BF: residual outputs reversed domain and range

The residual output reversed the coordmap domain and range. Until now
the tests didn't pick this up because we allowed through XYZ output
names that didn't match expected names for NIFTI. The nifti writer does
now check for these, and tranposes the image accordingly. Now the image
is being transposed, the test needs to look for the NIFTI transposed
shape.