def convertvsm2ANTSwarp(in_file, ped):
    """
        Convert the voxel shift map to ants warp

        Grabbed this from fmriprep
        (https://github.com/poldracklab/fmriprep/blob/master/fmriprep/interfaces/itk.py#L178)
    """
    import nibabel as nb
    import numpy as np
    import os
    from p3.utility import get_basename
    cwd = os.path.dirname(os.path.dirname(os.getcwd()))
    nii = nb.load(in_file)
    phaseEncDim = {'x': 0, 'y': 1, 'z': 2}[ped[0]]
    if len(ped) == 2:
        phaseEncSign = 1.0
    else:
        phaseEncSign = -1.0
    hdr = nii.header.copy()
    hdr.set_data_dtype(np.dtype('<f4'))
    hdr.set_intent('vector', (), '')
    data = nii.get_data()
    aff = np.diag([1.0, 1.0, -1.0])
    if np.linalg.det(aff) < 0 and phaseEncDim != 0:
        aff *= -1.0
    aff = aff.dot(nii.affine[:3, :3])
    data *= phaseEncSign * nii.header.get_zooms()[phaseEncDim]
    zeros = np.zeros_like(data)
    field = [zeros, zeros]
    field.insert(phaseEncDim, data)
    field = np.stack(field, -1)
    field = field[:, :, :, (np.newaxis), :]
    out_file = os.path.join(cwd, '{}_antswarp.nii.gz'.format(get_basename(
        in_file)))
    nb.Nifti1Image(field.astype(np.dtype('<f4')), nii.affine, hdr).to_filename(
        out_file)
    return out_file
