One-step spectral CT reconstruction¶
Please start by reading the general documentation on spectral CT.
RTK provides a command line application to perform one-step reconstruction. It uses the measured projections, the incident spectrum, the material attenuations and the detector response for the spectral part, and the geometry and an initial reconstructed volume for the tomographic part. Providing a mask of the region of the reconstructed volume where the image object is expected to be found, and outside of which there should be nothing, helps the algorithm converge. The method is described in this paper.
Dataset¶
The data used in this documentation page can be downloaded using Girder. It is a simulation through a cylinder of water with two inserts, one empty, the other filled with cortical bone.
Command line application¶
# One-step spectral reconstruction
rtkspectralonestep \
-s counts.mha \
--incident spectrum.mha \
-a mat_basis.mha \
-d drm.mha \
-g geometry.xml \
-i zero_recon.mha \
-o cl_onestep.mha \
-t 20,40,60,80,100 \
--mask mask.mha \
-n 7
cl_onestep.mha should look similar to recon_ref.mha available on Girder.
To speed things up, it is recommended to use the CUDA version of the forward and back projectors by running this command instead:
# One-step spectral reconstruction using CUDA accelerations
rtkspectralonestep \
-s counts.mha \
--incident spectrum.mha \
-a mat_basis.mha \
-d drm.mha \
-g geometry.xml \
-i zero_recon.mha \
-o cl_onestep.mha \
-t 20,40,60,80,100 \
--mask mask.mha \
-n 7 \
-f CudaRayCast \
-b CudaVoxelBased
Command line options¶
usage: __main__.py [-h] [-V] [-v] --geometry GEOMETRY --output OUTPUT
[--niterations NITERATIONS] [--input INPUT] --spectral
SPECTRAL --detector DETECTOR --incident INCIDENT
--attenuations ATTENUATIONS [--mask MASK]
[--regul_spatial_weights REGUL_SPATIAL_WEIGHTS]
[--projection_weights PROJECTION_WEIGHTS] --thresholds
THRESHOLDS [THRESHOLDS ...] [--subsets SUBSETS]
[--regul_weights REGUL_WEIGHTS [REGUL_WEIGHTS ...]]
[--regul_radius REGUL_RADIUS [REGUL_RADIUS ...]]
[--reset_nesterov RESET_NESTEROV]
[--origin ORIGIN [ORIGIN ...]] [--size SIZE [SIZE ...]]
[--dimension DIMENSION [DIMENSION ...]]
[--spacing SPACING [SPACING ...]]
[--direction DIRECTION [DIRECTION ...]] [--like LIKE]
[--fp {Joseph,CudaRayCast,JosephAttenuated,Zeng,CudaZeng}]
[--bp {VoxelBasedBackProjection,Joseph,CudaVoxelBased,CudaRayCast,JosephAttenuated,Zeng,CudaZeng}]
[--step STEP] [--attenuationmap ATTENUATIONMAP]
[--sigmazero SIGMAZERO] [--alphapsf ALPHAPSF]
[--inferiorclipimage INFERIORCLIPIMAGE]
[--superiorclipimage SUPERIORCLIPIMAGE]
[--output-every OUTPUT_EVERY]
[--iteration-file-name ITERATION_FILE_NAME]
Named Arguments¶
- -V, --version
show program’s version number and exit
- -v, --verbose
Verbose execution
Default:
False- --geometry, -g
XML geometry file name
- --output, -o
Output file name
- --niterations, -n
Number of iterations
Default:
5- --input, -i
Material volumes initial guess
- --spectral, -s
Spectral projections, i.e. photon counts
- --detector, -d
Detector response file
- --incident
Incident spectrum file (mhd image)
- --attenuations, -a
Material attenuations file
- --mask, -m
Apply a support binary mask: reconstruction kept null outside
- --regul_spatial_weights
One-component image of spatial regularization weights
- --projection_weights
One-component image of projection weights (size of photon counts)
- --thresholds, -t
Lower threshold of bins, expressed in pulse height
- --subsets
Number of subsets of projections (should not exceed 6)
Default:
4- --regul_weights
Regularization parameters for each material
- --regul_radius
Radius of the neighborhood for regularization
- --reset_nesterov
Reset Nesterov after a number of subsets
Output 3D image properties¶
- --origin
Origin (default=centered)
- --size
Size
Default:
[256]- --dimension
Dimension (Deprecated) Use –size instead.
- --spacing
Spacing
Default:
[1]- --direction
Direction
- --like
Copy information from this image (origin, size, spacing, direction)
Projectors¶
- --fp, -f
Possible choices: Joseph, CudaRayCast, JosephAttenuated, Zeng, CudaZeng
Forward projection method
Default:
'Joseph'- --bp, -b
Possible choices: VoxelBasedBackProjection, Joseph, CudaVoxelBased, CudaRayCast, JosephAttenuated, Zeng, CudaZeng
Back projection method
Default:
'VoxelBasedBackProjection'- --step
Step size along ray (for CudaRayCast only, default to the minimum voxel spacing of the input volume if set to 0)
Default:
0.0- --attenuationmap
Attenuation map relative to the volume to perform the attenuation correction (JosephAttenuated, Zeng and CudaZeng)
- --sigmazero
PSF value at a distance of 0 meter of the detector (Zeng and CudaZeng only)
- --alphapsf
Slope of the PSF against the detector distance (Zeng and CudaZeng only)
- --inferiorclipimage
Inferior clip of the ray for each pixel of the projections (Joseph only)
- --superiorclipimage
Superior clip of the ray for each pixel of the projections (Joseph only)
Iteration reporting¶
- --output-every
Output intermediate reconstruction after some iterations
- --iteration-file-name
File name to output intermediate iterations with {i} as a placeholder for iteration number