<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR></HEAD>
<BODY dir=ltr>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=965274018-12072006>Hi,</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=965274018-12072006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=965274018-12072006>Still
waiting for an answer...</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=965274018-12072006>Is
there a way to handle multiple inputs/outputs within a
filter?</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=965274018-12072006></SPAN></FONT> </DIV>
<DIV><FONT size=+0><SPAN class=965274018-12072006>
<DIV><SPAN class=965274018-12072006></SPAN><FONT face=Arial color=#0000ff
size=2><SPAN class=965274018-12072006>The input image contains pixels with
invalid values, which need to be ignored during the filtering.
</SPAN></FONT><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=965274018-12072006>Therefore, the </SPAN>itkDiscreteGaussian filter needs
to be applied selectively only to valid
pixels.</FONT></FONT></FONT></SPAN></FONT></DIV></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=965274018-12072006>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).</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=965274018-12072006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=965274018-12072006>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.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=965274018-12072006>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.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=965274018-12072006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=965274018-12072006>In the
construction of the itkDiscreteGaussianFilter the input/output images are
penetrated to the base classes (<FONT
size=2>NeighborhoodOperatorImageFilterWithWeight, <FONT
size=2>ImageToImageFilter).</FONT></FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=965274018-12072006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=965274018-12072006>My
question is, how should I introduce the weight images as additional
input/output without having to change the code in the base
classes?</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=965274018-12072006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=965274018-12072006>Thanks,</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=965274018-12072006>Avner</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=965274018-12072006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=965274018-12072006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=965274018-12072006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=965274018-12072006></SPAN></FONT> </DIV>
<DIV>
<HR tabIndex=-1>
</DIV>
<DIV><FONT face=Tahoma size=2><B>From:</B> Avner MOSHKOVITZ <BR><B>Sent:</B>
Thursday, July 06, 2006 5:26 PM<BR><B>To:</B>
'insight-users@itk.org'<BR><B>Subject:</B> I need to customize
itkDiscreteGaussianImageFilter.txx to smooth an image with holes in
it<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=127460023-06072006><FONT face=Arial
size=2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=127460023-06072006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=127460023-06072006><FONT face=Arial size=2>I'm trying to
customize </FONT></SPAN><SPAN class=127460023-06072006><FONT face=Arial
size=2>itkDiscreteGaussianImageFilter.txx </FONT></SPAN><SPAN
class=127460023-06072006><FONT face=Arial size=2>to smooth an image with holes
in it.</FONT></SPAN></DIV>
<DIV><SPAN class=127460023-06072006></SPAN><SPAN class=127460023-06072006><FONT
face=Arial size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=127460023-06072006><FONT face=Arial size=2>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.</FONT></SPAN></DIV>
<DIV><SPAN class=127460023-06072006><FONT face=Arial size=2>In my case the input
image has invalid values in it which are signed with a predefined
value.</FONT></SPAN></DIV>
<DIV><SPAN class=127460023-06072006><FONT face=Arial size=2>I am applying the
<FONT size=2>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.</FONT></FONT></SPAN></DIV>
<DIV><SPAN class=127460023-06072006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=127460023-06072006><FONT face=Arial size=2>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.</FONT></SPAN></DIV>
<DIV><SPAN class=127460023-06072006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=127460023-06072006><FONT face=Arial size=2>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).</FONT></SPAN></DIV>
<DIV><SPAN class=127460023-06072006><FONT face=Arial size=2>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.</FONT></SPAN></DIV>
<DIV><SPAN class=127460023-06072006><FONT face=Arial size=2>
<DIV><SPAN class=127460023-06072006><FONT face=Arial size=2>My question is:
</FONT></SPAN><SPAN class=127460023-06072006><FONT face=Arial size=2>how do I
make the changes into ITK to incorporate an input and output weight
images?</FONT></SPAN></DIV></FONT></SPAN></DIV>
<DIV><SPAN class=127460023-06072006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=127460023-06072006><FONT face=Arial
size=2></FONT></SPAN> </DIV><!-- Converted from text/rtf format -->
<P><SPAN lang=en-ca><FONT face=Arial size=2>Thanks,</FONT></SPAN> <BR><SPAN
lang=en-ca><FONT face=Arial size=2>Avner</FONT></SPAN> </P>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>