From b5e107f96f296402fb4c71f4c9d57f048861a446 Mon Sep 17 00:00:00 2001 From: Joshua Gray <61458311+jgray-19@users.noreply.github.com> Date: Wed, 24 Jan 2024 14:38:52 +0100 Subject: [PATCH] Change default ray energy to 100 KeV --- src/ray.m | 2 +- tests/ray_tests.m | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ray.m b/src/ray.m index f0c5425..f8ede3b 100644 --- a/src/ray.m +++ b/src/ray.m @@ -40,7 +40,7 @@ obj.dist_to_detector = dist_to_detector; obj.end_point = start_point + direction .* dist_to_detector; - obj.energy = 10; %KeV + obj.energy = 100; %KeV end function [lengths, indices] = get_intersections(self, voxels) diff --git a/tests/ray_tests.m b/tests/ray_tests.m index 38c4950..b7cfe23 100644 --- a/tests/ray_tests.m +++ b/tests/ray_tests.m @@ -70,13 +70,13 @@ function test_ray_init(tc) tc.assertEqual(r.start_point, [0;0;0]); tc.assertEqual(r.direction, [1;0;0]); tc.assertEqual(r.end_point, [10;0;0]); - tc.assertEqual(r.energy, 10); % default energy - may change later + tc.assertEqual(r.energy, 100); % default energy - may change later r2 = ray([0;-5;0], [0;1;0], 10); tc.assertEqual(r2.start_point, [0;-5;0]); tc.assertEqual(r2.direction, [0;1;0]); tc.assertEqual(r2.end_point, [0;5;0]); - tc.assertEqual(r2.energy, 10); % default energy - may change later + tc.assertEqual(r2.energy, 100); % default energy - may change later end function test_siddon_ray(tc) @@ -86,7 +86,7 @@ function test_siddon_ray(tc) function test_calculate_mu(tc) my_box = voxel_box([0;0;0], [3;3;3], @water); array = voxel_array(zeros(3, 1), [5; 5; 5], 1, my_box); - voxel_attenuation = water(10/1000); % Default value of ray + voxel_attenuation = water(100/1000); % Default value of ray r = ray([-6;0;0], [1;0;0], 12); tc.assertEqual(r.calculate_mu(array), 3*voxel_attenuation, "RelTol", 2e-16); @@ -110,14 +110,14 @@ function test_update_parameters(tc) tc.assertEqual(r.start_point, [1;0;0]); tc.assertEqual(r.direction, [0;1;0]); tc.assertEqual(r.end_point, [1;10;0]); - tc.assertEqual(r.energy, 10); % default energy - may change later + tc.assertEqual(r.energy, 100); % default energy - may change later r = ray([0;0;0], [1;0;0], 5); r = r.update_parameters([0;0;1], [0;0;1]); tc.assertEqual(r.start_point, [0;0;1]); tc.assertEqual(r.direction, [0;0;1]); tc.assertEqual(r.end_point, [0;0;6]); - tc.assertEqual(r.energy, 10); % default energy - may change later + tc.assertEqual(r.energy, 100); % default energy - may change later end function test_move_start_point(tc) @@ -126,14 +126,14 @@ function test_move_start_point(tc) tc.assertEqual(r.start_point, [1;0;0]); tc.assertEqual(r.direction, [1;0;0]); tc.assertEqual(r.end_point, [11;0;0]); - tc.assertEqual(r.energy, 10); % default energy - may change later + tc.assertEqual(r.energy, 100); % default energy - may change later r = ray([0;0;0], [1;0;0], 10); r = r.move_start_point([0;0;1]); tc.assertEqual(r.start_point, [0;0;1]); tc.assertEqual(r.direction, [1;0;0]); tc.assertEqual(r.end_point, [10;0;1]); - tc.assertEqual(r.energy, 10); % default energy - may change later + tc.assertEqual(r.energy, 100); % default energy - may change later end end end \ No newline at end of file