Re: byte array [message #45100] |
Sun, 14 August 2005 12:21 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Callisto writes:
> I have a (n,n,n) byte array (n can be 64, 128, 256...). I want to
> be able to "group" all points, i.e., group all the neighbouring values
> of 1 in groups, all the neighbouring values of 2 in groups, and so on.
> For example (2-D):
>
> 1 1 1 2 2 1 1 0
> 1 1 0 0 2 1 3 0
> 0 1 0 0 0 0 3 3
>
> in this case, I have two groups of "1", one group of "2", one group of
> "3" and three groups of "0".
>
> Is there a smart way to do it?
I would have a look at LABEL_REGION. You may have to
put a 1-pixel "border" on your image to get what you
expect. LABEL_REGION does something daft with regions
that butt up against the image edges as I recall.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|