Skip to content

Commit

Permalink
skip TOF backprojections along LOR where the sum over TOF is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
Georg Schramm authored and Georg Schramm committed Dec 14, 2024
1 parent 0f4f8e9 commit 8338643
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions c/src/joseph3d_back_tof_sino.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ void joseph3d_back_tof_sino(const float *xstart,
# pragma omp parallel for schedule(static)
for(i = 0; i < nlors; i++)
{
float tof_lor_sum = 0;

// check whether the sum over TOF of the TOF sinogram to be backprojcted is > 0
// if it is 0, we can skip the backprojection of this LOR
for (int j = 0; j < n_tofbins; j++) {
tof_lor_sum += p[i * n_tofbins + j];
}

if (tof_lor_sum == 0) {
continue;
}

float d0, d1, d2, d0_sq, d1_sq, d2_sq;
float cs0, cs1, cs2, cf;
float lsq, cos0_sq, cos1_sq, cos2_sq;
Expand Down
12 changes: 12 additions & 0 deletions cuda/src/projector_kernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -816,8 +816,20 @@ extern "C" __global__ void joseph3d_back_tof_sino_cuda_kernel(float *xstart,

int n_half = n_tofbins/2;

float tof_lor_sum = 0.0f;

if(i < nlors)
{
// check whether the sum over TOF of the TOF sinogram to be backprojcted is > 0
// if it is 0, we can skip the backprojection of this LOR
for (int j = 0; j < n_tofbins; j++) {
tof_lor_sum += p[i * n_tofbins + j];
}

if (tof_lor_sum == 0) {
return;
}

float d0, d1, d2, d0_sq, d1_sq, d2_sq;
float cs0, cs1, cs2, cf;
float lsq, cos0_sq, cos1_sq, cos2_sq;
Expand Down

0 comments on commit 8338643

Please sign in to comment.