22import numpy as np
33from httomolibgpu .prep .normalize import normalize as normalize_cupy
44from httomolibgpu .recon .algorithm import (
5- FBP ,
6- LPRec ,
7- SIRT ,
8- CGLS ,
5+ FBP3d_tomobar ,
6+ LPRec3d_tomobar ,
7+ SIRT3d_tomobar ,
8+ CGLS3d_tomobar ,
99)
1010from numpy .testing import assert_allclose
1111import time
1212import pytest
1313from cupy .cuda import nvtx
1414
1515
16- def test_reconstruct_FBP_1 (data , flats , darks , ensure_clean_memory ):
17- recon_data = FBP (
16+ def test_reconstruct_FBP3d_tomobar_1 (data , flats , darks , ensure_clean_memory ):
17+ recon_data = FBP3d_tomobar (
1818 normalize_cupy (data , flats , darks , cutoff = 10 , minus_log = True ),
1919 np .linspace (0.0 * np .pi / 180.0 , 180.0 * np .pi / 180.0 , data .shape [0 ]),
2020 79.5 ,
@@ -31,8 +31,8 @@ def test_reconstruct_FBP_1(data, flats, darks, ensure_clean_memory):
3131 assert recon_data .shape == (160 , 128 , 160 )
3232
3333
34- def test_reconstruct_FBP_1_neglog (data , flats , darks , ensure_clean_memory ):
35- recon_data = FBP (
34+ def test_reconstruct_FBP3d_tomobar_1_neglog (data , flats , darks , ensure_clean_memory ):
35+ recon_data = FBP3d_tomobar (
3636 normalize_cupy (data , flats , darks , cutoff = 10 , minus_log = False ),
3737 np .linspace (0.0 * np .pi / 180.0 , 180.0 * np .pi / 180.0 , data .shape [0 ]),
3838 79.5 ,
@@ -50,8 +50,8 @@ def test_reconstruct_FBP_1_neglog(data, flats, darks, ensure_clean_memory):
5050 assert recon_data .shape == (160 , 128 , 160 )
5151
5252
53- def test_reconstruct_FBP_2 (data , flats , darks , ensure_clean_memory ):
54- recon_data = FBP (
53+ def test_reconstruct_FBP3d_tomobar_2 (data , flats , darks , ensure_clean_memory ):
54+ recon_data = FBP3d_tomobar (
5555 normalize_cupy (data , flats , darks , cutoff = 20.5 , minus_log = False ),
5656 np .linspace (5.0 * np .pi / 360.0 , 180.0 * np .pi / 360.0 , data .shape [0 ]),
5757 15.5 ,
@@ -68,8 +68,8 @@ def test_reconstruct_FBP_2(data, flats, darks, ensure_clean_memory):
6868 assert recon_data .dtype == np .float32
6969
7070
71- def test_reconstruct_FBP_3 (data , flats , darks , ensure_clean_memory ):
72- recon_data = FBP (
71+ def test_reconstruct_FBP3d_tomobar_3 (data , flats , darks , ensure_clean_memory ):
72+ recon_data = FBP3d_tomobar (
7373 normalize_cupy (data , flats , darks , cutoff = 20.5 , minus_log = False ),
7474 np .linspace (5.0 * np .pi / 360.0 , 180.0 * np .pi / 360.0 , data .shape [0 ]),
7575 79 , # center
@@ -87,8 +87,8 @@ def test_reconstruct_FBP_3(data, flats, darks, ensure_clean_memory):
8787 assert recon_data .shape == (210 , 128 , 210 )
8888
8989
90- def test_reconstruct_LPREC_1 (data , flats , darks , ensure_clean_memory ):
91- recon_data = LPRec (
90+ def test_reconstruct_LPRec3d_tomobar_1 (data , flats , darks , ensure_clean_memory ):
91+ recon_data = LPRec3d_tomobar (
9292 data = normalize_cupy (data , flats , darks , cutoff = 10 , minus_log = True ),
9393 angles = np .linspace (0.0 * np .pi / 180.0 , 180.0 * np .pi / 180.0 , data .shape [0 ]),
9494 center = 79.5 ,
@@ -104,9 +104,9 @@ def test_reconstruct_LPREC_1(data, flats, darks, ensure_clean_memory):
104104 assert recon_data .shape == (130 , 128 , 130 )
105105
106106
107- def test_reconstruct_SIRT (data , flats , darks , ensure_clean_memory ):
107+ def test_reconstruct_SIRT3d_tomobar (data , flats , darks , ensure_clean_memory ):
108108 objrecon_size = data .shape [2 ]
109- recon_data = SIRT (
109+ recon_data = SIRT3d_tomobar (
110110 normalize_cupy (data , flats , darks , cutoff = 10 , minus_log = True ),
111111 np .linspace (0.0 * np .pi / 180.0 , 180.0 * np .pi / 180.0 , data .shape [0 ]),
112112 79.5 ,
@@ -121,9 +121,9 @@ def test_reconstruct_SIRT(data, flats, darks, ensure_clean_memory):
121121 assert recon_data .dtype == np .float32
122122
123123
124- def test_reconstruct_CGLS (data , flats , darks , ensure_clean_memory ):
124+ def test_reconstruct_CGLS3d_tomobar (data , flats , darks , ensure_clean_memory ):
125125 objrecon_size = data .shape [2 ]
126- recon_data = CGLS (
126+ recon_data = CGLS3d_tomobar (
127127 normalize_cupy (data , flats , darks , cutoff = 10 , minus_log = True ),
128128 np .linspace (0.0 * np .pi / 180.0 , 180.0 * np .pi / 180.0 , data .shape [0 ]),
129129 79.5 ,
@@ -139,7 +139,7 @@ def test_reconstruct_CGLS(data, flats, darks, ensure_clean_memory):
139139
140140
141141@pytest .mark .perf
142- def test_FBP_performance (ensure_clean_memory ):
142+ def test_FBP3d_tomobar_performance (ensure_clean_memory ):
143143 dev = cp .cuda .Device ()
144144 data_host = np .random .random_sample (size = (1801 , 5 , 2560 )).astype (np .float32 ) * 2.0
145145 data = cp .asarray (data_host , dtype = np .float32 )
@@ -148,13 +148,13 @@ def test_FBP_performance(ensure_clean_memory):
148148 filter_freq_cutoff = 1.1
149149
150150 # cold run first
151- FBP (data , angles , cor , filter_freq_cutoff )
151+ FBP3d_tomobar (data , angles , cor , filter_freq_cutoff )
152152 dev .synchronize ()
153153
154154 start = time .perf_counter_ns ()
155155 nvtx .RangePush ("Core" )
156156 for _ in range (10 ):
157- FBP (data , angles , cor )
157+ FBP3d_tomobar (data , angles , cor )
158158 nvtx .RangePop ()
159159 dev .synchronize ()
160160 duration_ms = float (time .perf_counter_ns () - start ) * 1e-6 / 10
0 commit comments