Memory allocation problems [message #58077] |
Wed, 16 January 2008 06:46 |
Anne[1]
Messages: 8 Registered: February 2006
|
Junior Member |
|
|
Hi,
I'm trying to create a pyramid of smaller images from a very large
initial image and have run into a strange memory allocation problem.
My assumption is that I'm messing up somehow but I can't see where.
My initial image, im, is a [3,9000,8000] array and I'm trying to
assign a subset of the image to an [8192,8192] array (powers of 2 are
necessary for my application)
The bit of code that's causing me trouble is
>> tileIm=bytarr(3,tile*scale,tile*scale) (scale=16 so tileim is [3,8192,8192])
>> imsize = size(im)
>> ydim = imSize[3] - low_y
>> tileIm[*,*,0:ydim-1] = im[0:2,low_x:high_x,low_y:imSize[3]-1]
(low_x = 0, high_x = 819, 1ow_y = 0, high_y = 8191 for this particular
iteration)
This gives me the message
% Unable to allocate memory: to make array.
But I do have memory available on my system (2Gb in total available)
I can allocate the segment to a new variable, ie
>> test = im[0:2,low_x:high_x,low_y:imSize[3]-1]
but surely that requires even more memory?
If I then try
IDL> tileIm[*,*,0:ydim-1] = test
% Unable to allocate memory: to make array.
I can't use temporary as I need the original image im for subsequent
iterations
What am I doing wrong. Is there a work around?
Thanks for any replies,
Anne
Imaging Research
Sunnybrook HSC, Toronto
|
|
|