def phdiff2fmap(in_file, delta_te, newpath=None):
    """
    Converts the input phase-difference map into a fieldmap in Hz,
    using the eq. (1) of [Hutton2002]_:

    .. math::

        \\Delta B_0 (\\text{T}^{-1}) = \\frac{\\Delta \\Theta}{2\\pi\\gamma \\Delta\\text{TE}}


    In this case, we do not take into account the gyromagnetic ratio of the
    proton (:math:`\\gamma`), since it will be applied inside TOPUP:

    .. math::

        \\Delta B_0 (\\text{Hz}) = \\frac{\\Delta \\Theta}{2\\pi \\Delta\\text{TE}}

    """
    import math
    import numpy as np
    import nibabel as nb
    from nipype.utils.filemanip import fname_presuffix
    out_file = fname_presuffix(in_file, suffix='_fmap', newpath=newpath)
    image = nb.load(in_file)
    data = image.get_data().astype(np.float32) / (2.0 * math.pi * delta_te)
    nii = nb.Nifti1Image(data, image.affine, image.header)
    nii.set_data_dtype(np.float32)
    nii.to_filename(out_file)
    return out_file
