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

Home » Public Forums » archive » Re: New IDL User Questions
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: New IDL User Questions [message #25000 is a reply to message #24986] Tue, 08 May 2001 20:30 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"John Piccirillo" <jpicciri@radiancetech.com> writes:
> 2. Array Operations - Not being used to IDL type of array operations,
> is there a simpler way to do the following?
> a.
> For I = 0, 199 Do Begin
> For J = 0, 84 Do Begin
> If (ImageMask[I,J] EQ 1) Then ImageROI[I,J,*] =
> ImageS[I,J,*]
> Else ImageROI[I,J,*] = 0
> EndFor
> EndFor
> I thought of using the WHERE function as in,
> ROI = Where(ImageMask EQ 1)
> but ImageROI[ROI} = ImageS{ROI} leaves out the third dimension.



JD may have been thinking of a different question here. I believe you
want only a slight modification to your code:

ROI = Where(ImageMask EQ 1)
ImageROI[ROI,*] = ImageS[ROI,*]

This will include the third dimension.



> b. ;blow-up image X 9 For Screen Display
> For j = 0,84 Do Begin
> For i = 0,199 Do Begin
> JImage[3*i,3*j] = ImageS[i,j,[4]]
...
> EndFor
> EndFor



Liam plugged IMDISP so I will plug PLOTIMAGE on my web page. If you
really just want to expand an image then it is very straightforward to
use the REBIN function. Otherwise either Liam or my image display
program will be quite easy.


JImage = rebin(ImageS[*,*,4], 200*3, 85*3, 1)

The extra "1" is because ImageS[*,*,4] is really a 200x85x1 array.


Craig

http://cow.physics.wisc.edu/~craigm/idl/idl.html (PLOTIMAGE is under Graphics)

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: TRIGRID co-linearity problem
Next Topic: A new object to play with: horizontal (rectangular) grids

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

Current Time: Thu Oct 09 15:22:58 PDT 2025

Total time taken to generate the page: 0.95692 seconds