-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add 3D semantic segmentation code example #2099
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
base: master
Are you sure you want to change the base?
Conversation
@mattdangerw |
@mattdangerw |
@mattdangerw |
/gemini review |
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.
Code Review
The code changes introduce a 3D semantic segmentation pipeline for medical imaging, specifically brain tumor segmentation using the BraTS dataset. The code is well-structured, but there are opportunities to improve maintainability, clarity, and correctness through refactoring repetitive code blocks, clarifying visualization logic, and simplifying computations.
prediction[segment[..., 1] == 1] = 2 | ||
prediction[segment[..., 0] == 1] = 1 | ||
prediction[segment[..., 2] == 1] = 4 |
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.
The logic to reconstruct the single-channel prediction map relies on a specific order of assignments to handle overlapping regions. While the current order is correct, the code would be more self-documenting and easier to maintain if you add a comment explaining why this order is important.
prediction[segment[..., 1] == 1] = 2 # Whole Tumor (WT)
prediction[segment[..., 0] == 1] = 1 # Tumor Core (TC)
prediction[segment[..., 2] == 1] = 4 # Enhancing Tumor (ET)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@divyashreepathihalli |
#2092