In [1]:
import tigre
import numpy as np
geo = tigre.geometry(mode='cone',default=True,high_quality=False)
print(geo)
In [2]:
from tigre.demos.Test_data import data_loader
angles = np.linspace(0,2*np.pi,100)
head = data_loader.load_head_phantom(geo.nVoxel)
proj = tigre.Ax(head,geo,angles)
In [3]:
import tigre.algorithms as algs
imgCGLS = algs.cgls(proj,geo,angles,niter=20)
imgOSSART = algs.ossart(proj,geo,angles,niter=20)
In [4]:
# Of utmost importance to FISTA is the convergence constant, defined as the lipschitz
# constant of the linear system Ax. In the algorithm it can be passed as the key word
# 'hyper'
# :keyword hyper: (np.float64)
# hyper parameter proportional to the largest eigenvalue of the
# matrix A in the equations Ax-b and ATb.
# Empirical tests show, for the headphantom object:
# nVoxel = np.array([64,64,64]), hyper (approx=) 2.e6
# nVoxel = np.array([512,512,512]), hyper (approx=) 2.e4
# from tigre.utilities.power_method import svd_power_method
imgFISTA = algs.fista(proj,geo,angles,niter=75,hyper = 2.e6)
# tweeking the tv parameters for the algorithm
imgFISTA_hightv = algs.fista(proj,geo,angles,niter=75,hyper=2.e6,tviter=100,tvlambda=10)
In [5]:
tigre.plotimg(np.hstack((imgCGLS,imgOSSART)),slice=32)
Out[5]:
In [6]:
tigre.plotimg(np.hstack((imgFISTA,imgFISTA_hightv)),slice=32)
Out[6]:
In [ ]: