| Re: Label_region and Erosion [message #13380 is a reply to message #13283] |
Thu, 05 November 1998 00:00   |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
Lisa Bryan wrote:
>
> On 4 Nov 1998 12:10:34 GMT, Struan Gray <struan.gray@sljus.lu.se>
> wrote:
>
>> when playing with masked filtering I have found that it
>> is easiest to filter a copy of the whole dataset and then use the mask
>> to pick out the parts you actually wanted and insert them into the
>> original data. For my sorts of data the time penalty incurred by
>> filtering everything is more than compensated for by the generality of
>> the procedure (multiple, oddly shaped, reentrant regions are handled
>> transparently) and it's programming simplicity. You also have a
>> nicely behaved default behaviour for how boundary values are dealt
>> with when using filters of various widths.
>>
>>
>> Struan
>
> Ok, I think this may work...
>
> This is my data. Where the 0's represent pixel values which have a
> mean of 0 and deviation of about 10. And the +'s have a mean of 300
> and a deviation of about 30. And the size of the array is actually
> about 400x400. Plus both surfaces have a few nasty noise spikes that
> are significantly higher or lower than described.
>
> 00000000000000000000
> 000000+000++00000000
> 0000+++00+++++000000
> 0000++++++++00000000
> 00000+0++++++0+00000
> 00000000++0++++00000
> 000000000000++++0000
> 00000000000000+00000
> 00000000000000000000
> 00000000000000000000
>
> If I can get dilate to work on my greyscale image can expand the size
> of the island by the width of my filter, filter the entire image, then
> select the original region, I should be able to avoid all edge
> effects. (Up to this point filtering causes all my surfaces to turn
> into upside down bowls.) Now if I can just get dilate to work on a
> greyscale image. Thanks for the ideas!
>
> Lisa B.
>
> Arete Associates
> Tucson, Arizona
> lbryan@arete-az.com
Lisa -
Be sure you understand what the DILATE function is doing when
used on grayscale images. From the OnLine help:
Used with grayscale images, which are always converted to byte type, the
DILATE function is accomplished by taking the maximum of a set of sums.
It can be used to conveniently implement the neighborhood maximum
operator with the shape of the neighborhood given by the structuring
element.
To use DILATE and ERODE to implement convolution, which sounds like
what you would like to do, you need to use a binary image mask. You
can always manipulate the mask, and then apply it to your original
image to get the "new" image. You might want to play around with
"openings" and "closings" (combinations of Erodes and Dilates).
Hope this is useful.
Dave
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
|
|
|
|