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

Home » Public Forums » archive » IDL's built-in function DILATE and ERODE doesn't work as described in help
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: IDL's built-in function DILATE and ERODE doesn't work as described in help [message #50829 is a reply to message #50717] Mon, 16 October 2006 13:29 Go to previous message
gqshen2008@gmail.com is currently offline  gqshen2008@gmail.com
Messages: 9
Registered: October 2005
Junior Member
I know this topic has gone beyond my initial question, but I have got
a response from ITTVIS support.
In IDL, if you don't set the optional argument(s), Nx, Ny or Nz, IDL
thinks that Nx = DIMENSION(X) /2, which means that
DILATE([0, 1, 1, 0], [1, 1])
has the same effect as
DILATE([0, 1, 1, 0], [1, 1], 1)
which means that for every 1 in the data, it will align with k[1], so
the output is [1, 1, 1, 0].
If you want to get the same result as in their help, you should
explicitly set the Nx to 0.
One interesting thing is that you can set Nx to 2, 3, 5 or even -1,
-2, etc.

Another interesting finding is that if you have:
DILATE([0, 1, 1, 0], [1, 1], 3)
My initial guess is that it will output [1, 0, 0, 0], however, IDL
will not replace 1 with [1, 1, 0, 0] unless any kernel's pixle overlays
with the original data. So the real result is [0, 0, 0, 0].

Notice the sudden jump of output from [0, 0, 0, 0]:
DILATE([0, 0, 1, 1], [1, 1], 3)
will output [1, 1, 0, 0].

Gongqin Shen wrote:
> For example, if you have the data as a = [0, 1, 1, 0] and kernel as k
> = [1, 1], according to the help provided by IDL, the result of running
> the code:
> result = DILATE(a, k)
> will be [0, 1, 1, 0], however, IDL's output is [1, 1, 1, 0].
> ERODE performs in a similar way. Does that mean the help is actually
> broken?
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: IDL's built-in function DILATE and ERODE doesn't work as described in help
Next Topic: Re: sorting string arrays - non alphabetic and user defined order

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

Current Time: Wed Oct 08 19:41:59 PDT 2025

Total time taken to generate the page: 0.00435 seconds