Skip to content
Snippets Groups Projects
Commit f63f5561 authored by Tamino Huxohl's avatar Tamino Huxohl
Browse files

clearnup reconstruction func

parent 68689ecc
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,7 @@ def grayscale_to_rgb(img: np.ndarray):
return img.repeat(3).reshape((*img.shape, 3))
def reconstruct(recon, mu_map=None, iterations=10, use_gpu=True, seed=42, test_flag=True):
def reconstruct(recon, mu_map=None, iterations=10, use_gpu=True, seed=42):
random.seed(seed)
spect = SPECT_Static_Scan()
......@@ -64,11 +64,8 @@ def reconstruct(recon, mu_map=None, iterations=10, use_gpu=True, seed=42, test_f
spect.set_n_pixels(n_pixels, n_pixels)
spect.set_gantry_angular_positions(0.0, 360.0, 59)
# print("Forward projection .....", end="\r")
measurement = spect.project(recon_t)
# print(f"Measurement: {measurement.data.shape}")
spect.set_measurement(measurement.data)
# print("Forward projection DONE!")
if mu_map is not None:
mu_map_t = np.transpose(mu_map, (2, 1, 0)).astype(np.float32)
......@@ -79,11 +76,9 @@ def reconstruct(recon, mu_map=None, iterations=10, use_gpu=True, seed=42, test_f
spect.set_radius(200.0)
spect.set_psf(fwhm0_mm=5.0, depth_dependence=0.0001)
# print("Reconstruction .....", end="\r")
activity = spect.estimate_activity(
iterations=iterations, subset_size=16, subset_mode="random", method="EM"
)
# print("Reconstruction DONE!")
activity = activity.data
activity = np.transpose(activity, (2, 1, 0))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment