Loading 3D volume performance

@lassoan To test the performance I was provided with .mha files from the developer who’s working on creating the 3d data, but we have the freedom to stream the data directly in memory to vtk and not need to save to disk first.
The images are being created in real-time, so it’s not possible to load all files to memory in advance but both the image creation part and the display part will eventually run in the same application so the images can be kept in CPU memory.

I used vtkOpenGLGPUVolumeRayCastMapper and I plan to use vtkImageData to load the data instead of using vtkMetaImageReader. is this the way to do it? How can I make sure the images are in CPU memory?