[ITK] SimpleITK in R: Best way to read image

Ryan Edward Young Ryan.E.Young at Colorado.EDU
Mon Nov 3 15:43:25 EST 2014


Hello,

A am trying to read several nifti files into R as follows.

for(i in 1:n){
     im=ReadImage(image.nii.gz)
     imArray=as.array(im)
     #compare image with other images, and add the similar part to an array
}

When I do this the memory usage just keeps growing.  It appears that
simpleITK is not doing any garbage collection when I open a new image into
my im variable.  Is there a command to close itk connection to a image or
clear that part of the buffer?  Any advice is appreciated.

Thanks
Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20141103/d6029597/attachment-0001.html>


More information about the Community mailing list