MRG: helper routines for reslicing to world space

These are some routines that don't look much, but are the basis for a very
useful feature, which is to be able to reslice an image into a voxel block
aligned to the output (world) axes.  The resliced image is one way of showing
the image in world (output) space, so it is very useful for visualization and
checking affines.
```. For 1D and 2D shapes, trailing degenerate dimensions will be added```