Skip to content

Commit c948b16

Browse files
committed
forward line integrals
1 parent b06adca commit c948b16

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/recon_buildblock/SPECTGPU_projector/SPECTGPUProjection.cu

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,22 @@ __global__ void forwardKernel(const float* __restrict__ in_im,
3535
float3 origin,
3636
float angle_rad)
3737
{
38+
//1. define position in the detector, x horizontal, z vertical, y is the depth.
39+
40+
int det_x = blockIdx.x * blockDim.x + threadIdx.x;
41+
int det_y = blockIdx.y * blockDim.y + threadIdx.y;
42+
int det_z = blockIdx.z * blockDim.z + threadIdx.z;
43+
44+
if (det_x >= dim.x || det_y >= dim.y || det_z >= dim.z) {
45+
return;
46+
}
47+
int sino_idx = det_z * dim.x + det_x;
3848

39-
40-
}
41-
49+
// Sum voxel values along the y-axis (depth) for this detector pixel
50+
int voxel_idx = det_y * dim.x * dim.z + det_z * dim.x + det_x;
51+
out_sino[sino_idx] += in_im[voxel_idx];
52+
53+
}
4254
// the following is the adjoint operation (push)
4355
__global__ void backwardKernel(const float* __restrict__ in_sino,
4456
float* __restrict__ out_im,

0 commit comments

Comments
 (0)