Skip to content

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

@jberg5

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions