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
Thank you for publishing this code! It is truly amazing.
After I solved the torch.rfft torch.irfft incompatibility (I want to believe successfully) using two wrapper functions (I post them below) I tried to run the visual_sample.py example but I got the following error
Traceback (most recent call last):
File "/home/user/torch-radon/examples/visual_sample.py", line 29, in <module>
backprojection = radon.backprojection(sinogram, extend=True)
File "/home/user/miniconda3/lib/python3.9/site-packages/torch_radon-1.0.0-py3.9-linux-x86_64.egg/torch_radon/utils.py", line 30, in wrapped
y = f(self, x, *args, **kwargs)
TypeError: backprojection() got an unexpected keyword argument 'extend'
Should I just delete the 'extend' argument?
The wrapper functions I used to solve the torch.rfft and torch.irfft incompatibility:
def rfft_wrapper(input, signal_ndim, normalized=False):
if signal_ndim < 1 or signal_ndim > 3:
print("Signal ndim out of range, was", signal_ndim, "but expected a value between 1 and 3, inclusive")
return
dims = (-1)
if signal_ndim == 2:
dims = (-2, -1)
if signal_ndim == 3:
dims = (-3, -2, -1)
norm = "backward"
if normalized:
norm = "ortho"
return torch.view_as_real(torch.fft.fftn(input, dim=dims, norm=norm))
def irfft_wrapper(input, signal_ndim, normalized=False):
if signal_ndim < 1 or signal_ndim > 3:
print("Signal ndim out of range, was", signal_ndim, "but expected a value between 1 and 3, inclusive")
return
dims = (-1)
if signal_ndim == 2:
dims = (-2, -1)
if signal_ndim == 3:
dims = (-3, -2, -1)
norm = "backward"
if normalized:
norm = "ortho"
return torch.view_as_real(torch.fft.ifftn(input, dim=dims, norm=norm))
The text was updated successfully, but these errors were encountered:
Hi
Thank you for publishing this code! It is truly amazing.
After I solved the torch.rfft torch.irfft incompatibility (I want to believe successfully) using two wrapper functions (I post them below) I tried to run the visual_sample.py example but I got the following error
Should I just delete the 'extend' argument?
The wrapper functions I used to solve the torch.rfft and torch.irfft incompatibility:
The text was updated successfully, but these errors were encountered: