Closed liuxxxxxx closed 2 years ago
Which angles are you using?
Which angles are you using?
Sorry. It's
angles = np.linspace(0, 2*np.pi, 180)
Can you please share the original image and the FPB reconstruction?
Can you please share the original image and the FPB reconstruction?
Can you please share the original image and the FPB reconstruction?
Here is the test code:
import torch
import imageio
import numpy as np
from torch_radon import RadonFanbeam
img = imageio.imread('original.png') / 65535.
angles = np.linspace(0, 2*np.pi, 180)
radon = RadonFanbeam(512, angles, 512, 512, det_count=739, det_spacing=1.0, clip_to_circle=False)
img = torch.FloatTensor(img).to(torch.device('cuda')).unsqueeze(0).unsqueeze(0)
p = radon.forward(img)
recon = radon.backprojection(radon.filter_sinogram(p))
imageio.imwrite('recon_fbpfan.png', (recon.cpu().squeeze(0).squeeze(0).numpy()*65535).astype(np.uint16))
I see. With your det_count and spacing the areas of the image "outside of the circle" appear only in a few projections and therefore cannot be reconstructed. To solve this issue you can increase the det_count (or spacing) so that det_count*spacing is large enough (I think that >= 1024 should be enough)
I see. With your det_count and spacing the areas of the image "outside of the circle" appear only in a few projections and therefore cannot be reconstructed. To solve this issue you can increase the det_count (or spacing) so that det_count*spacing is large enough (I think that >= 1024 should be enough)
I increase the value of det_count and it worked! Thank you so much!
I did projection, filtering, and backprojection to a 2D 512×512 image but the reconstruction image is far more different from the original image. Here is the main codes:
What's the right way to conduct FBP with fan beam geometry?Thanks a lot.