Tomography

$$ \newcommand{\eg}{{\it e.g.}} \newcommand{\ie}{{\it i.e.}} \newcommand{\argmin}{\operatornamewithlimits{argmin}} \newcommand{\mc}{\mathcal} \newcommand{\mb}{\mathbb} \newcommand{\mf}{\mathbf} \newcommand{\minimize}{{\text{minimize}}} \newcommand{\diag}{{\text{diag}}} \newcommand{\cond}{{\text{cond}}} \newcommand{\rank}{{\text{rank }}} \newcommand{\range}{{\mathcal{R}}} \newcommand{\null}{{\mathcal{N}}} \newcommand{\tr}{{\text{trace}}} \newcommand{\dom}{{\text{dom}}} \newcommand{\dist}{{\text{dist}}} \newcommand{\R}{\mathbf{R}} \newcommand{\SM}{\mathbf{S}} \newcommand{\ball}{\mathcal{B}} \newcommand{\bmat}[1]{\begin{bmatrix}#1\end{bmatrix}} $$

EE787: Machine learning, Kyung Hee University.
Jong-Han Kim (jonghank@khu.ac.kr)

In [15]:
using HTTP, JSON, PyPlot;
using LinearAlgebra, SparseArrays;

include("line_pixel_length.jl");

resp = HTTP.get("https://jonghank.github.io/ee787/files/tomodata_fullysampled.json");
#resp = HTTP.get("https://jonghank.github.io/ee787/files/tomodata_undersampled.json");

str = String(resp.body);
jobj = JSON.Parser.parse(str);

N = jobj["N"]["data"];
n_pixels = jobj["n_pixels"]["data"];
y = Float64.(jobj["y"]["data"]);
lines_d = Float64.(jobj["lines_d"]["data"]);
lines_theta = Float64.(jobj["lines_theta"]["data"]);

println(N)
println(n_pixels)
println(size(y))
println(size(lines_d))
println(size(lines_theta))
5184
60
(5184,)
(5184,)
(5184,)
In [17]:
# Dx and Dy for computing total variation function
m = n_pixels;
n = n_pixels;
Dx = [spzeros(m*(n-1),m) I] - [I spzeros(m*(n-1),m)];
Dy = kron(sparse(1I, n, n), diff(sparse(1I, m, m),dims=1));
D = [Dx; Dy];

The rest is for you...

In [ ]:
# your code here