[Insight-users] Mask image filter -- how to mask small image intolarge image?

Atwood, Robert C r.atwood at imperial.ac.uk
Fri Jun 2 06:36:39 EDT 2006


As far as I can tell from reading it,  that is not what I want. 

 I want the target image to remain unchaged if the source is one and to
become zero if the source is zero . i.e., I want to 'paste' or 'mask'
such that already existing features in the target image are preserved if
they do not overlap the zero voxels in the source image. Is there such a
function in PasteImageFilter? A nubmer of different "BinaryFunctors"
could be used for the effect I want (and, or add, with suitable choice
of voxel values )  , is there an existing filter that applies a Binary
Functor to a region within an image 

Or to back up a bit...maybe I need to ask a bigger question, if I am
climbing the wrong tree here. 

 I am registering some features, the features are segmented already and
I have the bounding box of each feature. I am applying an affine
transform to a source image for each feature (and may wish to use a
different, deformable transform in the future) . The source image for
each feature is the same size as the bounding box of the feature. I
trheshold the fixed and moving images so they consist of only 0 and 1 .
After, I have a deformed version of the source image that is supposed to
be a representation of  the original . Now I would like to create a
synthetic image consisting of all these representations of features, so
as to assess to what degree the set of all representative features
reproduces the properties of the original image. 

So perhaps there is a different way?

 But, since my question I have implemented what I wanted on the raw
image arrays, but lacking a lot of nice bound and error checking and
flexible data type etc. that ITK provides. If such a function is not
available would it be feasable to abstract the BinaryFucntorImageFilter
into a BinaryFunctiorImageRegionFilter ? Or to abstract PasteImageFilter
to use any functor ? 



-----Original Message-----
From: Miller, James V (GE, Research) [mailto:millerjv at crd.ge.com] 
Sent: 01 June 2006 21:42
To: Atwood, Robert C; insight-users at itk.org
Subject: RE: [Insight-users] Mask image filter -- how to mask small
image intolarge image?

I think you might want to use the PasteImageFilter and not the 
MaskImageFilter.

Jim

-----Original Message-----
From: insight-users-bounces+millerjv=crd.ge.com at itk.org
[mailto:insight-users-bounces+millerjv=crd.ge.com at itk.org]On Behalf Of
Atwood, Robert C
Sent: Thursday, June 01, 2006 12:04 PM
To: insight-users at itk.org
Subject: [Insight-users] Mask image filter -- how to mask small image
intolarge image?



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.
<<*****
_______________________________________________
Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list