Re: accessing large arrays quickly [message #15610 is a reply to message #15605] |
Thu, 27 May 1999 00:00   |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
D. Mattes wrote:
>
> hello idl gurus: i have a very large volume array out of which i extract
> 3 orthogonal 2-d slices and display these slices in three separate
> windows. i extract a slice by assignment:
>
> slice=data(*,*,zslice)
>
> then i scale the slice, and finally display it using tv. once the volume
> grows to larger than 10Meg, i suffer a performance hit on the array access
> times, and my image browser slows down considerably. how can i improve
> performance???
David -
I think the single most effective solution would be to add memory
to your system. What platform are you using? If things slow down
considerably as the array grows, then you are being limited by
the amount of the array that can be stored in memory simultaneously.
We regularly do this type of array access, for computing orthogonal
slices, with integer arrays 256x256x124, or 16.2MB in size, and
we find this to be pretty fast. We're using Sun Sparc systems with >96MB
memory.
>
> some ideas i've had:
> 1. render the entire volume and specify cutting planes to just displa
> the slice of interest.
I wouldn't expect this to be faster than directly accessing the array.
> 2. use an external c function, like memcpy, to speed up the variable
> swapping when i assign 2-d array as a crosssection of the volume array.
I don't think this is your limitation.
> 3. store each possible slice separately, perhaps in a linked list.
Each slice along all three axes? That's a lot of slices! You would
run into the same memory limitations as before.
>
> do you idl gurus out there have any suggestions or comments on my ideas???
>
> thank you in advance for your time.
>
> david mattes
You might try playing around with the order in which you access
the three planes (XY, YZ, XZ), to try and optimize how you are
accessing the memory (XY will be least demanding).
Dave Foster
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
|
|
|