<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.6944.0">
<TITLE>RE: [Insight-users] fast binary dilate image filter</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>
<BR>
<P><FONT SIZE=2>Hi Gaetan,<BR>
<BR>
Happy to see that you find time to work on it, from my side is it still quite difficult T_T<BR>
<BR>
Anyway the part you are mentionning is directly taken from the paper quotated in the source. In fact this part take in account the translation required in case of structuring element which are *not* centered. Try to use this kind of SE:<BR>
<BR>
00001<BR>
00001<BR>
00001<BR>
00001<BR>
00000<BR>
<BR>
this is a 5x5 SE not centered, i.e. center not on. This kind of SE will produce a kind of "shift". In your case I suppose that your SE is a standard SE, i.e. an ellipsoid or something similar that is centered. Is it true that in many case we use centered SE. Try with this SE with and without the code part and see the difference. Use another lib or a pencil and paper to check the result. If it doesn't change nothing I will try to find the time to look at my code.<BR>
<BR>
BTW are do you know if the threading porting of the filter is on the way?<BR>
<BR>
Thanks.<BR>
<BR>
Best Regards,<BR>
<BR>
Jerome Schmid<BR>
<BR>
---------------------------------------------<BR>
Jerome SCHMID<BR>
Project Manager / Engineer<BR>
Augmented and Virtual Reality<BR>
Minimally Invasive Surgical Skills Center (MIS)<BR>
<A HREF="http://www.hkmisc.org.hk/">http://www.hkmisc.org.hk/</A><BR>
Prince of Wales Hospital<BR>
Chinese University Of Hong-Kong<BR>
----------------------------------------------<BR>
<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: Gaetan Lehmann [<A HREF="mailto:gaetan.lehmann@jouy.inra.fr">mailto:gaetan.lehmann@jouy.inra.fr</A>]<BR>
Sent: Fri 2/3/2006 4:58 AM<BR>
To: SCHMID, Jerome<BR>
Cc: insight-users@itk.org<BR>
Subject: Re: [Insight-users] fast binary dilate image filter<BR>
<BR>
<BR>
Hi Jerome,<BR>
<BR>
I'm again working on binary dilate filter.<BR>
<BR>
I don't understand what the last part of the code is for.<BR>
<BR>
while( !ouRegIndexIt.IsAtEnd() )<BR>
{<BR>
// Retrieve index of current output pixel<BR>
IndexType currentIndex = ouRegIndexIt.GetIndex();<BR>
for( vecIt = vecBeginIt; vecIt != vecEndIt; ++vecIt )<BR>
{<BR>
// Translate<BR>
IndexType translatedIndex = currentIndex - *vecIt;<BR>
<BR>
// translated index now is an index in input image in the<BR>
// output requested region padded. Theoretically, this translated<BR>
// index must be inside the padded region.<BR>
// If the pixel in the input image at the translated index<BR>
// has a value equal to the dilate one, this means<BR>
// that the output pixel at currentIndex will be on in the output.<BR>
if( inputRegionForThread.IsInside( translatedIndex ) &&<BR>
input->GetPixel( translatedIndex ) == foregroundValue )<BR>
{<BR>
ouRegIndexIt.Set( foregroundValue );<BR>
break; // Do not need to examine other offsets because at least one<BR>
// input pixel has been translated on current output pixel.<BR>
}<BR>
}<BR>
<BR>
++ouRegIndexIt;<BR>
progress.CompletedPixel();<BR>
}<BR>
<BR>
<BR>
<BR>
In fact, if I drop this part, I get the same output image. Can you explain me<BR>
the role of this code ?<BR>
<BR>
Thanks,<BR>
<BR>
Gaetan<BR>
<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>