You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should expose the lower level, currently private _rescale_rfft_2d/3d functions
docs will be required for people to use this well - example below can serve as a template
proposed API:
import torch
import torch.fft
from torch_fourier_rescale import fourier_rescale_rfft_3d
from my_package import reweight
volume = torch.rand((32, 32, 32))
# fftshift so that origin of phases in DFT is in the center of the image
# this maintains the center of the image at the position of DC component pre/post rescaling
volume = torch.fft.fftshift(volume, dim=(-3, -2, -1))
dft = torch.fft.rfftn(image, dim=(-3, -2, -1))
dft = torch.fft.fftshift(dft, dim=(-3, -2))
# do the reweighting
dft = reweight(dft)
dft = rescale_rfft_3d(dft)
# transform back to real space and recenter
dft = torch.fft.ifftshift(dft, dim=(-3, -2))
rescaled_volume = torch.fft.irfftn(dft, dim=(-3, -2, -1))
rescaled_volume = torch.fft.ifftshift(rescaled_image, dim=(-3, -2, -1))
The text was updated successfully, but these errors were encountered:
over at teamtomo/membrain-seg#76 @LorenzLamm and @JoelVO like torch-fourier-rescale but wants to reweight frequencies prior to fourier pad/crop
We should expose the lower level, currently private
_rescale_rfft_2d/3d
functionsdocs will be required for people to use this well - example below can serve as a template
proposed API:
The text was updated successfully, but these errors were encountered: