-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Added mask3d #2200
Added mask3d #2200
Conversation
Reviewer's Guide by SourceryThis PR adds support for 3D data transformations by introducing new volume and mask3d targets, refactoring the Transform3D class, and updating all existing transforms to handle 3D data consistently. The implementation maintains backward compatibility while providing a cleaner API for working with volumetric data. Class diagram for updated Transform3D and DualTransform classesclassDiagram
class DualTransform {
+apply_to_images(images: np.ndarray, **params: Any) np.ndarray
+apply_to_mask(mask: np.ndarray, **params: Any) np.ndarray
+apply_to_masks(masks: np.ndarray, **params: Any) np.ndarray
+apply_to_volume(volume: np.ndarray, **params: Any) np.ndarray
+apply_to_volumes(volumes: np.ndarray, **params: Any) np.ndarray
+apply_to_mask3d(mask: np.ndarray, **params: Any) np.ndarray
+apply_to_masks3d(masks: np.ndarray, **params: Any) np.ndarray
}
class Transform3D {
+apply_to_volume(volume: np.ndarray, *args: Any, **params: Any) np.ndarray
+apply_to_volumes(volumes: np.ndarray, *args: Any, **params: Any) np.ndarray
+apply_to_mask3d(mask3d: np.ndarray, *args: Any, **params: Any) np.ndarray
+apply_to_masks3d(masks3d: np.ndarray, *args: Any, **params: Any) np.ndarray
}
DualTransform <|-- Transform3D
Class diagram for updated BasePad3D and BaseCropAndPad3D classesclassDiagram
class BasePad3D {
+apply_to_volume(volume: np.ndarray, padding: tuple[int, int, int, int, int, int], **params: Any) np.ndarray
+apply_to_mask3d(mask3d: np.ndarray, padding: tuple[int, int, int, int, int, int], **params: Any) np.ndarray
}
class BaseCropAndPad3D {
+apply_to_volume(volume: np.ndarray, crop_coords: tuple[int, int, int, int, int, int], pad_params: dict[str, int] | None, **params: Any) np.ndarray
+apply_to_mask3d(mask3d: np.ndarray, crop_coords: tuple[int, int, int, int, int, int], pad_params: dict[str, int] | None, **params: Any) np.ndarray
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @ternaus - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding migration guide documentation to help users transition from the old 'images'/'masks' API to the new 'volume'/'mask3d' API for 3D data
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2200 +/- ##
=========================================
+ Coverage 0 89.08% +89.08%
=========================================
Files 0 50 +50
Lines 0 8834 +8834
=========================================
+ Hits 0 7870 +7870
- Misses 0 964 +964 ☔ View full report in Codecov by Sentry. |
Summary by Sourcery
Add support for 3D masks and volumes in the transformation library, enabling operations on 3D data. Update the codebase to handle 3D data consistently alongside 2D data, and enhance documentation and tests to reflect these changes.
New Features:
Enhancements:
Documentation:
Tests: