Dynamic sequence of images using VTK

I’m working on a project where I need to add multiple images to a blank vtkImageData in VTK. However, once the number of images reaches a certain limit, I need to remove the oldest image and shift the remaining images accordingly. I’ve been struggling to find an efficient way to implement this functionality. Can anyone provide guidance on how to achieve this in VTK?

  1. Initially, I used the vtkImageAppend class to sequentially append each image to a single vtkImageData object. However, I encountered two main issues:
  • There is no built-in function in vtkImageAppend to remove the first added images once a certain limit is reached.
  • Additionally, I noticed that simply adding images and adjusting the camera based on the newly added image resulted in significant memory consumption over time.
  1. As an alternative approach, I attempted to add each vtkImageData directly to multiple actors. When the number of images reached a certain threshold, I tried deleting the first loaded images. However, this approach introduced undesired camera positioning, which is not acceptable for my application.
  • How can I efficiently add images to the columns of a vtkImageData object in a continuous manner?
  • What methods or classes in VTK can assist in removing the oldest images from the columns without altering the camera position?
  • Are there any VTK examples or recommended practices for managing a dynamic sequence of images within a vtkImageData object without needing to adjust the camera position?


What have you tried so far? Can you, please, share the code of your current attempt?



Unfortunately i cannot include my code because it is related to my company project. But i have mentioned in my question that i have used vtkimageappend class to append my images and display it in renderwindow. And also i am not looking for developers to write a feature, i just wanted to know does vtk has any other class to achieve my goal. Thanks

For professional support, please contact Kitware: https://www.kitware.eu/get-support/

We use many different methods depending on what input data we have and how we need to visualize. So, it is impossible to answer your question without knowing much more about what you want to achieve.

Do you work with 2D or 3D images?
How do you need to visualize them: volume rendering (raycasting) or just slices?
Do the images overlap in space?
Do you need to show all of them at once, or only one at a time?
What is the typical image size? How often they get updated, for how long?
Do you have enough memory to keep all of them in GPU memory or CPU memory?
Do you need to show them in multiple viewports?