[Insight-users] Re: masking a segmented region

Luis Ibanez luis.ibanez at kitware.com
Wed, 28 Jan 2004 16:15:47 -0500


Hi Delian,

You can use the AND image filter:

http://www.itk.org/Insight/Doxygen/html/classitk_1_1AndImageFilter.html

as long as your pixel type is of
'integer' type. That is, char,
short, int or long (signed or
unsigned).

Take the binary image produced by
your segmentation filter, scale it
to have 255 values in the segmented
region and zero values elsewhere.
(255 is assuming a char pixel type).

Then connect this segmented image as
one input to the AND image filter,
connect your original image as second
input.

The output of the AND filter will be a
masking of the original image using the
segmented region.


Regards,


    Luis


-----------------
Deliang Ye wrote:

> Luis,
> 
> How could I extract the segmented region and keep the original gray levels?
> Is there any functions already for this in ITK?
> 
> Thanks a lot for your help!
> 
> -Deliang Ye
> 
> 
> 
>