import struct


def _read_fid(dcm):
    """Read a fid from a PyDicom wrapper.

    This converts the data in (0x7fe1, 0x1010) from a series of
    little endian 4 byte real-imaginary pairs to a list of complex values.

    Args:
        dcm (:obj:`SiemensWrapper`): a Siemens SVS DICOM object

    Returns:
        fid (obj): the complex-valued fid
    """
    TAG = (0x7fe1, 0x1010)

    packed = dcm.get(TAG).value
    data = struct.unpack("<%df" % (len(packed) / 4), packed)
    cmplx = [data[i]+data[i+1]*1j for i in range(0, len(data), 2)]

    return(cmplx)