[Insight-users] fast binary dilate image filter

Gaetan Lehmann gaetan.lehmann at jouy.inra.fr
Fri Feb 3 04:35:13 EST 2006


On Fri, 03 Feb 2006 02:36:45 +0100, SCHMID, Jerome  
<jeromeschmid at surgery.cuhk.edu.hk> wrote:

>
>
> Hi Gaetan,
>
> Happy to see that you find time to work on it, from my side is it still  
> quite
> difficult T_T
>
> 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:
>
> 00001
> 00001
> 00001
> 00001
> 00000
>
> 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.
>

Ok, I see. I haven't thought to that case :-)
I'll try, but I'm quite sure you're right

> BTW are do you know if the threading porting of the filter is on the way?
>

I'm working on adding boundary support, and on improving progress report.
I think the filter can't be threaded for a simple reason: the flooding  
process ("burning" in the paper) can't be limited to the region assigned  
to a thread, and so, the only part which can be threaded is the  
initialization of the output image, and the creation of the temp image -  
it seems to be some work for a very small gain of performance

Gaetan

> Thanks.
>
> Best Regards,
>
> Jerome Schmid
>
> ---------------------------------------------
> Jerome SCHMID
> Project Manager / Engineer
> Augmented and Virtual Reality
> Minimally Invasive Surgical Skills Center (MIS)
> http://www.hkmisc.org.hk/
> Prince of Wales Hospital
> Chinese University Of Hong-Kong
> ----------------------------------------------
>
>
>
> -----Original Message-----
> From: Gaetan Lehmann [mailto:gaetan.lehmann at jouy.inra.fr]
> Sent: Fri 2/3/2006 4:58 AM
> To: SCHMID, Jerome
> Cc: insight-users at itk.org
> Subject: Re: [Insight-users] fast binary dilate image filter
>
>
> Hi Jerome,
>
> I'm again working on binary dilate filter.
>
> I don't understand what the last part of the code is for.
>
> while( !ouRegIndexIt.IsAtEnd() )
> {
> // Retrieve index of current output pixel
> IndexType currentIndex = ouRegIndexIt.GetIndex();
> for( vecIt = vecBeginIt; vecIt != vecEndIt; ++vecIt )
> {
> // Translate
> IndexType translatedIndex = currentIndex - *vecIt;
>
> // translated index now is an index in input image in the
> // output requested region padded. Theoretically, this translated
> // index must be inside the padded region.
> // If the pixel in the input image at the translated index
> // has a value equal to the dilate one, this means
> // that the output pixel at currentIndex will be on in the output.
> if( inputRegionForThread.IsInside( translatedIndex ) &&
> input->GetPixel( translatedIndex ) == foregroundValue )
> {
> ouRegIndexIt.Set( foregroundValue );
> break; // Do not need to examine other offsets because at least one
> // input pixel has been translated on current output pixel.
> }
> }
>
> ++ouRegIndexIt;
> progress.CompletedPixel();
> }
>
>
>
> In fact, if I drop this part, I get the same output image. Can you  
> explain me
> the role of this code ?
>
> Thanks,
>
> Gaetan
>
>



-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr


More information about the Insight-users mailing list