Allow NIFTI QFac to be set when only an SFormMatrix is present.

The QFac, if negative, indicates a flip in the orientation of the image.
This flip can be indicated explicitly via pixdim[0] in the header, but
this patch allows it to be indicated implicitly via a negative determinant
in the sform matrix in the header.  To eliminate the flip, the SFormMatrix
is flipped and the slice order is reversed.