Shapeworks Python error

I have tried the run the shapeworks library. Below is the python code.

And the error is achhed below


Please help to debug it.

This error is indicating that the shapeworks executable is not in your $PATH. You may need to add it to your $PATH. Something like this on Windows:

set PATH=%PATH%;C:\Program Files\ShapeWorks\bin

Thank you for your reply. But not give error as


Can you please help to debug the error? I donot know what is going wrong. Sorry for bothering you again.

Can you please let me know why I am getting the error attached below?

non of the array has Nan or zero value. Please help to debug the error.

Is mean_mesh valid? Was it a file loaded from disk?

Yes it is a valid mesh and loaded from the disk.

Can you check that something close to our unit test for the python API works?

def warpMesh():
  reference_mesh = Mesh(os.environ["DATA"] + "/mesh_warp/mesh_warp2.vtk")
  particles = ParticleSystem([os.environ["DATA"] + "/mesh_warp/mesh_warp2.particles"]).ShapeAsPointSet(0)

  warper = MeshWarper()
  warper.generateWarp(reference_mesh, particles)

  # Warp the mesh using the same particles as the reference --> warped mesh should be close to the reference mesh
  warped_mesh = warper.buildMesh(particles)
  dists_and_indexes = warped_mesh.distance(target=reference_mesh, method=Mesh.DistanceMethod.PointToCell)
  distances = np.array(dists_and_indexes[0])

  mean_error = np.mean(distances)
  print("Distances: mean={} max={}".format(mean_error, np.max(distances)))

  return mean_error < 0.3