-
Notifications
You must be signed in to change notification settings - Fork 2
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
Variable names #10
Variable names #10
Conversation
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.
Looks good to me. I'm wondering if we could change the function name from intersection_over_union_matrix
to something like iou_matrix
? It's just a personal preference for short function names, but not a must.
How about a |
Pass method
Sounds good to me, but I think I'll do this in a separate PR to Regarding the new test function: def test_match_labels2():
labels_x = np.asarray([1, 1, 1, 0, 0, 2, 2, 4, 4, 4, 0], dtype=np.uint8)
labels_y = np.asarray([1, 1, 2, 0, 0, 3, 3, 4, 4, 4, 5], dtype=np.uint8)
reference_y_matched = np.asarray([1, 1, 1, 0, 0, 2, 2, 4, 4, 4, 5], dtype=np.uint8)
labels_y_matched = biau.label.match_labels(labels_x, labels_y)
assert np.array_equal(reference_y_matched, labels_y_matched) I think we should discuss our preferred format. Right now, The original behavior from the cellpose repository is a little different: The IoU matrix is not binarized, it is only thresholded in a sense that entries in the IoU matrix smaller than x are set to zero: IoU[IoU< threshold] = 0.0 # suppress small overlaps
IoU[IoU< IoU.max(axis=0)] = 0.0 # suppress non-maximum overlaps Other entries are unaffected from this so that only labels with the largest overlap will be merged. The difference is very subtle but can lead to very different results, as the above test shows. In the case of a binary IoU matrix the correct result is this: reference_y_matched = np.asarray([1, 1, 1, 0, 0, 2, 2, 4, 4, 4, 5], dtype=np.uint8) In the case of a maximal IoU approach with suppressed entries, the correct result is this: reference_y_matched = np.asarray([1, 1, 6, 0, 0, 2, 2, 4, 4, 4, 5], dtype=np.uint8) |
Oh yes, good point! Actually, we should have discssed that in #14 |
I will try do undo the merge of #14 in the meantime... |
Ok @jo-mueller , please check this PR again. It now only contains variable name changes. Looking foward to hear what you think! |
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.
Looks good to me, feel free to merge 👍
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.
Small hold-up: Removing #14 from this also reverted the location of the tests to /label/tests/... instead of tests/...
I'll fix this
You can also merge this PR as you're assigned for this anyway. Thanks! 🙏 |
Description
Hi Johannes @jo-mueller ,
I just changed the variable names as I suggested earlier in #2. Could you please find out how you can rename variables in a way in your IDE avoiding that parameters have different names in the parameter list of a function compared to the documentation of the function? In pycharm this works using Shift+F6:
Type of change
References
Tests
Final checks