Skip to content

Performance: get_surface_distance should use a KDTree for euclidian distance on CPU #8909

Description

@jberg5

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions