Skip to content

Add antialiasing option for downsampling #1314

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fepegar
Copy link
Member

@fepegar fepegar commented Jun 18, 2025

Related to #48.

Description

import torchio as tio

image = tio.datasets.Colin27().t1
image.plot()

factor = 8
downsampled_old = tio.Resample(factor, antialias=False)(image)
downsampled_old.plot()
downsampled_new = tio.Resample(factor, antialias=True)(image)
downsampled_new.plot()

image
image
image

Note e.g. the ventricles and basal ganglia in the sagittal view.

One more example with a test image. Note aliasing is smaller when enabling the new setting.

image
image
image

Checklist

  • I have read the CONTRIBUTING docs and have a developer setup ready
  • Changes are
    • Non-breaking (would not break existing functionality)
    • Breaking (would cause existing functionality to change)
  • Tests added or modified to cover the changes
  • In-line docstrings updated
  • Documentation updated
  • This pull request is ready to be reviewed

@fepegar
Copy link
Member Author

fepegar commented Jun 18, 2025

@romainVala, could you please take a look?

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