Is there a way not to use large contiguous memory?

Is there a way not to use large contiguous memory?

Hi.
I am having a problem with memory fragmentation on 32bit operating system.

https://vtk.org/pipermail/vtkusers/2010-July/061439.html
https://vtk.org/pipermail/vtkusers/2010-July/061438.html

Since I read this post, I found that vtkImageData allocates the entire slice as contiguous memory.

But I’m using the vtkImageImport class, and this also happens with large array allocation.

VTK streaming is slow, and MPR VolumeRendering requires all slice information to be loaded anyway.

However, the content of the above link is very old 10 years ago.

Did you have a solution??

If you use a desktop platform then upgrade your computer to a 64-bit operating system. There are not enough 32-bit desktop systems out there that would justify spending time with optimizing any software for them. I don’t think there are any volumetric image visualization applications that still offer 32-bit releases.

If you use embedded/mobile platform then you might need to downsample your data before you can reliably process/visualize it. Downsampling makes sense also because mobile displays tends to be smaller and computational capabilities are more limited compared to desktop systems, and users of an underpowered mobile system are expected to accept limitations on maximum data size.

2 Likes

Thank you for answer.

I will switch to 64-bit programming.

There is one more question, and I would appreciate it if you can reply.

When re-slicing an image, I’m wondering if VTK does not directly allocate and deallocate memory, and the main program also provides a management method to receive and use the heap memory address that manages memory in the main program.

Thank you.

I have a question about memory. There are three 2D-scene windows rendering image with vtkResliceImageViewer and one 3D-scene window rendering image with vtkImagePlaneWidget MPR in my application. These windows render the same image with updating(slice position changing, window/level color changing). Can I use only one vtkNIFTIImageReader or vtkImageData object, shared with these four windows. Maybe that will save memory? Or other better way?

If this is a homework for a course then probably the best is to figure this out by yourself by studying VTK examples or other applications that implement this feature.

If your goal is not learning but to have a functional medical imaging application, then I would recommend to use an existing medical imaging platform and extend/customize that. 3D Slicer and MITK are both free, open-source, VTK-based medical image visualization platforms that would save you years of development time.

1 Like