def fit(image, timepoints, model):
    """Fit model to image."""
    shape = image.shape[:-1]
    image = image.reshape(-1, len(timepoints))
    assert len(timepoints) == len(image[0]), len(image[0])
    # self.start_execution()
    pmap = model.fit(timepoints, image)
    # self.end_execution()
    pmap.shape = shape + (pmap.shape[-1],)
    return pmap