[Insight-users] RE: Fast binary morphology dilation filter streamable and threada ble

Miller, James V (Research) millerjv at crd.ge.com
Wed Sep 29 11:38:26 EDT 2004


Jerome, 

I just glanced at the changes in your filter.  

I do not see much of the redundant coding that you are worried about. It
looks like it may just be the computation of input region for thread. This
is
not an issue I would worry about.

I am worried about line 769 in the txx file. Couldn't this line of code
try to set a pixel that is outside the outputRegionForThread?

Jim


-----Original Message-----
From: jerome schmid [mailto:jerome.schmid at ircad.u-strasbg.fr]
Sent: Wednesday, September 29, 2004 11:06 AM
To: Insight-users at itk.org
Cc: Miller, James V (Research)
Subject: Fast binary morphology dilation filter streamable and
threadable


Hi itk users,

For those who remember, I proposed a time ago a fast implementation of
binary dilation. This filter is faster than itk one and works for non
centered structuring element. However the filter was not threadable and the
streaming support seemed not correct.

Thanks to the help of James Miller I have tried to improve it. Now the
filter supports threading and streaming. Well I have tested it on 2D and 3D
data, and it seems to work. So obviously I post it if somebody is interested
on test it or use it.

I have tried this time to have a more "itk like" coding. Note that forcing
the filter to work in threaded environment ( using SetNumberOfThreads()
function ) whereas parallel processing is not available may produce a filter
longer in terms of time than a single-threaded one. The reason is that some
redundant computing is done in case of threads and it is actually difficult
to remove the redundancy. But if parallel processing is possible the time
saved by parallel processing must be bigger than the redundancy time.

James,I haven't yet create a common interface for dilation and erosion as
you proposed previously. If the current filter suits to you I could
eventually try to do it. I have joined to this email a little prgm and an
image for test the filter. In this program you can enable/disable threading
or requested region setting thanks to simple #define. The requested region
is interesting because you can see the effect of element which are outside
current requested region: they may paint elements on the current requested
region. You will also notice that objects #1..,#j which have not a value
equal to the dilate value are not dilated.

As SE is a unique ON pixel in position (0, 3), the dilation is a shift in
left direction.

Regards,

Jerome Schmid






More information about the Insight-users mailing list