A first reconstruction#

Reconstruct simulated data with FDK and OS-SART and compare the results.

Source: Python/demos/d04_SimpleReconstruction.py · MATLAB/Demos/d04_SimpleReconstruction.m

MATLAB version of this demo
%% Demo 4: Simple Image reconstruction
%
%
% This demo will show how a simple image reconstruction can be performed,
% by using OS-SART and FDK
%
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
% This file is part of the TIGRE Toolbox
% 
% Copyright (c) 2015, University of Bath and 
%                     CERN-European Organization for Nuclear Research
%                     All rights reserved.
%
% License:            Open Source under BSD. 
%                     See the full license at
%                     https://github.com/CERN/TIGRE/blob/master/LICENSE
%
% Contact:            tigre.toolbox@gmail.com
% Codes:              https://github.com/CERN/TIGRE/
% Coded by:           Ander Biguri 
%--------------------------------------------------------------------------
%% Initialize

clear;
close all;
%% Geometry
geo=defaultGeometry('nVoxel',[128;128;128]);                     

%% Load data and generate projections 
% define angles
angles=linspace(0,2*pi,100);
% Load thorax phantom data
head=headPhantom(geo.nVoxel);
% generate projections
projections=Ax(head,geo,angles,'interpolated');
% add noise
noise_projections=addCTnoise(projections);

%% Reconstruct image using OS-SART and FDK

% FDK
imgFDK=FDK(noise_projections,geo,angles);
% OS-SART

niter=50;
imgOSSART=OS_SART(noise_projections,geo,angles,niter);

% Show the results
plotImg([imgFDK,imgOSSART],'Dim','Z');

Initialize#

import tigre
import numpy as np
from tigre.utilities import sample_loader
from tigre.utilities import CTnoise
import tigre.algorithms as algs

Geometry#

geo = tigre.geometry_default(high_resolution=False)

Load data and generate projections#

# define angles
angles = np.linspace(0, 2 * np.pi, 100, endpoint=False)
# Load thorax phantom data
head = sample_loader.load_head_phantom(geo.nVoxel)
# generate projections
projections = tigre.Ax(head, geo, angles)
# add noise
noise_projections = CTnoise.add(projections, Poisson=1e5, Gaussian=np.array([0, 10]))

Reconstruct image using OS-SART and FDK#

# FDK
imgFDK = algs.fdk(noise_projections, geo, angles)
# OS-SART

niter = 50
imgOSSART = algs.ossart(noise_projections, geo, angles, niter)
OSSART algorithm in progress.
Estimated time until completion : 00:00:03
Algorithm will finish at        : 16:47:58

Show the results#

tigre.plotimg(np.concatenate([imgFDK, imgOSSART], axis=1), dim="z")
d04 SimpleReconstruction

Total running time of the script: (0 minutes 7.223 seconds)

Gallery generated by Sphinx-Gallery