[Insight-users] Mask image filter -- how to mask small image into
large image?
Atwood, Robert C
r.atwood at imperial.ac.uk
Thu Jun 1 12:03:46 EDT 2006
Hi all:
I would like to draw several small shapes, stored in individual image
files, into a large image. The filter that seems to do what I want is
MaskImageFilter. However, I find the last point mentioned in the
documentation seems like a roadblock. So , I thought I would ask here
before randomly trying things that might work... How can I mask a
smaller image into a big image? If I have missed an available example
please direct me to it.
Thanks
Robert
(quote)
http://www.itk.org/Doxygen/html/classitk_1_1MaskImageFilter.html
Implements an operator for pixel-wise masking of the input image with
the mask.
This class is parametrized over the types of the input image type, the
mask image type and the type of the output image. Numeric conversions
(castings) are done by the C++ defaults.
The pixel type of the input 2 image must have a valid defintion of the
operator != with zero. This condition is required because internally
this filter will perform the operation
if pixel_from_mask_image != 0 pixel_output_image = pixel_input_image
else pixel_output_image = 0
The pixel from the input 1 is cast to the pixel type of the output
image.
****>> Note that the input and the mask images must be of the same size.
<<*****
More information about the Insight-users
mailing list