[Insight-users] I need to customize itkDiscreteGaussianImageFilter.txx to smooth an image with holes in it

Avner Moshkovitz avner-moshkovitz at shaw.ca
Thu Jul 6 22:16:01 EDT 2006


Hi,

I'm trying to customize itkDiscreteGaussianImageFilter.txx to smooth an
image with holes in it.

With the current implementation every pixel in the input image must have a
valid value in it and all the pixels are pipelined into the Gaussian filter.
In my case the input image has invalid values in it which are signed with a
predefined value.
I am applying the smartInnerProduct only to valid pixels. The weight of the
kernel is accumulated (will be less than 1 in case of holes). Then the pixel
value is divided by the accumulated weight to get the smoothed value.

Since the Gaussian filter is applied twice (separable kernel) in each
dimension, I need to maintain the weights in a separate image, keep updating
them during the runs. After final output image should be divided by the
accumulated weight image.

In my case the filter should have 2 inputs (an input image and an input
weight image) and 2 outputs (an output image and an output weight image).
If I change the structure of NeighborhoodOperatorImageFilter.txx to have the
weight images, I should then change ImageToImageFilter class and then Image
source class and so on.
My question is: how do I make the changes into ITK to incorporate an input
and output weight images?


Thanks,
Avner



More information about the Insight-users mailing list