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?
- 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.
- 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?