Skip to content

Commit 7ed0cd0

Browse files
committed
start on renaming
1 parent cb3756c commit 7ed0cd0

File tree

3 files changed

+36
-31
lines changed

3 files changed

+36
-31
lines changed

httomolibgpu/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,10 @@
1111
remove_all_stripe,
1212
)
1313

14-
from httomolibgpu.recon.algorithm import FBP, LPRec, SIRT, CGLS
14+
from httomolibgpu.recon.algorithm import (
15+
FBP3d_tomobar,
16+
LPRec3d_tomobar,
17+
SIRT3d_tomobar,
18+
CGLS3d_tomobar,
19+
)
1520
from httomolibgpu.recon.rotation import find_center_vo, find_center_360, find_center_pc

httomolibgpu/recon/algorithm.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@
4040

4141

4242
__all__ = [
43-
"FBP",
44-
"LPRec",
45-
"SIRT",
46-
"CGLS",
43+
"FBP3d_tomobar",
44+
"LPRec3d_tomobar",
45+
"SIRT3d_tomobar",
46+
"CGLS3d_tomobar",
4747
]
4848

4949
input_data_axis_labels = ["angles", "detY", "detX"] # set the labels of the input data
5050

5151

5252
## %%%%%%%%%%%%%%%%%%%%%%% FBP reconstruction %%%%%%%%%%%%%%%%%%%%%%%%%%%% ##
53-
def FBP(
53+
def FBP3d_tomobar(
5454
data: cp.ndarray,
5555
angles: np.ndarray,
5656
center: Optional[float] = None,
@@ -91,7 +91,7 @@ def FBP(
9191
Returns
9292
-------
9393
cp.ndarray
94-
The FBP reconstructed volume as a CuPy array.
94+
FBP reconstructed volume as a CuPy array.
9595
"""
9696
RecToolsCP = _instantiate_direct_recon_class(
9797
data, angles, center, recon_size, gpu_id
@@ -108,7 +108,7 @@ def FBP(
108108

109109

110110
## %%%%%%%%%%%%%%%%%%%%%%% LPRec %%%%%%%%%%%%%%%%%%%%%%%%%%%% ##
111-
def LPRec(
111+
def LPRec3d_tomobar(
112112
data: cp.ndarray,
113113
angles: np.ndarray,
114114
center: Optional[float] = None,
@@ -157,7 +157,7 @@ def LPRec(
157157

158158

159159
## %%%%%%%%%%%%%%%%%%%%%%% SIRT reconstruction %%%%%%%%%%%%%%%%%%%%%%%%%%%% ##
160-
def SIRT(
160+
def SIRT3d_tomobar(
161161
data: cp.ndarray,
162162
angles: np.ndarray,
163163
center: Optional[float] = None,
@@ -222,7 +222,7 @@ def SIRT(
222222

223223

224224
## %%%%%%%%%%%%%%%%%%%%%%% CGLS reconstruction %%%%%%%%%%%%%%%%%%%%%%%%%%%% ##
225-
def CGLS(
225+
def CGLS3d_tomobar(
226226
data: cp.ndarray,
227227
angles: np.ndarray,
228228
center: Optional[float] = None,

tests/test_recon/test_algorithm.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
import numpy as np
33
from httomolibgpu.prep.normalize import normalize as normalize_cupy
44
from 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
)
1010
from numpy.testing import assert_allclose
1111
import time
1212
import pytest
1313
from 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

Comments
 (0)