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

Home » Public Forums » archive » Re: Convert 3D to 1D, apply fuction then convert back to 3D
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: Convert 3D to 1D, apply fuction then convert back to 3D [message #71438 is a reply to message #71437] Sun, 20 June 2010 16:15 Go to previous messageGo to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Jun 20, 7:58 pm, Mat <m...@waikato.ac.nz> wrote:
> I am converting a image (5 bands) to 1D using reform. I then apply a
> function to this data and get a double "Array[3]"result. How do I then
> convert this result back into the origional image dimensions? eg:
>
> image= READ_IMAGE('test.tif')
> imagesize = SIZE(image, /DIMENSIONS)
> nx=imagesize[1]
> ny=imagesize[2]
> npix = nx*ny
> coords_2d = array_indices([nx,ny], lindgen(npix), /dimen)
> imageR= REFORM(image,5,npix)
>
> I then apply a function to this data and get a return in the form of:
>
> IDL> help, ret3
> RET3            DOUBLE    = Array[3]
>
> I'm struggling to covert this back to a 3D image. Any ideas?

You are getting a result that is 1D (a 3-element vector). You can
change it from its 1 dimension to 3, with a reform(ret3,1,1,3), but it
would still have only 3 elements, not the original 5,nx,ny you want.

You need to think about what those 3 values represent with relation to
you image and what you were looking for, which we cannot guess just
from that description.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Selecting data from two separate arrays
Next Topic: Re: MPFIT Chance probability

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

Current Time: Fri Oct 10 06:40:43 PDT 2025

Total time taken to generate the page: 1.11755 seconds