comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Memory allocation problems
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Memory allocation problems [message #58077] Wed, 16 January 2008 06:46
Anne[1] is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: plot tangentail vector
Next Topic: Re: Memory allocation problems

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 03:38:32 PDT 2025

Total time taken to generate the page: 0.16606 seconds