NF: add fileslice module / function with tests

Function to read array of disk and slice the array, maybe while reading,
in order to save memory.
NF: add function for ReST table of value array

Function makes ReST format ascii table of values in a 2D or maybe 3D
array.
NF: add benchmarks for fileslice

Results of::

    nosetests -s --match '(?:^|[\\b_\\.//-])[Bb]ench' nibabel/benchmarks/bench_fileslice.py

on my 1.8 GHz 2GB 2008 2,1 MacBook Air with non-SSD hard drive.

*************************
Bytes slice - raw (ratio)
*************************

+-----------------+--------------+--------------+--------------+--------------+
|                 |   mid int    |    step 1    | half step 1  | step mid int |
+=================+==============+==============+==============+==============+
| axis 0, len 64  | 0.18 (0.99)  | 0.18 (0.99)  | 0.18 (0.99)  | 0.18 (1.00)  |
| axis 1, len 64  | 0.04 (0.21)  | 0.18 (1.00)  | 0.14 (0.76)  | 0.08 (0.42)  |
| axis 2, len 32  | 0.01 (0.04)  | 0.18 (1.00)  | 0.09 (0.49)  | 0.01 (0.08)  |
| axis 3, len 100 | 0.00 (0.01)  | 0.19 (1.02)  | 0.09 (0.51)  | 0.01 (0.03)  |
+-----------------+--------------+--------------+--------------+--------------+
Base time: 0.18

************************
File slice - raw (ratio)
************************

+-----------------+--------------+--------------+--------------+--------------+
|                 |   mid int    |    step 1    | half step 1  | step mid int |
+=================+==============+==============+==============+==============+
| axis 0, len 64  | 0.18 (1.03)  | 0.18 (1.00)  | 0.18 (1.00)  | 0.18 (1.00)  |
| axis 1, len 64  | 0.13 (0.72)  | 0.18 (1.00)  | 0.23 (1.28)  | 0.26 (1.44)  |
| axis 2, len 32  | 0.01 (0.06)  | 0.18 (1.01)  | 0.11 (0.61)  | 0.02 (0.11)  |
| axis 3, len 100 | 0.00 (0.01)  | 0.18 (1.00)  | 0.09 (0.50)  | 0.01 (0.03)  |
+-----------------+--------------+--------------+--------------+--------------+
Base time: 0.18

**********************
gz slice - raw (ratio)
**********************

+-----------------+--------------+--------------+--------------+--------------+
|                 |   mid int    |    step 1    | half step 1  | step mid int |
+=================+==============+==============+==============+==============+
| axis 0, len 64  | 4.27 (1.00)  | 4.20 (0.99)  | 4.21 (0.99)  | 4.21 (0.99)  |
| axis 1, len 64  | 5.11 (1.20)  | 4.20 (0.99)  | 4.67 (1.09)  | 5.22 (1.22)  |
| axis 2, len 32  | 4.95 (1.16)  | 4.21 (0.99)  | 5.25 (1.23)  | 5.20 (1.22)  |
| axis 3, len 100 | 2.63 (0.62)  | 4.40 (1.03)  | 2.32 (0.54)  | 2.70 (0.63)  |
+-----------------+--------------+--------------+--------------+--------------+
Base time: 4.26
ok

----------------------------------------------------------------------
Ran 1 test in 89.870s
NF: add helpers for bytesio round trip of images

To use in tests.
RF: expose dataobj, affine, header image properties

As threatened on the list, expose the image data container directly as
`dataobj`.  Move the code for caching the read data out of the image
proxy objects and into the image classes.

Expose `affine` and `header` properties, add docstrings for `get_affine`
and `get_header` to warn of pending deprecation.
NF: add uncache method to image base class

Tests to follow in image API checks.
TST: add get_data test method for base class

Test dataobj and cache interface for base class and derived types.
RF: add generic image tests to mghformat and minc

Modify TestSpatialImage to accomodate MGH and MINC format.
NF: add API validator metaclass

metaclass to run API checks on multiple object instances.
TST: add image API tests using API validators.
DOC: document the image API

With doctests
Merge pull request #181 from matthew-brett/file-slicing

MRG: implement slicing directly on images on disk

These commits implement a relatively optimized way of getting a slice of an
array that is not lyet loaded into memory, but is still on disk.

The obvious use is to allow slicing of e.g. nifti images that have not yet been
loaded. For example, it is reasonably fast to load one or several volumes
(slicing on the last dimension) using these routines.
BF: work round int casting bug in numpy 1.4.1

Innocently using int(val) on a uint64 type caused a nasty error that I'd
previously caught in a different context in ``as_int()`` above.  Put in
same fix.
BF: byteswap data before checking hash of buffer

Hash depends on endianness of the data in memory; swap to little-endian
before checking hash.
Merge pull request #187 from matthew-brett/img-properties-api

MRG: make data, affine, header properties, test API

Add:

* img.header - prefer to img.get_header()
* img.affine - prefer to img.get_affine()
* img.dataobj - direct access to old img._data

Add tests of image API so that someone implementing a new image type can
test whether they conform to the API.

Use the API tests to check the new properties.
RF: refactor MINC1 tests ready for MINC2
NF: add deprecated.py module with tests

Add helpers for deprecating modules and classes
RF: move minc module to minc1 name and deprecate

Move minc.py to minc1.py and add deprecation shells for old imports.
NF: First pass at MINC2 loading with tests

Add MINC2 loading - very basic, with no save.
Inherit MINC1 tests
Add example file and check loaded parameters against mincstats
DOC: expand docstring for MINC2