|
@@ -2,14 +2,15 @@ import numpy as np
|
|
|
|
|
|
def MLEM(G, G1, sino, imold, nx, na, nb, R=None, beta=1e-3):
|
|
|
sino1=G.dot(imold.ravel()).reshape(na,nb)
|
|
|
- sino /= sino1
|
|
|
+ sino2=sino.copy()
|
|
|
+ sino2 /= sino1
|
|
|
#G1=np.transpose(G)
|
|
|
#im1=G1.dot(sino.ravel()).reshape(nx,nx)
|
|
|
#add regularization
|
|
|
if R==None:
|
|
|
- im1=G1.dot(sino.ravel()).reshape(nx,nx)
|
|
|
+ im1=G1.dot(sino2.ravel()).reshape(nx,nx)
|
|
|
else:
|
|
|
- v0=G1.dot(sino.ravel())
|
|
|
+ v0=G1.dot(sino2.ravel())
|
|
|
v1=R.dot(imold.ravel())
|
|
|
v1=[1+beta*x for x in v1]
|
|
|
v1=v1.reshape(nx,nx)
|