<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def transform_index_to_physical_point(image, index):
 """ Get spatial point from index of an image. ANTsR function: `antsTransformIndexToPhysicalPoint` Arguments --------- img : ANTsImage image to get values from index : list or tuple or numpy.ndarray location in image Returns ------- tuple Example ------- """

    if not isinstance(image, iio.ANTsImage):
        raise ValueError('image must be ANTsImage type')

    if isinstance(index, np.ndarray):
        index = index.tolist()

    if not isinstance(index, (tuple,list)):
        raise ValueError('index must be tuple or list')

    if len(index) != image.dimension:
        raise ValueError('len(index) != image.dimension')

    index = [i+1 for i in index]
    ndim = image.dimension
    ptype = image.pixeltype
    libfn = utils.get_lib_fn('TransformIndexToPhysicalPoint%s%i' % (utils.short_ptype(ptype), ndim))
    point = libfn(image.pointer, [list(index)])

    return np.array(point[0])