|
dis = monai_distance_transform_edt((~seg_gt)[None, ...], sampling=spacing)[0] # type: ignore |
Currently it does a full euclidian distance transform which computes all the distances between all of the points. On a GPU this is an embarrassingly parallel computation, but on a CPU we can get significant speedups from using a KDTree to just compute the distances to the nearest edge voxel.
I'll raise a PR - just creating this issue for tracking purposes.
MONAI/monai/metrics/utils.py
Line 294 in eccefc5
Currently it does a full euclidian distance transform which computes all the distances between all of the points. On a GPU this is an embarrassingly parallel computation, but on a CPU we can get significant speedups from using a KDTree to just compute the distances to the nearest edge voxel.
I'll raise a PR - just creating this issue for tracking purposes.