@classmethod
def from_file_map(klass, file_map, *, mmap=True, keep_file_open=None):
    """ Class method to create image from mapping in ``file_map``

        .. deprecated:: 2.4.1
            ``keep_file_open='auto'`` is redundant with `False` and has
            been deprecated. It raises an error as of nibabel 3.0.

        Parameters
        ----------
        file_map : dict
            Mapping with (kay, value) pairs of (``file_type``, FileHolder
            instance giving file-likes for each file needed for this image
            type.
        mmap : {True, False, 'c', 'r'}, optional, keyword only
            `mmap` controls the use of numpy memory mapping for reading image
            array data.  If False, do not try numpy ``memmap`` for data array.
            If one of {'c', 'r'}, try numpy memmap with ``mode=mmap``.  A
            `mmap` value of True gives the same behavior as ``mmap='c'``.  If
            image data file cannot be memory-mapped, ignore `mmap` value and
            read array from file.
        keep_file_open : { None, True, False }, optional, keyword only
            `keep_file_open` controls whether a new file handle is created
            every time the image is accessed, or a single file handle is
            created and used for the lifetime of this ``ArrayProxy``. If
            ``True``, a single file handle is created and used. If ``False``,
            a new file handle is created every time the image is accessed.
            If ``file_map`` refers to an open file handle, this setting has no
            effect. The default value (``None``) will result in the value of
            ``nibabel.arrayproxy.KEEP_FILE_OPEN_DEFAULT`` being used.

        Returns
        -------
        img : MGHImage instance
        """
    if mmap not in (True, False, 'c', 'r'):
        raise ValueError("mmap should be one of {True, False, 'c', 'r'}")
    img_fh = file_map['image']
    mghf = img_fh.get_prepare_fileobj('rb')
    header = klass.header_class.from_fileobj(mghf)
    affine = header.get_affine()
    hdr_copy = header.copy()
    data = klass.ImageArrayProxy(img_fh.file_like, hdr_copy, mmap=mmap,
        keep_file_open=keep_file_open)
    img = klass(data, affine, header, file_map=file_map)
    return img
