def get_header(img):
    """ Return header from nibabel image

    Parameters
    ----------
    img : ``SpatialImage`` instance
        Instance of nibabel ``SpatialImage`` class

    Returns
    -------
    header : object
        header object from `img`
    """
    try:
        return img.header
    except AttributeError:
        return img.get_header()
