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

Home » Public Forums » archive » collapsing 3-d arrays
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
collapsing 3-d arrays [message #6505] Wed, 10 July 1996 00:00 Go to next message
deb is currently offline  deb
Messages: 12
Registered: April 1996
Junior Member
I have a pretty large 3-D data array (~10 million pts). I'd like to
collapse
the data and look at a 2-d image that contains the max value encountered
along the third coordinate. I can write a nested loop that
looks thru the array and pulls out the max data value along the z-axis
for each
x,y coordinate pair, but that's pretty cumbersome. It seems like IDL
should have
a built-in function for doing this kind of thing, but i can't seem to
find it.
The project_vol command looks like it might do what i want but i can't
seem to
convince it to give projections along the (x,y), (x,z) and/or (y,z)
planes..it
does some weird pseudo-isometric thing. Does anyone have any hints on
how to
accomplish this efficiently within IDL?
Re: collapsing 3-d arrays [message #6561 is a reply to message #6505] Sun, 14 July 1996 00:00 Go to previous message
paritosh is currently offline  paritosh
Messages: 2
Registered: July 1996
Junior Member
Perhaps VOXEL_PROJ with maximum_intensity keyword
will be appropriate built-in function.

Paritosh
Re: collapsing 3-d arrays [message #6584 is a reply to message #6505] Thu, 11 July 1996 00:00 Go to previous message
hahn is currently offline  hahn
Messages: 108
Registered: November 1993
Senior Member
deb <summa@lanl.gov> wrote:

> I have a pretty large 3-D data array (~10 million pts). I'd like to
> collapse
> the data and look at a 2-d image that contains the max value encountered
> along the third coordinate. I can write a nested loop that
> looks thru the array and pulls out the max data value along the z-axis
> for each
> x,y coordinate pair, but that's pretty cumbersome. It seems like IDL
> should have
> a built-in function for doing this kind of thing, but i can't seem to
> find it.

The IDL function is MAX. It accepts an array as argument and returns
a scalar. Thus you need two nested loops to make a 2-d matrix.

Let's assume your 3-D data array is named D3, you may write:

si = size ( D3 )

D2 = fltarr(si(1),si(2), /nozero)

for i=0,si(1)-1 do begin
for j=0,si(2)-1 do D2(i,j) = max ( D3(i,j,*) )
endfor

Hope this helps
Norbert
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Problem with call_external on SunOS 4.1.3 with acc 3.0.1
Next Topic: IDL & Win95 -- arrggh

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

Current Time: Wed Oct 08 17:35:32 PDT 2025

Total time taken to generate the page: 0.03217 seconds