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

Home » Public Forums » archive » Re: Label Region trouble
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: Label Region trouble [message #38006 is a reply to message #38000] Tue, 10 February 2004 11:02 Go to previous message
btt is currently offline  btt
Messages: 345
Registered: December 2000
Senior Member
Nuno Oliveira wrote:
> I'm almost shooting myself! Every time I think I'm reaching a solution I
> have a new problem! And this one is really something.
>
>
>
> The issue is that if find a boundary of ROI using Label Region before I don'
> t get the pixels that are on the borders of the image. This is really
> strange, I don't what Label Region does and even I can't find the code (is
> it in the IDL library? I don't find it!)
>

Hello,

Yes, it is a bit aggravating. The Label_Region function treats the
boundary of the image as background. Here's the blurb on the input
argument from the documentation....

" A n-dimensional image to be labeled. Data is converted to integer type
if necessary. Pixels at the edges of Data are considered to be zero."



The function below will work for 2d images.


FUNCTION MY_LABEL_REGION, data, _Extra = extra

Sz = Size(data)
dim = Sz[1:Sz[0]]
d = Make_Array(dim+2, value = 0, type = Sz[Sz[0]+1])

d[1,1] = data
mask = LABEL_REGION(d, _Extra = extra)

Return, mask[1:dim[0], 1:dim[1]]
END


If you have a lot of blobs within an image, you might prefer to use the
HISTOGRAM function with REVERSE_INDICES to navigate around the blobs.
It will save repeated calls to WHERE which has to search the entire array.

Ben
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: modify widget base colour
Next Topic: Re: Doing Nothing Takes Longer Than Doing... Nothing?

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

Current Time: Fri Oct 10 11:48:44 PDT 2025

Total time taken to generate the page: 1.27849 seconds