CT machines work by shooting out thin X-Rays that pass through the material to a detector plate.
By shooting many rays in different angle configurations for a single horizontal slice of the material, the CT machine and reconstruction algorithm is able to reconstruct the slice.
Combining multiple horizontal slices vertically results in a 3D reconstruction of the scanned material.
For demonstration purposes, this application uses brain imaging data from the OpenNeuro Dataset ds000102.
Resolution
The machine is fine-tuned, based on parameters such as number of rays, angles and detector performance, for a certain resolution - i.e. number of voxels able to reconstruct.
In our 2D example, this is represented by a cell size of 5x5px, downsampled and calculated from an image of 256x256px.
X-Ray mechanism - analytic
Each X-ray beam passing through the material is attenuated by the linear attenuation coefficient \( \mu \) along its path.
According to Lambert-Beer's law, the intensity at the exit point B, starting from intensity \( I_A \) at point A, is:
$$ I_B = I_A \, e^{-\int_A^B \mu(s) \, ds} $$
The total attenuation \( \beta \) along the path is:
$$ \beta = \int_A^B \mu(s) \, ds = -\ln(I_B / I_A) $$
In discrete space, each voxel the ray passes through contributes to the total attenuation, exponentially reducing the beam's intensity.