torchio icon indicating copy to clipboard operation
torchio copied to clipboard

Add support to pass a callable as padding mode

Open mueller-franzes opened this issue 3 years ago • 1 comments

Fixes #957.

Description It fixes the KeyError message when a function is passed as padding_mode in the Pad class.

Checklist

  • [x] I have read the CONTRIBUTING docs and have a developer setup (especially important are pre-commitand pytest)
  • [x] Non-breaking change (would not break existing functionality)
  • [ ] Breaking change (would cause existing functionality to change)
  • [x] Tests added or modified to cover the changes
  • [x] Integration tests passed locally by running pytest
  • [ ] In-line docstrings updated
  • [ ] Documentation updated, tested running make html inside the docs/ folder
  • [x] 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

mueller-franzes avatar Sep 11 '22 16:09 mueller-franzes

Codecov Report

Merging #959 (1539c1c) into main (6338270) will increase coverage by 0.03%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #959      +/-   ##
==========================================
+ Coverage   86.19%   86.22%   +0.03%     
==========================================
  Files          92       92              
  Lines        5801     5802       +1     
==========================================
+ Hits         5000     5003       +3     
+ Misses        801      799       -2     
Impacted Files Coverage Δ
...rc/torchio/transforms/preprocessing/spatial/pad.py 95.34% <100.00%> (+4.87%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Oct 09 '22 17:10 codecov[bot]

Thanks for your contribution, @mueller-franzes!

@all-contributors please add @mueller-franzes for code

fepegar avatar Nov 08 '22 23:11 fepegar

@fepegar

I couldn't determine any contributions to add, did you specify any contributions? Please make sure to use valid contribution names.

I've put up a pull request to add @mueller-franzes! :tada:

allcontributors[bot] avatar Nov 08 '22 23:11 allcontributors[bot]