This demo will demonstrate the options for plotting projections and images on TIGRE. The functions have been in previous demos, but in here an exaustive explanation and usage of them is given.
In [1]:
import tigre
geo=tigre.geometry_default(high_quality=False)
In [2]:
import numpy as np
from tigre.utilities.Ax import Ax
from Test_data import data_loader
# define angles
angles=np.linspace(0,2*np.pi,dtype=np.float32)
# load head phantom data
head=data_loader.load_head_phantom(number_of_voxels=geo.nVoxel)
# generate projections
projections=Ax(head,geo,angles,'interpolated')
In [3]:
import tigre.algorithms as algs
from tigre.utilities.plotImg import plotImg
# OS_SART
niter=50
imgOSSART=algs.ossart(projections,geo,angles,niter)
# FDK
imgfdk=algs.fdk(projections,geo,angles)
In [4]:
# plotproj plots the projection measured on the detector on each angle.
from tigre.utilities.plotproj import plotproj
plotproj(projections)
# another useful function is ppslice, which returns the projection at a single angle.
# Default is at projections[len(angles)/2]
from tigre.utilities.plotproj import ppslice
ppslice(projections,slice=35)
In [6]:
# plotImg plots the final reconstruction of the 3D array. Dim defaults to z, but can be
# changed accordingly
from tigre.utilities.plotImg import plotImg
# For more info on what parameters to use, type:
help(plotImg)
plotImg(np.hstack((imgOSSART,imgfdk)),slice=32)
Out[6]:
In [ ]: