def read_epi_params(item_basename):
    """Read all the necessary EPI parameters from text files with the given basename.

    Args:
        basename (str): The basename for all the files we need to read.
            In particular the following files should exist:
                - basename + '.read_out_time.txt' (with the read out time)
                - basename + '.phase_enc_dir.txt' (with the phase encode direction, like AP, PA, LR, RL, SI, IS, ...)

    Returns:
        dict: A dictionary for use in the nipype workflow 'all_peb_pipeline'. It contains the keys:
            - read_out_time (the read out time of the scan)
            - enc_dir (the phase encode direction, converted to nipype standards (x, -x, y, -y, ...))
    """
    with open(item_basename + '.read_out_times.txt', 'r') as f:
        read_out_time = float(f.read())
    with open(item_basename + '.phase_enc_dir.txt', 'r') as f:
        phase_encoding = f.read()
    phase_enc_dirs_translate = {'AP': 'y-', 'PA': 'y', 'LR': 'x-', 'RL':
        'x', 'SD': 'x-', 'DS': 'x', 'SI': 'z-', 'IS': 'z', 'HF': 'z-', 'FH':
        'z'}
    return {'read_out_time': read_out_time, 'enc_dir':
        phase_enc_dirs_translate[phase_encoding]}
