-
-
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
Add pad #2197
Conversation
Reviewer's Guide by SourceryThis PR introduces a new Class diagram for the new Pad3D and BasePad3D classesclassDiagram
class Transform3D {
<<abstract>>
}
class BasePad3D {
fill: ColorType
fill_mask: ColorType
apply_to_images(images: np.ndarray, padding: tuple[int, int, int, int, int, int], **params: Any) np.ndarray
apply_to_masks(masks: np.ndarray, padding: tuple[int, int, int, int, int, int], **params: Any) np.ndarray
}
class Pad3D {
padding: int | tuple[int, int, int] | tuple[int, int, int, int, int, int]
fill: ColorType
fill_mask: ColorType
get_params_dependent_on_data(params: dict[str, Any], data: dict[str, Any]) dict[str, Any]
get_transform_init_args_names() tuple[str, ...]
}
class PadIfNeeded3D {
min_zyx: tuple[int, int, int] | None
pad_divisor_zyx: tuple[int, int, int] | None
position: Literal["center", "random"]
}
Transform3D <|-- BasePad3D
BasePad3D <|-- Pad3D
BasePad3D <|-- PadIfNeeded3D
note for BasePad3D "Base class for 3D padding transforms"
Class diagram for InitSchema changesclassDiagram
class InitSchema {
fill: ColorType
fill_mask: ColorType
pad_mode: BorderModeType | None
pad_cval: ColorType | None
pad_cval_mask: ColorType | None
validate_dimensions() Self
validate_coordinates() Self
validate_fill_types() Self
validate_value() Self
}
class BasePad3DInitSchema {
fill: ColorType
fill_mask: ColorType
}
InitSchema <|-- BasePad3DInitSchema
note for InitSchema "Handles validation and deprecation warnings"
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 and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟡 Testing: 2 issues 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 #2197 +/- ##
=========================================
+ Coverage 0 89.27% +89.27%
=========================================
Files 0 50 +50
Lines 0 8644 +8644
=========================================
+ Hits 0 7717 +7717
- Misses 0 927 +927 ☔ View full report in Codecov by Sentry. |
Summary by Sourcery
Add a new Pad3D class for padding 3D volumes, refactor existing padding logic into a BasePad3D class, and update tests and documentation accordingly. Deprecate old padding parameters with warnings for backward compatibility.
New Features:
Enhancements:
Documentation:
Tests:
Chores: