# Visualise the errors as relative to the magnitude of the deformation

**URL:** https://discourse.paraview.org/t/visualise-the-errors-as-relative-to-the-magnitude-of-the-deformation/7436
**Category:** ParaView Support
**Created:** [June 17, 2021, 6:03pm UTC](https://discourse.paraview.org/t/visualise-the-errors-as-relative-to-the-magnitude-of-the-deformation/7436 "2021-06-17T18:03:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![chathu](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/b19c9b/32.png) [@chathu](https://discourse.paraview.org/u/chathu)
#### Post date: [June 17, 2021, 6:03pm UTC](https://discourse.paraview.org/t/visualise-the-errors-as-relative-to-the-magnitude-of-the-deformation/7436/1 "2021-06-17T18:03:38Z")

</div>

I have two volumetric liver meshes in .vtk format (i.e. ground-truth and predicted versions) and I want to visualise the errors as relative to the magnitude of the deformation. eg a percentage error. Is it possible in Paraview ? If so can you elaborate the steps with an example please ?

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

[sample\_data.zip](https://discourse.paraview.org/uploads/short-url/gFs3ZoiEpOVNuVDnUouTGSCt5Us.zip) (80.7 KB)

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [June 17, 2021, 7:17pm UTC](https://discourse.paraview.org/t/visualise-the-errors-as-relative-to-the-magnitude-of-the-deformation/7436/2 "2021-06-17T19:17:57Z")

</div>

It looks like your _ground truth_ and _prediction_ meshes have the same topology. That is, they have the same points and the same cells defined in the same order. That’s good because you can use the `Append Attributes` filter to combine data from the two models.

The first step is to use the `Calculator` filter to convert the point coordinates to a field. Run `Calculator` on the ground truth. Set the `Result Array Name` to something like `ground_truth` and the expression to `coords`. Do the same for the prediction except make the `Result Array Name` something different like `prediction`.

Next, select both `Calculator` filters in the `Pipeline Browser` and add the `Append Attributes` filter. This will create a new mesh with both `ground_truth` and `prediction`.

Finally make a third `Calculator` filter that subtracts the `prediction` and `ground_truth` vectors.

Here is a state file to do this with the data you gave:  
[liver\_deform.pvsm](https://discourse.paraview.org/uploads/short-url/tMvRQolTwqis3XGqgjiLouX1bfW.pvsm) (767.0 KB)
