def labelDistanceToPoint(polyData, point, resultArrayName='distance_to_point'):
    assert polyData.GetNumberOfPoints()
    points = vtkNumpy.getNumpyFromVtk(polyData, 'Points')
    points = points - point
    dists = np.sqrt(np.sum(points**2, axis=1))
    polyData = shallowCopy(polyData)
    vtkNumpy.addNumpyToVtk(polyData, dists, resultArrayName)
    return polyData
dataset/ETHPy150Open RobotLocomotion/director/src/python/director/segmentation.py/labelDistanceToPoint/original