<div dir="ltr"><div><div><div><div><div><div>Hello,<br><br></div>A am trying to read several nifti files into R as follows.<br><br></div>for(i in 1:n){<br></div>     im=ReadImage(image.nii.gz)<br></div>     imArray=as.array(im)<br></div>     #compare image with other images, and add the similar part to an array<br>}<br><br></div>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.<br><br>Thanks<br>Ryan<br><div><br><br>     <br><br><div><div><div><br><div><br></div></div></div></div></div></div>