[Insight-users] ITK image file readers and memory consumption

Olivier Commowick Olivier.Commowick at inria.fr
Wed Sep 4 04:19:50 EDT 2013


Good morning,

I am writing this email to you since I couldn't find the info on the list. Sorry if that topic was already brought up. We have been using ITK for quite a while and start only now to process large volumes of data (eg the diffusion images for the human connectome project). Therefore, we are facing memory consumption problems. 

I have been looking at how images are read and why it seemed to me that twice the size of the image being read was used by the image file reader. As far as I understand, an image is read in two steps :

- first the appropriate imageio reads the data into a buffer (and also header data for image information)
- then the image file reader converts if needed this buffer into a new buffer of the appropriate pixel type that is copied into the output image. If this is not needed the imageio buffer is just copied into the output image.

This means if I understood well that potentially twice or even three times the image (in the case of conversion) is stored in memory. I was wondering if there would be any way to avoid these buffer copies or creations, at least for the case where no conversion is needed.

Thanks in advance for your answer. Best, 

Olivier Commowick







More information about the Insight-users mailing list