[Insight-users] Performing operations on masks

Iván Macía imacia at vicomtech.es
Wed May 18 05:20:27 EDT 2005


Dear users,
 
Is there any easy way to perform operations only on certain pixels of the
image defined by a mask (i.e. the result of a segmentation) ? What I want to
do is to perform some calculations only in the pixels that are part of my
segmentation, for example calculating some statistics of the pixels and
their neighborhood etc. 
 
It occurs to me that the natural way of doing this in itk is taking the
original image and the masked image, use an iterator for each (mask and
image), and calculate the values using the image iterator only for the
pixels whose value are not zero in the mask iterator. I could also perform a
binary AND with the image and the mask and make the calculations on the
non-zero pixels (the problem here is when there are pixels with zero value
among the segmented pixels).
 
My question here is : is this the best way to do this ? Is there any
automatic way of doing this now in itk ? I guess that this would be
something similar to defining a region for processing by combining an
itk::Region and a mask the same size. 
 
Thanks in advance for your help
 
Ivan Macia

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.12 - Release Date: 17/05/2005
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20050518/8f03e831/attachment.htm


More information about the Insight-users mailing list