Re: how to resahpe image in IDL [message #69940] |
Tue, 23 February 2010 08:45 |
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  |
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]
|
|
|