RF: standardize exceptions for Py 2 / 3

Using long-hand for getting exception error message to preserve Python
2.5 compatibility; go to Python >= 2.6 standard syntax.
BF+TST: protect against odd precision changes

Windows precisions for longdouble can change at runtime; protect tests against
this.
BF: remove use of assert_allclose for old numpy

assert_allclose arrived sometime later than numpy 1.3.0; use
assert_(np.allclose ...) instead
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
BF: fix Windows doctest fail for "10L"

Windows apparently generated Long ints from an array shape, and so showing
"(10L,)" instead of (10,); fix by doing comparison instead of testing for
string output
Merge pull request #183 from matthew-brett/py3-standard-exceptons

RF: continue py3 update standarizing exceptions

We were using sys.exc_info to work around Python 2.5 / 3 compatibility; use the
new exception syntax, now we depend on Python 2.6
Merge pull request #184 from matthew-brett/win-longdouble-fixes

BF: deal with some oddness in windows longdouble

An old installation of python x, y revealed that it's possible for windows
longdouble to change after initial import; work round this with a small hack.

Stop longdouble high integer precision check if longdouble does not have high integer precision.

Fix a windows doctest failure.
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.