Cucim support for `get_mask_edges` and `get_surface_distance` by john-zielke-snkeos · Pull Request #7008 · Project-MONAI/MONAI · GitHub
Skip to content

Cucim support for get_mask_edges and get_surface_distance#7008

Merged
wyli merged 13 commits into
Project-MONAI:devfrom
john-zielke-snkeos:cucim_surface_distance_support
Oct 1, 2023
Merged

Cucim support for get_mask_edges and get_surface_distance#7008
wyli merged 13 commits into
Project-MONAI:devfrom
john-zielke-snkeos:cucim_surface_distance_support

Conversation

@john-zielke-snkeos

Copy link
Copy Markdown
Contributor

Description

Add support for cucim for get_mask_edges and get_surface_distance. This provides significant speedup in surface related metrics. Profiling on my system gave 3-20x speedups depending on the input shape:
[---------------- (250, 250, 250) -----------------]
| cpu | cuda
1 threads: -----------------------------------------
random()>0.2 | 26400.8 | 1306.3
random()>0.5 | 26411.8 | 1399.1
random()>0.8 | 29993.2 | 1009.5
create_spherical_seg_3d | 623.8 | 45.0

Times are in milliseconds (ms).

[--------------- (100, 100, 100) ----------------]
| cpu | cuda
1 threads: ---------------------------------------
random()>0.2 | 1332.5 | 140.2
random()>0.5 | 1276.3 | 128.1
random()>0.8 | 1179.2 | 89.1
create_spherical_seg_3d | 111.7 | 44.0

Times are in milliseconds (ms).

[---------------- (50, 50, 50) ----------------]
| cpu | cuda
1 threads: -------------------------------------
random()>0.2 | 154.5 | 47.4
random()>0.5 | 166.7 | 39.3
random()>0.8 | 165.0 | 38.0
create_spherical_seg_3d | 77.2 | 44.4

Times are in milliseconds (ms).

where create_spherical_seg_3d uses the same function from test_hausdorff_distance, and binarizes random array using random(shape)>ratio.

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

Signed-off-by: John Zielke <john.zielke@snkeos.com>
@john-zielke-snkeos

Copy link
Copy Markdown
Contributor Author

Signed-off-by: John Zielke <john.zielke@snkeos.com>
Signed-off-by: John Zielke <john.zielke@snkeos.com>
Signed-off-by: John Zielke <john.zielke@snkeos.com>
Signed-off-by: John Zielke <john.zielke@snkeos.com>
Signed-off-by: John Zielke <john.zielke@snkeos.com>
Signed-off-by: John Zielke <john.zielke@snkeos.com>
@john-zielke-snkeos john-zielke-snkeos marked this pull request as ready for review September 29, 2023 15:30
@wyli

wyli commented Sep 30, 2023

Copy link
Copy Markdown
Contributor

/build

@wyli

wyli commented Oct 1, 2023

Copy link
Copy Markdown
Contributor

/build

@wyli

wyli commented Oct 1, 2023

Copy link
Copy Markdown
Contributor

@wyli wyli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it looks good to me.

@wyli wyli merged commit f140e06 into Project-MONAI:dev Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants