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

Home » Public Forums » archive » Re: how to resahpe image in IDL
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
Re: how to resahpe image in IDL [message #69940] Tue, 23 February 2010 08:45
Maarten[1] is currently offline  Maarten[1]
Messages: 176
Registered: November 2005
Senior Member
On Feb 23, 5:08 pm, Nayan <mkzama...@gmail.com> wrote:
> I have a 3 D (x*y*z) image matrices, Is there any command in IDL to
> convert this to a 2D
> matrix, of size [(x*y),z]?.

Yes, there is such a command.

Oh, you want me to mention the name?

reform()

You may need to use transpose once or twice to get the elements in the
order you need.

Maarten

Example:
a = intarr(2,3)
for i = 0,1 do a[i,*] = i
b = intarr(2,3,5)
for i = 0,4 do b[*,*,i] = a
c = transpose(reform(transpose(b), 5, 2*3))

or

c = reform(b, 6, 5)
Re: how to resahpe image in IDL [message #69941 is a reply to message #69940] Tue, 23 February 2010 08:43 Go to previous message
ameigs is currently offline  ameigs
Messages: 12
Registered: March 2009
Junior Member
On 23 Feb, 16:08, Nayan <mkzama...@gmail.com> wrote:
> I have a 3 D (x*y*z) image matrices, Is there any command in IDL to
> convert this to a 2D
> matrix, of size [(x*y),z]?.

Probably, the build-in function, REFORM, will do this job for you.

IDL> a = indgen(5,10,20)
IDL> help, a
A INT = Array[5, 10, 20]
IDL> b = reform(a, 5*10,20)
IDL> help, b
B INT = Array[50, 20]
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: how to resahpe image in IDL
Next Topic: Re: wavelength calibration

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

Current Time: Wed Oct 08 13:37:52 PDT 2025

Total time taken to generate the page: 0.00461 seconds