Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
roflmaostc committed Feb 11, 2024
1 parent 00d8398 commit 8342ecc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ using ChainRulesTestUtils
using Zygote

@testset "RadonKA.jl" begin
@testset "Simple radon test" begin
x = zeros((6,6)); x[4,3] = 1
@test radon(x, [0, π / 2, π, (3 / 2) * π, 2π]) [0.0 0.0 0.0 0.0 0.0; 1.0 0.0 0.0 0.0 1.0; 0.0 1.0 0.0 1.0 0.0; 0.0 0.0 1.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0]
x = zeros((6,6)); x[4,4] = 1
@test radon(x, [0, π / 2, π, (3 / 2) * π, 2π]) [0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0; 1.0 1.0 1.0 1.0 1.0; 0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0]
x = zeros((6,6)); x[3,3] = 1
@test radon(x, [0, π / 2, π, (3 / 2) * π, 2π]) [0.0 0.0 0.0 0.0 0.0; 1.0 0.0 0.0 1.0 1.0; 0.0 0.0 0.0 0.0 0.0; 0.0 1.0 1.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0]

x = zeros((7,7)); x[4,4] = 1
@test radon(x, [0, π / 2, π, (3 / 2) * π, 2π]) [0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0; 1.0 1.0 1.0 1.0 1.0; 0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0]
x = zeros((7,7)); x[4,3] = 1
@test radon(x, [0, π / 2, π, (3 / 2) * π, 2π]) [0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0; 1.0 0.0 0.0 0.0 1.0; 0.0 1.0 0.0 1.0 0.0; 0.0 0.0 1.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0]
end

@testset "Simple backproject test" begin
sinogram = zeros(Float32, (9, 2, 1))
Expand Down

0 comments on commit 8342ecc

Please sign in to comment.