"""
// The in_img voxels to ref_img voxels as recorded in the current affines
current_in2ref = np.dot(ref_img.get_affine(), in_img.get_affine())
if npl.det(current_in2ref) < 0:
raise ValueError("Negative determinant to current affine mapping - bailing out")
return np.dot(npl.inv(ref_zoomer), np.dot(mat, in_zoomer))
After Change
if npl.det(in_img.get_affine())>=0:
inspace = np.dot(inspace, _x_flipper(in_hdr.get_data_shape()[0]))
if npl.det(ref_img.get_affine())>=0:
refspace = np.dot(refspace, _x_flipper(ref_hdr.get_data_shape()[0]))
// Return voxel to voxel mapping
return np.dot(npl.inv(refspace), np.dot(mat, inspace))