[Insight-users] Performing operations on masks

Iván Macía imacia at vicomtech.es
Fri May 20 05:51:03 EDT 2005


James,

I have been able to test the filter and compiles and works perfectly on VC++
7.1 under WinXP. I cannot tell you about other platforms. I'm enclosing my
sample code. Maybe you could reuse it for some example, etc.

Regards

Ivan
 

> -----Mensaje original-----
> De: Miller, James V (Research) [mailto:millerjv at crd.ge.com] 
> Enviado el: miércoles, 18 de mayo de 2005 15:37
> Para: Iván Macía; Insight Users
> Asunto: RE: [Insight-users] Performing operations on masks
> 
> 
> Ivan, 
> 
> I added this MaskNeighborhoodOperatorImageFilter last week. Let me 
> know if you have any issues.  I have used the filter in my 
> own application but have not had a chance to write a test for 
> the filter.  There could be some cross platform compiler 
> issues that I have seen yet. 
> 
> The NormalizedCorrelationImageFilter also will operate with a Mask.
> 
> There is also a LabelStatisticsImageFilter that takes an 
> intensity image and a label map (mask with several different 
> labels).  This 
> filter will calculate the image statistics of the intensity 
> image pixels associated with each distinct label.
> 
> I want to add some other filters that operate under a mask.  
> Things like DiscreteGaussian, Gradients, and maybe even the 
> unary/binary/ternary/nary 
> image filters.
> 
> Not that if you are performing a separable operation under a 
> mask, each of the separable operations may need a slightly 
> different mask (earlier operations may need slightly dilated 
> masks in order to produce all the 
> data that later operations may need).
> 
> 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 Iván Macía
> Sent: Wednesday, May 18, 2005 7:49 AM
> To: 'Iván Macía'; 'Insight Users'
> Subject: RE: [Insight-users] Performing operations on masks
> 
> 
> Hi again,
> 
> Answering to myself I have found a wonderful new 
> itk::MaskNeighborhoodOperatorImageFilter in the CVS that is 3 
> days old :) It seems like this will do the job. I will give it a try.
> 
> Cheers
> 
> Ivan Macia
> 
> 
> -----Mensaje original-----
> De: insight-users-bounces+imacia=vicomtech.es at itk.org
> [mailto:insight-users-bounces+imacia=vicomtech.es at itk.org] En 
> nombre de Iván Macía Enviado el: miércoles, 18 de mayo de 2005 11:20
> Para: Insight Users
> Asunto: [Insight-users] Performing operations on masks
> 
> 
> 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
> 
> 
> 
> --
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.11.12 - Release Date: 
> 17/05/2005
> 
> -- 
> 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
>  
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org 
> http://www.itk.org/mailman/listinfo/insight-users
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.11.12 - Release Date: 
> 17/05/2005
>  
> 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.322 / Virus Database: 266.11.12 - Release Date: 17/05/2005
 
  
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MaskNeighborhoodOperatorImageFilter.cxx
Type: application/octet-stream
Size: 4020 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/insight-users/attachments/20050520/fb1e0301/MaskNeighborhoodOperatorImageFilter.obj


More information about the Insight-users mailing list