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

Home » Public Forums » archive » Re: extracting subarray (*,*,index) gives (1,1,index). WHY ???
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: extracting subarray (*,*,index) gives (1,1,index). WHY ??? [message #6888 is a reply to message #6887] Tue, 20 August 1996 00:00 Go to previous message
Thomas A. McGlynn is currently offline  Thomas A. McGlynn
Messages: 23
Registered: March 1996
Junior Member
Uwe Knorr wrote:
>
> Dear reader,
>
> i want to extract a line from a 3D image by doing
> line = image(*,*,z)
> i expect line to be a 1d vector with dimension dim(z)
> or to be more IDLish, i expect the following to hold
> size(line) == (z)
> but instead I get
> size(line) == (1,1,z)
> I hope you know what I mean.
>
> Thanx for giving me some of your time,
>
> Uwe Knorr.
>

I'm a little confused by your message. I'm guessing
what you want is something like:

x = fltarr(30,30,30)
y = x(1,1,*)

where you'd like y to be a one dimensional vector of length 30.
If so then you need to rewrite the second statement as

y = reform(x(1,1,*))

while will get rid of the extra leading dimensions.

What you describe though is:

y = x(*,*,1)

which will return y as a two-dimensional array and suppress
the third dimension automatically. I.e., we'd have

size(y) == (2,30,30,4,900)

Hope this helps,

Tom McGlynn
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Help on CGM Device
Next Topic: I had to try it!

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

Current Time: Thu Oct 16 20:51:47 PDT 2025

Total time taken to generate the page: 2.55735 seconds