Merge pull request #190 from matthew-brett/minc2-support

MRG: first draft of MINC2 support

Very basic support for loading MINC2 images (as basic as support for MINC1).

Refactoring of MINC1 to make this easier.
RF: refactor nifti1 / analyze + tests for nifti2

Put tests into classes and generalize class names and constants ready
for implementing nifti2.
RF: check for overflow in setting hdr dims

The int64 type can overflow when setting large python integers, rather
than silently rolling to negative.
NF: draft nifti2 support

First pass at Nifti2 support.

Need to add algorithm for testing for presence of nifti2 on loading.
Need example data files.  Need to add check for EOL corruption.
TST: add tests for nifti2 EOL signature

Test nifti2 headers for EOL signature, test the tests.
RF: remove Freesurfer hack for shape in Nifti2

Freesurfer hack is for long vectors.  No need for this with Nifti2
because of the int64 dimensions.
RF: allow extension lengths not multiple of 16

The Connectome project is writing files with extension sizes that do not
divide by 16; allow these but warn.  Test that we are doing this.
DOC: add link to CIFTI format doc

Found the doc defining the CIFTI format.
NF: add nifti1 / nifti2 / analyze detection logic

Use early bytes from file to detect whether this file is nifti1, nifti2,
analyze, or neither.
RF: add nifti2 names to top level namespace
RF: use nifti 1 / 2 detection in save / load

Special-case nifti 1 / 2 pair saving.

Extend tests for single <-> pair conversion.

Allow '.hdr' as extension for saving to pair.
NF: add nifti2 example data files

Nifti2 header and image, both made by me, from the current code, because
I couldn't find any freely available examples.
BF: fix small remaining bugs in nifti2 tests

We were using nifti1 module load for nifti2 tests.

Need to specify nifti2 example file for nifti2 tests.
NF: copy extensions between nifti type headers

Nifti extensions are compatible between types; copy references to them
when converting from one nifti image type to another.
NF: add proposed CIFTI intent codes

From:
http://www.nitrc.org/plugins/mwiki/index.php/cifti:ConnectivityMatrixFileFormats
TST: add Nifti2 to image api tests

Test that Nifti2Pair and Nifti2Image conform to image API.