[Insight-users] Filtering with a mask?

Luis Ibanez luis.ibanez at kitware.com
Tue, 06 Apr 2004 16:48:08 -0400


Hi Robert,


There is no specific filter in ITK that will
perform such masked smoothing.

You can however smooth the entire image and then
merge the original and the smoothed images by
using your thresholding criterion.

That is, if the original image pixel is less
than "threshold" the output pixel is equal to
the non-smoothed pixel, and if the input pixel
is greater than the "threshold" then the output
pixel is equal to the smoothed pixel.

Than can be implemented in a couple of hours by
using the BinaryFunctorImageFilter. Please look
at filters such as AddImageFilter for an example
on how to do this.
http://www.itk.org/Insight/Doxygen/html/classitk_1_1AddImageFilter.html


You seems to be asking also for a conditional
neighborhood when computing the smoothed pixels,
you could implement such effect by writing a
Neighborhood operator in the same way that the
operators for MathematicalMorphology have been
created.

Please look at the following classes:

itkNeighborhood
http://www.itk.org/Insight/Doxygen/html/classitk_1_1Neighborhood.html

itkNeighborhoodOperator
http://www.itk.org/Insight/Doxygen/html/classitk_1_1NeighborhoodOperator.html


Regards,



     Luis



------------------------
Atwood, Robert C wrote:

> Is there an existing method for smoothing the image only in specified
> regions, while leaving other regions untouched? Or,smoothing voxels with
> a value less than a trheshold, ignoring contributions from neighbours
> that lie outside the threshold? 
> 
> ie. for a simple average smoothing, the new value equals the average of
> all values in the neighbourhood which have a value not equal to a
> specified value? 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>