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

Fix visualization for subject with many images #653

Merged
merged 1 commit into from
Sep 5, 2021

Conversation

fepegar
Copy link
Owner

@fepegar fepegar commented Sep 5, 2021

As reported by @cepa995 in #652.

Description
Axis sharing was hard-coded to use columns, but rows are desired for subject with many images (>2):

import torchio as tio
dataset = tio.datasets.RSNAMICCAI('root')
subject = dataset[0]  # it's subject 00792
transform = tio.Compose([
                tio.ToCanonical(),
                tio.Resample("T2w"),
                tio.RescaleIntensity((-1, 1)),
                tio.OneHot(),
            ])
transform(subject).plot()

Before:

Figure_0

After:

Figure_1

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 Sep 5, 2021

Codecov Report

Merging #653 (62cc8cb) into master (99e6cfe) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #653   +/-   ##
=======================================
  Coverage   96.82%   96.82%           
=======================================
  Files         128      128           
  Lines        6646     6646           
=======================================
  Hits         6435     6435           
  Misses        211      211           
Impacted Files Coverage Δ
torchio/visualization.py 94.82% <100.00%> (ø)

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 99e6cfe...62cc8cb. Read the comment docs.

@fepegar fepegar merged commit 52d4d3f into master Sep 5, 2021
@fepegar fepegar deleted the 652-fix-visualization branch September 5, 2021 10:13
@fepegar
Copy link
Owner Author

fepegar commented Sep 5, 2021

@all-contributors please add @cepa995 for bug

@allcontributors
Copy link
Contributor

@fepegar

I've put up a pull request to add @cepa995! 🎉

@fepegar fepegar restored the 652-fix-visualization branch July 4, 2022 22:00
@fepegar fepegar deleted the 652-fix-visualization branch July 4, 2022 22:03
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.

1 participant