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 #71437 is a reply to message #71436] Sun, 20 June 2010 17:06 Go to previous messageGo to previous message
Mat is currently offline  Mat
Messages: 14
Registered: December 2009
Junior Member
On Jun 21, 11:15 am, pp <pp.pente...@gmail.com> wrote:
> 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.- Hide quoted text -
>
> - Show quoted text -

The results are three water quality parameters. Actually it does not
matter whether they are within one result or three separate results.
[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 04:56:19 PDT 2025

Total time taken to generate the page: 1.12033 seconds