Re: Building Voxel arrays from png files (compression, analysis, and visualization) [message #45213 is a reply to message #45205] |
Mon, 22 August 2005 12:48  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Greener writes:
> I have no previous programming experience, prior to this I was a
> biology student with some computing background. I am working on
> speeding up the below script and trying to reduce the amount of data
> lost during compression. Currently I am relying on the IDL
> Interpolation to create a new voxel array from a series of
> 2-dimensional images. I am constrained to 1.5 GB of RAM and I am
> using the two for loops in an attempt to reduce the amount of data in
> memory at any one time.
> The program usually takes 4 days or more hours to run a set of 10,000
> images compressed 4x, resulting in a voxel array of dimensions
> [2000,2000,2500]. The images are pictures of small animal organs and
> are being used to image the arterial networks.
> Any suggestions would be greatly appreciated.
Just a couple of suggestions. First, is there any reason why
you are choosing to use INTERPOLATE rather than REBIN or
CONGRID (which, I guess, actually uses INTERPOLATE). CONGRID
just seems more straightforward to me.
Second, on your INTERPOLATE command you are using this kind
of syntax:
> new_img = INTERPOLATE(sub_vol[*,*,*],x_ramp,y_ramp,z_int,/GRID)
In fact, you use the sub_vol[*,*,*] syntax quite a lot. That is
*really* using a lot of memory. Here is an article that explains
why:
http://www.dfanning.com/misc_tips/submemory.html
Perhaps just changing this line to this:
new_img = INTERPOLATE(sub_vol,x_ramp,y_ramp,z_int,/GRID)
will speed things up dramatically.
The experts will probably have other things to say about
your algorithm. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|