Changing input data of a pipeline has no effect

Hi there!

I have a setup where I use a vtkImageData object with 2 components generated from my own data source. The first of the 2 components is fed into my color transfer function and the second into my opacity function. This works fine.

Now I am trying to change this input data. By changing I mean that I modify modify the vtkImageData object at certain locations but only the first component. The way I set up the color transfer function should allow me to highlight certain areas of the rendered volume by just changing some values in the input data. The problem is that these changes are not shown. The only way how I managed to get it working was to regenerate the image data object from scratch and set the appropriate scalars. The problem is that this something that should happen upon user request and should be fast.

Basically I want to tell the pipeline that I changed the input data (initially set via SetInputData() on my first pipeline element) which should trigger a re-evaluation of the pipeline just like what happens when I set a new vtkImageData object.

Thx for any help!

My workaround right now is creating a new vtkImageData object. Memcopying from the old to the new one and modifying the scalars on the new one. Then I set it with SetInputData on the first algorithm of my pipeline. I would like to avoid this memcpy though since it makes my user interaction less responsive.

I assume you tried imageData->Modified() after you’ve made the changes…

Yes, alongside various combinations of Update() and Modified() calls to the filter I set the input data on. The filter is a vtkImageChangeInformation.