We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Can we add anti aliasing to zoom and zoom_to_shape? Zooming to coarse resolution results in interpolation artifcats:
zoom
zoom_to_shape
from amid import AMOS from einops import reduce dataset = AMOS() i = dataset.ids[0] image = dataset.image(i) spacing = dataset.spacing(i) print(image.shape, spacing) # (768, 768, 90) [0.5703125 0.5703125 5.] target_spacing = np.array([5,5,5]) def plot_projections(zi): front = reduce(zoomed_image, 'w d h -> h w', reduction='max') side = reduce(zoomed_image, 'w d h -> h d', reduction='max') top = reduce(zoomed_image, 'w d h -> w d', reduction='max') fig, axs = plt.subplots(1, 3, figsize=(15,5)) axs[0].imshow(front[::-1], cmap='gray') axs[1].imshow(side[::-1], cmap='gray') axs[2].imshow(top, cmap='gray'); from imops import zoom image_imops = zoom(image, scale_factor=spacing/target_spacing, order=0) plot_projections(image_imops)
This is a known problem, and is typically solved with anti aliasing:
from skimage.transform import rescale image_skimage = rescale(image, scale=spacing/target_spacing, order=1, anti_aliasing=True) plot_projections(image_skimage)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Can we add anti aliasing to
zoom
andzoom_to_shape
? Zooming to coarse resolution results in interpolation artifcats:This is a known problem, and is typically solved with anti aliasing:
The text was updated successfully, but these errors were encountered: