pyvista / pyvista-support

[moved] Please head over to the Discussions tab of the PyVista repository
https://github.com/pyvista/pyvista/discussions
60 stars 4 forks source link

Visualize the difference between two mesh points #373

Open isurusuranga opened 3 years ago

isurusuranga commented 3 years ago

Description

I have two volumetric liver meshes in .vtk format (i.e. ground-truth and predicted versions) and now I want to plot the error i.e., for example, the difference between the ground-truth and the predicted liver meshes on the predicted mesh / mesh coordinates with a different colour to visualize how much deviation that each point has ? Is it possible in PyVista? If so can you elaborate with an example please ? Eg:

mesh_gt = pv.read('./mesh_5_groundtruth.vtk')
mesh_pred = pv.read('./mesh_5_prediction.vtk')

dif = mesh_gt.points - mesh_pred.points

What I need is that to plot this difference on the mesh_pred and visualize it.

I have herewith attached two samples .vtk files for your further reference.

Example Data

sample_meshes.zip

akaszynski commented 3 years ago

This is very similar to #372. I've contacted you via email, but here is part of it repeated here.

it's going to require some advanced code and likely won't just use the base VTK package. You'll need ICP, other registration methods, mesh sampling methods using kd-tree or octrees, etc, to quickly compare the distances between the two meshes.