[Insight-users] Constructing a filter with multiple inputs / outputs

Avner MOSHKOVITZ amoshkovitz at mdacorporation.com
Wed Jul 12 15:16:54 EDT 2006


Hi,
 
Still waiting for an answer...
Is there a way to handle multiple inputs/outputs within a filter?
 
The input image contains pixels with invalid values, which need to be
ignored during the filtering. Therefore, the itkDiscreteGaussian filter
needs to be applied selectively only to valid pixels.
To do that, during smartInnerProduct, the kernel weights are
accumulated. In the regular case the kernel weights sum up to 1.0 but in
this case the kernel weights sum up to a number smaller than 1.0 which
are kept in a weight image (after the filtering ends, the final weight
image is used to normalize the result value for the filtered pixels).
 
So, I'm looking for a way to introduce an input weight image and an
output weight image to the filter as additional input/output to the
input image and the filtered image.
The output weight image from each filter (I'm using to two filters, one
for each dimension) should be fed as input to the next filter, in the
same way as the chaining of the images.
 
In the construction of the itkDiscreteGaussianFilter the input/output
images are penetrated to the base classes
(NeighborhoodOperatorImageFilterWithWeight, ImageToImageFilter).
 
My question is, how should I introduce the weight images as additional
input/output without having to change the code in the base classes?
 
Thanks,
Avner
 
 
 
 
________________________________

From: Avner MOSHKOVITZ 
Sent: Thursday, July 06, 2006 5:26 PM
To: 'insight-users at itk.org'
Subject: I need to customize itkDiscreteGaussianImageFilter.txx to
smooth an image with holes in it


 
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 

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060712/dd59832c/attachment.html


More information about the Insight-users mailing list