Skip to content
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

Make the grid sampler compatible with the queue #520

Merged
merged 2 commits into from May 10, 2021

Conversation

fepegar
Copy link
Owner

@fepegar fepegar commented May 6, 2021

Resolves #513.
Related to #505, #494.

Description
This PR makes the grid sampler behave like the other samplers, so that it can be used with the queue as requested by some users (@sarthakpati, @MFaizyabAli).

The new API is not very clean, but it allows for backward compatibility with the tutorials for dense inference using the aggregator.

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

@codecov
Copy link

codecov bot commented May 6, 2021

Codecov Report

Merging #520 (c3c0ed0) into master (68ffea7) will increase coverage by 0.03%.
The diff coverage is 83.58%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #520      +/-   ##
==========================================
+ Coverage   90.44%   90.47%   +0.03%     
==========================================
  Files         132      132              
  Lines        6646     6669      +23     
==========================================
+ Hits         6011     6034      +23     
  Misses        635      635              
Impacted Files Coverage Δ
torchio/data/sampler/grid.py 88.60% <75.67%> (ø)
torchio/data/sampler/sampler.py 95.65% <84.61%> (-4.35%) ⬇️
tests/data/inference/test_grid_sampler.py 100.00% <100.00%> (ø)
torchio/data/__init__.py 100.00% <100.00%> (ø)
torchio/data/inference/__init__.py 100.00% <100.00%> (ø)
torchio/data/inference/aggregator.py 97.72% <100.00%> (ø)
torchio/data/sampler/__init__.py 100.00% <100.00%> (ø)
torchio/data/sampler/uniform.py 94.11% <100.00%> (+7.75%) ⬆️
torchio/data/sampler/weighted.py 92.04% <100.00%> (+1.82%) ⬆️
torchio/utils.py 91.30% <0.00%> (+0.62%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 68ffea7...c3c0ed0. Read the comment docs.

@fepegar fepegar merged commit 7d9f03b into master May 10, 2021
@fepegar fepegar deleted the 513-generalize-grid-sampler branch May 10, 2021 09:10
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.

Grid Sampler for Training
1 participant