# \[Solved\] Detect which fields/input were not changed

**URL:** https://discourse.vtk.org/t/solved-detect-which-fields-input-were-not-changed/11353
**Category:** Support
**Created:** [May 2, 2023, 8:56am UTC](https://discourse.vtk.org/t/solved-detect-which-fields-input-were-not-changed/11353 "2023-05-02T08:56:30Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![atalon-lip6](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/96bed5/32.png) [@atalon-lip6](https://discourse.vtk.org/u/atalon-lip6)
#### Post date: [May 2, 2023, 8:56am UTC](https://discourse.vtk.org/t/solved-detect-which-fields-input-were-not-changed/11353/1 "2023-05-02T08:56:30Z")

</div>

Hello,

I am using vtk with paraview (but maybe without my question still has some meaning). I have a filter with let’s say a big distance matrix input and a small integer other parameter as a field.  
My case is the following : sometimes I will only modify the small parameter (in a field) and not the distance matrix input. If the small parameter only is modified, I can avoid redoing some heavy computation involving the distance matrix.

But I do not know how, when RequestData is called, to detect which parameters were changed and which were not. I could hash my distance matrix and compare the new hash with the old one (which I would have stored) and detect changes this way.  
But maybe vtk has a native way to give me this piece of information?

Thanks in advance for your help,  
Alexandre

---

<div class="post-metadata">

### Author: ![atalon-lip6](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/96bed5/32.png) [@atalon-lip6](https://discourse.vtk.org/u/atalon-lip6)
#### Post date: [May 2, 2023, 10:06am UTC](https://discourse.vtk.org/t/solved-detect-which-fields-input-were-not-changed/11353/2 "2023-05-02T10:06:08Z")

</div>

Well, actually I got the answer quickly so I share it there.

Suppose I have a field parameter named toto, then when its value is _actually_ changed and then the “apply” button is clicked (in paraview), the function SetToto is called.  
So I can modify some boolean variable telling whether or not I should recompute everything there. And then RequestData will be called later and will take that into account.  
Another precision: one should called the “Modified()” function inside the SetToto function (if not, RequestData will not be called this time).
