def voxel_to_world_coordinates(voxel_index, bbox, grid_shape):
    """Given a voxel, the bbox that encloses the scene and the shape of the
    grid, it computes the center of the voxel in world coordinates.

    Arguments:
    ----------
    voxel_index: array(shape=(3, ), dtype=int32)
                 The voxel indices in the voxel grid
    bbox: array(shape=(1, 6), dtype=np.float32)
          The min and max of the corners of the bbox that encloses the scene
    grid_shape: array(shape(3,), dtype=int32)
                The dimensions of the voxel grid used to discretize the scene
    """
    # Make sure that we have the appropriate inputs
    assert bbox.shape[0] == 1
    assert bbox.shape[1] == 6
    # Computhe the size of each voxel in the voxel grid in each dimension
    bin_size = (bbox[0, 3:] - bbox[0, :3]) / grid_shape
    # Transform the voxel index to actual size
    t = voxel_index*bin_size
    # Transform it to world coordinates
    t += bbox[0, :3]
    # Shift it to the center of the corresponding voxel
    t += bin_size / 2

    return t