12345678910111213141516171819202122232425262728293031323334353637383940 |
- import sys
- sys.path.append("/afs/f9.ijs.si/home/studen/current_work/medfiz/funkcSlikanje/naloge")
- import Glinear as gl
- import setMask as sm
- import numpy as np
- import matplotlib.pyplot as plot
- import FBP
- import MLEM
- nx=12
- ny=12
- na=11
- nb=8
- mask=sm.set_mask(nx,ny,1)
- #matrix
- G=gl.sys_matrix(nx,ny,nb,na,mask)
- #image
- im=np.zeros([nx,ny])
- im[10,10]=1
- sino=G.dot(im.ravel()).reshape(na,nb)
- plot.imshow(sino,interpolation='none')
- #add measurement error
- sino1=scipy.ndimage.gaussian_filter(numpy.transpose(sino),[5,0.1])
- #rekonstruirana slika z filtrirano povratno projekcijo
- im1=FBP.FBP(G,sino,nx,na)
- im2=FBP.FBP(G,np.transpose(sino1),nx,na)
- #rekonstruirana slika z MLEM
- G1=np.transpose(G)
- imold=mask
- #ponavljaj dokler nisi zadovoljen
- im2=MLEM.MLEM(G, G1, sino, imold, nx, na, nb)
- imold=im2
|