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))
# 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...
# your code here