# Signed Distance Map Default Behavior

Gaëtan Lehmann
2011-09-16
BUG: Distance filter should use consistent defaults

Distance maps are commonly regarded as know to be a way to compute exact Euclidean distance, but with the default values, that was not the case, forcing the user to change those values each time to get exact results.

In order to make the all distance maps behave consistently, they should default to the natural Euclidean distance measures in physical space.

The filters are configurable to run faster but with results that require end-user care to ensure that they are used properly (i.e. distances can be squares of either physical or voxel distances).

/* For Dannielsson, SignedDannielsson, SignedMaurer, DirectedHausdorff, and Hausdorff */

DistanceFilterType::PointerPointer distanceFilter = DistanceFilterType::PointerType::New(); distanceFilter->SetInput( reader->GetOutput() ); /*ITKv3 default to fastest computation, but data dependant interpretations*/ /*ITKv3 method defaulted to implied behavior of SetSquaredDistance(true), SetUseImageSpacing(false) */ distanceFilter->Update();
DistanceFilterType::PointerPointer distanceFilter = DistanceFilterType::PointerType::New(); distanceFilter->SetInput( reader->GetOutput() ); /*ITKv4 defaults to consistent physical space interpretation*/ /*ITKv4 method defaults to SetSquaredDistance(false), SetUseImageSpacing(true) */ distanceFilter->SetUseImageSpacing(false);/*Force ITKv3 default behavoir*/ /* For SignedMaurer, the ITKv3 method used SetSquaredDistance(true), all others used (false) distanceFilter->SetSquaredDistance(true); /*Force ITKv3 default behavior*/ distanceFilter->Update();
Id688aaabc72041c866f285784f55db10769d0a55
Modules/Filtering/DistanceMap/include/itkSignedMaurerDistanceMapImageFilter.h Modules/Filtering/DistanceMap/include/itkSignedMaurerDistanceMapImageFilter.hxx Modules/Nonunit/Review/include/itkMultiphaseDenseFiniteDifferenceImageFilter.hxx