-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨🔨 add distance transform #57
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## main #57 +/- ##
==========================================
+ Coverage 53.90% 55.27% +1.36%
==========================================
Files 20 22 +2
Lines 1228 1328 +100
Branches 218 237 +19
==========================================
+ Hits 662 734 +72
- Misses 530 545 +15
- Partials 36 49 +13
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. Thank you for this. Will try to use it as soon as the cross-validation with the new bone masks is done~~
What do these changes do?
DistanceTransform
transform to compute (boundary) distance. The boundary distance can be used to compute a boundary/distance loss.The boundary loss currently integrates (sum) over boundary deviation (XOR(A_gt, A_pred)), see b):
While the pre-computation is on the CPU (using
scipy.ndimage.distance_transform_cdt
), the loss is evaluated using simple operations usingtorch.Tensor
s.Related issue/s
How to test
The distance transform is tested in
tests/transforms/test_distance.py
.The boundary loss should be tested
Checklist
pytest tests