Hi,
I am trying to compute a distance map on a binary 3d shape, using ApproximateSignedDistanceMapImageFilter.
I tried the following code
def get_radius_map(mask):
dist_filter = sitk.ApproximateSignedDistanceMapImageFilter()
#dist_filter.SetDebug(True)
dist_filter.SetInsideValue(1.0)
dist_filter.SetOutsideValue(0.0)
img = sitk.Cast(GetImageFromArray(mask), sitk.sitkFloat64)
dist_map_shape = dist_filter.Execute(img)
return GetArrayFromImage(dist_map_shape)
The mask object I pass is a float 64 numpy array of dimension 3, with only 0s and 1s.
I tried to cast into various types, but regardless it will throw the following error (with a different failing pixel type):
RuntimeError: Exception thrown in SimpleITK ApproximateSignedDistanceMapImageFilter_Execute: /tmp/SimpleITK/Code/Common/include/sitkMemberFunctionFactory.hxx:155:
sitk::ERROR: Pixel type: 64-bit float is not supported in 3D by N3itk6simple39ApproximateSignedDistanceMapImageFilterE
I apologize if there is an obvious misuse of the filter, I struggle to find example in python code for this
Thank you in advance !