In this demo the usage of the kylov subsapce family is explaines. This family of algorithms iterate through the eigenvectors of the residual (Ax-b) of the problems in descending order, achieving increased convergence rates as compared to the SART family.
In cases where the data is good quality, SART type families tend to reach a better image, but when the data gets very big, or has bad qualily, CGLS is a good and fast algorithm.
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)
projections = tigre.Ax(head,geo,angles,'interpolated')
In [3]:
# CGLS has the common 4 inputs for iterative algorithms in TIGRE:
#
# Projections, geometry, angles, and number of iterations
#
# Additionally it contains optional initialization tehcniques, but we
# reccomend not using them. CGLS is already quite fast and using them may
# lead to divergence.
# The options are:
# 'Init' Describes diferent initialization techniques.
# � 'none' : Initializes the image to zeros (default)
# � 'FDK' : intializes image to FDK reconstrucition
import tigre.algorithms as algs
imgCGLS = algs.cgls(projections,geo,angles,niter=20)
imgSIRT = algs.sirt(projections,geo,angles,niter=20)
In [15]:
output = np.hstack((imgCGLS,imgSIRT))
tigre.plotimg(output,slice=32)
Out[15]:
In [19]:
error = np.hstack((abs(imgCGLS-head), abs(imgSIRT-head)))
tigre.plotimg(error,slice=32)
Out[19]:
In [ ]: