[Insight-users] Distance transform in a hurry

Richard Beare richard.beare at gmail.com
Thu Aug 12 18:39:54 EDT 2010


There is also a closely related package I wrote - the
parabolicMorphology package. I only discovered the generalized DT
package after I wrote most of it and never got around to sorting out
the details of how they matched up.

http://hdl.handle.net/1926/1370

latest code:

darcs get http://voxel.jouy.inra.fr/darcs/contrib-itk/parabolicMorphology

It is also loads faster for distance transforms, is fully threaded and
there are helper classes for doing binary erosion and dilation. I
personally think that the approach of both existing ITK signed DT
filters on using a 3x3 morphological operation to introduce a zero
contour is wrong (it is definitely wrong at corners) because it
introduces a somewhat pointless asymmetry between foreground and
background so the signed DT in the parabolicMorph package doesn't do
that.

There is room for a lot more optimization as well, especially for
signed transforms.

On Fri, Aug 13, 2010 at 7:55 AM, Benjamin King <benjaminking at web.de> wrote:
> Hi Bill,
>
>
>> How does it compare to BasicFilters/itkSignedMaurerDistanceMapImageFilter
>
> The comparison is a bit unfair, because the signed maurer filter does more
> (erode, subtract). Anyhow, I still have included it in the performance test
> code for reference. There is advice in the README of the new revision on how
> to run the test on your machine.
>
> I have tested it on two machines:
> 1) Intel Core2 at 4400GHz, 4GB, 64k L1 cache/core
>        OpenMP activated, two  threads
> 2) PowerPC G4 at 1500GHz, 1GB, 64K L1 cache
>        Somewhat obsolete, I know, but that's what I use at home.
>
> Timings for Intel Core2:
> ==================
> binary $ for n in small medium big; do ./timePerformance
> ../data/${n}Dataset.hdr 2>&1; done
> Image Size: [136, 136, 121]
> GeneralizedDistanceTransformImageFilter with spacing, with Voronoi map:
> 0.258316 seconds.
> GeneralizedDistanceTransformImageFilter with spacing, without Voronoi map:
> 0.170343 seconds.
> GeneralizedDistanceTransformImageFilter without spacing, with Voronoi map:
> 0.178741 seconds.
> GeneralizedDistanceTransformImageFilter without spacing, without Voronoi
> map: 0.145451 seconds.
> SignedMaurerDistanceMapImageFilter with spacing: 1.49137 seconds.
> SignedMaurerDistanceMapImageFilter without spacing: 1.41707 seconds.
> DanielsonDistanceMapImageFilter with spacing: 4.22709 seconds.
> DanielsonDistanceMapImageFilter without spacing: 3.87058 seconds.
> Image Size: [256, 256, 165]
> GeneralizedDistanceTransformImageFilter with spacing, with Voronoi map:
> 1.18553 seconds.
> GeneralizedDistanceTransformImageFilter with spacing, without Voronoi map:
> 0.998904 seconds.
> GeneralizedDistanceTransformImageFilter without spacing, with Voronoi map:
> 1.13111 seconds.
> GeneralizedDistanceTransformImageFilter without spacing, without Voronoi
> map: 0.897599 seconds.
> SignedMaurerDistanceMapImageFilter with spacing: 5.91667 seconds.
> SignedMaurerDistanceMapImageFilter without spacing: 5.54279 seconds.
> DanielsonDistanceMapImageFilter with spacing: 20.6855 seconds.
> DanielsonDistanceMapImageFilter without spacing: 19.0623 seconds.
> Image Size: [512, 512, 348]
> GeneralizedDistanceTransformImageFilter with spacing, with Voronoi map:
> 9.01232 seconds.
> GeneralizedDistanceTransformImageFilter with spacing, without Voronoi map:
> 7.12291 seconds.
> GeneralizedDistanceTransformImageFilter without spacing, with Voronoi map:
> 7.76838 seconds.
> GeneralizedDistanceTransformImageFilter without spacing, without Voronoi
> map: 6.00974 seconds.
> SignedMaurerDistanceMapImageFilter with spacing: 61.803 seconds.
> SignedMaurerDistanceMapImageFilter without spacing: 58.1896 seconds.
> DanielsonDistanceMapImageFilter with spacing: 176.014 seconds.
> DanielsonDistanceMapImageFilter without spacing: 160.907 seconds.
>
>
> Timings for PowerPC G4:
> ====================
> binary $ for n in small medium big; do ./timePerformance
> ../data/${n}Dataset.hdr 2>&1; done
> Image Size: [136, 136, 121]
> GeneralizedDistanceTransformImageFilter with spacing, with Voronoi map:
> 1.74435 seconds.
> GeneralizedDistanceTransformImageFilter with spacing, without Voronoi map:
> 1.2383 seconds.
> GeneralizedDistanceTransformImageFilter without spacing, with Voronoi map:
> 1.69638 seconds.
> GeneralizedDistanceTransformImageFilter without spacing, without Voronoi
> map: 1.20015 seconds.
> SignedMaurerDistanceMapImageFilter with spacing: 21.5954 seconds.
> SignedMaurerDistanceMapImageFilter without spacing: 21.2992 seconds.
> DanielsonDistanceMapImageFilter with spacing: 97.6216 seconds.
> DanielsonDistanceMapImageFilter without spacing: 98.0624 seconds.
> Image Size: [256, 256, 165]
> GeneralizedDistanceTransformImageFilter with spacing, with Voronoi map:
> 10.9729 seconds.
> GeneralizedDistanceTransformImageFilter with spacing, without Voronoi map:
> 9.2106 seconds.
> GeneralizedDistanceTransformImageFilter without spacing, with Voronoi map:
> 10.1512 seconds.
> GeneralizedDistanceTransformImageFilter without spacing, without Voronoi
> map: 7.65246 seconds.
> SignedMaurerDistanceMapImageFilter with spacing: 94.0232 seconds.
> ^C
>
> Aborted due to impatience...
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list