Skip to content

Conversation

jxchen01
Copy link

@jxchen01 jxchen01 commented Mar 29, 2022

Fixes #570.

Description
adapt CropOrPad function into a new RandomCropOrPad function, so that the source subject can be randomly cropped or padded into the target shape.

Checklist

  • I have read the CONTRIBUTING docs and have a developer setup (especially important are pre-commitand pytest)
  • Non-breaking change (would not break existing functionality)
  • Breaking change (would cause existing functionality to change)
  • Tests added or modified to cover the changes
  • Integration tests passed locally by running pytest
  • In-line docstrings updated
  • Documentation updated, tested running make html inside the docs/ folder
  • This pull request is ready to be reviewed
  • If the PR is ready and there are multiple commits, I have squashed them and force-pushed

@jxchen01 jxchen01 marked this pull request as draft March 29, 2022 08:22
@jxchen01
Copy link
Author

WIP, will add unit test shortly

fix importing errors

move random crop or pad from preprocessing to augmentation and add unit test
@jxchen01 jxchen01 force-pushed the 570-feature-random-crop branch from cba0207 to fc75672 Compare March 29, 2022 11:50
@jxchen01 jxchen01 marked this pull request as ready for review March 29, 2022 11:51
@codecov
Copy link

codecov bot commented Apr 1, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
torchio/transforms/__init__.py 100.00% <100.00%> (ø)
...orchio/transforms/augmentation/spatial/__init__.py 100.00% <100.00%> (ø)
...nsforms/augmentation/spatial/random_crop_or_pad.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fepegar fepegar changed the title add random crop or pad Add random crop or pad May 15, 2022
@fepegar fepegar marked this pull request as draft May 15, 2022 23:23
@fepegar
Copy link
Member

fepegar commented Mar 4, 2023

Thanks, @jxchen01. Are you planning to work on this?

@fepegar fepegar mentioned this pull request Jun 4, 2023
@fepegar
Copy link
Member

fepegar commented Jun 4, 2023

Closing this and #570 for inactivity. Feel free to reopen if you'd like to keep working on it!

@fepegar fepegar closed this Jun 4, 2023
@fepegar fepegar reopened this Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add random crop transform

2 participants