Filtered backprojection

398 views Asked by At

I'm working on a school project with python and I have to reconstruct an image using filtered backprojection. I made the image using the following code:

image = np.zeros([100, 100])

t = np.linspace(-1, 1, image.shape[0])
xc, yc = np.meshgrid(t, t)

image[xc**2/0.3+yc**2/0.6 < 1] = 1
image[xc**2/0.2+yc**2/0.4 < 1] = 2
image[xc**2+(yc-0.2)**2 < 0.075] = 3
image[xc**2+(yc+0.3)**2 < 0.03] = 4

After that I created its sinogram, used fourier's transform and wanted to use Hann, Hamming and Butterworth filter to reduce noise, but I have encountered 2 issues:

  1. While defining the filters, should I stick their values in an array to multiply it by the projection like this?
nu = np.fft.fftfreq(P.shape[0], d=np.diff(rs)[0])


def filtre_hann(nu, f=10000):
    L = [0]*len(nu)
    for i in range(0, len(nu)):
        if -f <= nu[i] <= f:
            L[i] = 0.5 + 0.5*np.cos(np.pi*nu[i]/f)
    return np.array(L)
  1. I have no idea what the value of the cut off frequency is, I didn't find any order of magnitude so I can't obtain the final image. Thank you.
0

There are 0 answers