# Difference of (or selection on) mostly identical grids

**URL:** https://discourse.paraview.org/t/difference-of-or-selection-on-mostly-identical-grids/7062
**Category:** ParaView Support
**Created:** [April 23, 2021, 12:23pm UTC](https://discourse.paraview.org/t/difference-of-or-selection-on-mostly-identical-grids/7062 "2021-04-23T12:23:19Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![sebschub](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sebschub/32/6507_2.png) [@sebschub](https://discourse.paraview.org/u/sebschub)
#### Post date: [April 23, 2021, 12:23pm UTC](https://discourse.paraview.org/t/difference-of-or-selection-on-mostly-identical-grids/7062/1 "2021-04-23T12:23:19Z")

</div>

I want to calculate the difference of the following two data sets (.vtk):

 ![old](https://discourse.paraview.org/uploads/default/original/2X/7/767764aebaea313996ef22438586ec375129b474.jpeg)

 ![new](https://discourse.paraview.org/uploads/default/original/2X/9/92f834cfda7c0ac978383f2d06f797fe30a10206.jpeg)

The grids of the data are mostly identical, just in the centre some structures are different. I would like to see the difference of the cells that are identical positioned, however, I am also fine with somehow removing the centre part and just looking at the rest.

I tried to `Append Datasets` after renaming cell\_scalers in each data set differently. This append step did not combine both data sets, probably because the grids are different.

Another approach was to `Extract Selection` the same area in both data sets but was not able to get this working.

What should I do? I use Paraview 5.9.0 (on openSUSE).  
Thanks a lot!

---

<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: [April 23, 2021, 5:14pm UTC](https://discourse.paraview.org/t/difference-of-or-selection-on-mostly-identical-grids/7062/2 "2021-04-23T17:14:03Z")

</div>

If you are trying to combine the attributes of two datasets whose points or cells don’t match up exactly, you can use the `Resample With Dataset` filter.

---

<div class="post-metadata">

### Author: ![sebschub](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sebschub/32/6507_2.png) [@sebschub](https://discourse.paraview.org/u/sebschub)
#### Post date: [April 28, 2021, 9:04am UTC](https://discourse.paraview.org/t/difference-of-or-selection-on-mostly-identical-grids/7062/3 "2021-04-28T09:04:05Z")

</div>

Thank you, @Kenneth_Moreland. This works in principle. In my case, the problem is that my data is cell data and `Resample With Dataset` generates point data. This implies that the data always changes to a certain extent, even when resampling one data set onto itself. So this resampling might introduce artefacts of the same order of magnitude as the differences I am looking for.  
Thus, it might be better to just remove the part that is different (area in the centre). Still, I fail to remove the very same area in both data sets. It seems `Extract Subset` could be a solution but it is greyed out for my data sets. I would like to either select it with the mouse or define an area with a certain x range and y range.

---

<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: [April 28, 2021, 1:25pm UTC](https://discourse.paraview.org/t/difference-of-or-selection-on-mostly-identical-grids/7062/4 "2021-04-28T13:25:29Z")

</div>

In that case, the following sequence of filters might do what you want.

1. Use the `Cell Centers` filter on the data set where you want to get the cell data. Make sure to turn on the `Vertex Cells` property of the filter. This will create a bunch of point cells located at the center of each of the cells in your input data.
2. Use the `Resample With Dataset` filter as described before, except use the cell centers result instead of the data where you actually want the data.
3. Use the `Point Data to Cell Data` filter on the output of resample with dataset. Normally, this does an averaging of point data to the cell data, but because the data only has one point per cell, it will just do a simple copy.
4. Select both the data set where you want the data to go and the output of point data to cell data and then add the `Append Attributes` filter. This will copy the cell data you generated on those points at the cell centers back to the data structure where you really want it.

---

<div class="post-metadata">

### Author: ![sebschub](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sebschub/32/6507_2.png) [@sebschub](https://discourse.paraview.org/u/sebschub)
#### Post date: [April 30, 2021, 1:52pm UTC](https://discourse.paraview.org/t/difference-of-or-selection-on-mostly-identical-grids/7062/5 "2021-04-30T13:52:04Z")

</div>

Thank you very much, it worked!
