Can I update part of Volmue for grinding and Drilling?

I can’t find a way to update part of vtkImageData in the pipeline, I think it would be difficult. It involves update gradients behind the scene. Is that true?
I hope to get some suggestions.
Thank you.

The simplest is to precompute the shape that matches your tool shape (e.g., a sphere) and subtract that image from the rendered image. If you use Python then you can do this quite efficiently using numpy array operations.

You don’t need to worry about recomputing the gradients. The volume raycast mapper computes it automatically. If you use the GPU then gradients are recomputed in real-time during rendering, so there is no extra delay.

Thank your reply lassoan.
You mean I just need to change part of vtkImageData in the pipeline.
If the whole image is large, is it take much time to rebuild the volume?

If you use volume raycasting to display the volume then you don’t need to rebuild anything, just change a small part of the displayed image and re-render it. Numpy indexing makes it very easy to modify a small part of a 3D array with another 3D array. If you have a good desktop computer with a GPU then you can probably do 50-100 updates per second.

I think I can change a small part of the image by carefully using imageData->GetScalarPointer().
Then call modified().
What I worried about is the time to rebuild the whole 3D texture.I think it needs some time.
It would be better if the vtkImageData has a function like SetUpdateRange(), I desire.
It seams that I was over worried about.
Thank you, Andras.