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

Home » Public Forums » archive » Label_region and Erosion
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 and Erosion [message #13356 is a reply to message #13283] Fri, 06 November 1998 00:00 Go to previous messageGo to previous message
Struan Gray is currently offline  Struan Gray
Messages: 178
Registered: December 1995
Senior Member
Alex Schuster, alex@rosa.mpin-koeln.mpg.de writes:
>
> Struan Gray wrote:
>>
>> mask = image > threshold_val
>
> Slight correction: mask = image gt threshold_val

Sigh. I made this mistake in my very first programming class and
have been making it consistently ever since. Thanks for pointing it
out.

While I'm here, another thing I like to do when using masks is to
display the mask as a colour cast on the original image by creating an
RGB image and zeroing one of the channels wherever the mask is active:

image = byte(dist(250))
mask = image gt 100
rgb_image = bytarr(3,250,250)
rgb_image[0,*,*] = image*(mask eq 0)
rgb_image[1,*,*] = image
rgb_iamge[2,*,*] = image
tv, image, /true

This has the effect of changing every pixel where the mask is
active from a greyscale to cyanscale value. If you are running in 8
bit colour you'll have to use COLOR_QUAN to construct a custom colour
table before using tv. Zapping the a different channel shades the
mask with the appropriate complementary colour.

A final tip: if, like me, you often end up creating masks which
cannot easily be created with a simple global selection criteria, it
is often easiest to export the image as a TIFF file, use Photoshop's
excellent selection tools to create a mask, and then load it back into
IDL.


Struan
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL 5.2 reviews?
Next Topic: IDL colors on Linux XFree86

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

Current Time: Fri Oct 10 12:40:27 PDT 2025

Total time taken to generate the page: 0.79849 seconds