-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
padding and cropping classes use MetaTensor #4371
padding and cropping classes use MetaTensor #4371
Conversation
Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Richard Brown <[email protected]>
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
/black |
Signed-off-by: monai-bot <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Richard Brown <[email protected]>
…_pad Signed-off-by: Richard Brown <[email protected]>
for more information, see https://pre-commit.ci
@wyli PR is getting very big as I'm doing all padding and cropping. Apologies for that, it's a hard one to split. |
Signed-off-by: Richard Brown <[email protected]>
@wyli Could you create unit tests for the Equally we would want to check that the affine isn't modified when we don't crop/pad from the origin. |
sure let me add some basic tests to this PR now... |
Signed-off-by: Richard Brown <[email protected]>
adds meta tests pad/crop Signed-off-by: Wenqi Li <[email protected]>
for more information, see https://pre-commit.ci
Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
for more information, see https://pre-commit.ci
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
for more information, see https://pre-commit.ci
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
cropping with multiple random samples (basic from monai.transforms import EnsureChannelFirst, LoadImage, RandSpatialCropSamples, SaveImage
filename = "~/Downloads/avg152T1_LR_nifti.nii.gz"
img = LoadImage()(filename)
img = EnsureChannelFirst()(img)
img = RandSpatialCropSamples(roi_size=(40, 50, 60), random_size=False, num_samples=3)(img)
for i in img:
SaveImage(resample=False)(i) |
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.
merging this for now as the basic functionality works nicely, but it will need another discussion/refactoring for the design of modules such as the PadBase
class
MONAI/monai/transforms/croppad/array.py
Line 80 in 6c56810
class PadBase(InvertibleTransform): |
Description
Pad transforms use MetaTensor to allow inverse.
also fixes #4435
Status
Ready
Types of changes
TODO