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

Home » Public Forums » archive » Re: Best way to move a window
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: Best way to move a window [message #29669 is a reply to message #29528] Thu, 28 February 2002 05:35 Go to previous message
Jaco van Gorkom is currently offline  Jaco van Gorkom
Messages: 97
Registered: November 2000
Member
"Marc Schellens" <m_schellens@hotmail.com> wrote in message
news:3C7DCAF1.2A2CF47E@hotmail.com...
> ;;here we go ------------
> kernel=bytarr(3,3)
> kernel[*]=1
>
> boolArr=bytarr(num_tile_samples,num_tile_samples)
> w=where(abs(tile_data - 180.0) lt 0.0001)
> ;; check (if necessary)
> if w[0] eq -1 then return ;; or whatever
> boolArr[w]=1
>
> res=convol(boolArr,kernel,/EDGE_TRUNCATE)
>
> ;; these are the indices you want
> w1=where(res ge 1)
>
> ;; w9=where(res ge 9) ;; these are the ones if you would AND instead of
> OR
> ;; in the example above
>
> out_tile[w1]=0
> ;;finish ----------------

Actually, the LT operator directly returns the array of 0's and 1's which
you
would want to convolute. So the whole thing becomes even more readable
(well, for me at least) with one WHERE-step less:

kernel = REPLICATE(1B, 3, 3)
boolArr = ABS(tile_data - 180.) LT 0.0001
res = CONVOL(boolArr, kernel, /edge_truncate)
wOR = WHERE(res GE 1, complement=wRest)
out_tile[wOR] = 0 ; the original IF-step
out_tile[wRest] = whatever ; the original ELSE-step

cheers,
Jaco
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: How to move shade_surface axes?
Next Topic: Projected Image Data

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

Current Time: Mon Dec 01 13:20:00 PST 2025

Total time taken to generate the page: 1.11831 seconds