CalciumScoring.Agatston
— TypeAgatston
struct Agatston <: CalciumScore end
Lets Julia know (via multiple dispatch) that the algorithm of choice when calculating the calcium score should be Agatston's algorithm
CalciumScoring.CalciumScore
— TypeCalciumScore
abstract type CalciumScore end
Main type for all calcium scoring algorithms in this package
CalciumScoring.Integrated
— TypeIntegrated
function Integrated(
vol,
I=sum(vol),
N=length(vol)
)
Inputs
- vol: region of interest
- I: integrated intensity of the entire
vol
- N: total number of voxels contained in the entire
vol
References
Integrated intensity-based technique for coronary artery calcium mass measurement: A phantom study
Accurate quantification of vessel cross-sectional area using CT angiography: a simulation study
CalciumScoring.SpatiallyWeighted
— TypeSpatiallyWeighted
struct SpatiallyWeighted <: CalciumScore end
Lets Julia know (via multiple dispatch) that the algorithm of choice when calculating the calcium score should be the Spatially Weighted Calcium Scoring algorithm.
CalciumScoring.VolumeFraction
— TypeVolumeFraction
struct VolumeFraction <: CalciumScore end
Lets Julia know (via multiple dispatch) that the algorithm of choice when calculating the calcium score should be the volume fraction algorithm
CalciumScoring._percentage_calcium
— Method_percentage_calcium
_percentage_calcium(voxel_intensity, hu_calcium, hu_heart_tissue)
Find the percentage of calcium within one voxel given the voxel intensity voxel_intensity
, the Hounsfield unit associated with a known calcium density hu_calcium
, and the Hounsfield unit associated with background heart tissue hu_heart_tissue
CalciumScoring._weight_thresholds
— Method_weight_thresholds
_weight_thresholds(kV, max_intensity)
This code defines a function named _weight_thresholds
that calculates the weight threshold for the Agatston scoring algorithm. The function takes two input parameters: kV and maxintensity. The kV
parameter represents the CT scan's kilovoltage peak (kVp) value, and `maxintensity` represents the maximum intensity of a calcified lesion in Hounsfield units (HU).
The function checks the validity of the input kV
value and ensures that it is one of the accepted values: 70, 80, 100, 120, or 135. If the input value does not match any of the accepted values, an error message is displayed, and the program is halted.
The function then calculates the weight threshold based on the input kV
and max_intensity
. It uses a series of if-else statements to determine the weight threshold depending on the kV value and the given range of max_intensity
values.
The function returns the weight threshold as an integer value between 0 and 4.
Inputs
kV
: The kilovoltage peak (kVp) value of the CT scan (Accepted values: 70, 80, 100, 120, or 135)max_intensity
: The maximum intensity of a calcified lesion in Hounsfield units (HU)
Returns
weight
: The weight threshold for the Agatston scoring algorithm (integer value between 0 and 4)
Reference
CalciumScoring.score
— Methodscore
(VolumeFraction)
score(vol::AbstractArray, hu_calcium, hu_heart_tissue, alg::VolumeFraction)
score(vol::AbstractArray, hu_calcium, hu_heart_tissue, voxel_size, alg::VolumeFraction)
score(vol::AbstractArray, hu_calcium, hu_heart_tissue, voxel_size, density_calcium, alg::VolumeFraction)
score(vol::AbstractMatrix, hu_calcium, hu_heart_tissue, alg::VolumeFraction)
score(vol::AbstractMatrix, hu_calcium, hu_heart_tissue, voxel_size, alg::VolumeFraction)
score(vol::AbstractMatrix, hu_calcium, hu_heart_tissue, voxel_size, density_calcium, alg::VolumeFraction)
Calculate the number of voxels that are calcified, the volume of the calcification, or the mass of the calcification depending on the provided arguments.
Inputs
vol
: An input region of interest containing all potential calcium.hu_calcium
: The Hounsfield unit associated with a known calcium density.hu_heart_tissue
: The Hounsfield unit associated with background heart tissue.voxel_size
: (optional) The size of an individual pixel/voxel.density_calcium
: (optional) The density of the previously mentioned calcium.alg::VolumeFraction
: The algorithm to be used for the calculation.
Returns
- When called with
vol
,hu_calcium
,hu_heart_tissue
, andalg
, this function calculates and returns the number of voxels that are calcified. - When called with
vol
,hu_calcium
,hu_heart_tissue
,voxel_size
, andalg
, this function calculates and returns the volume of the calcification. - When called with
vol
,hu_calcium
,hu_heart_tissue
,voxel_size
,density_calcium
, andalg
, this function calculates and returns the mass of the calcification.
References
CalciumScoring.score
— Methodscore
(SpatiallyWeighted)
score(vol::AbstractMatrix, calibration, alg::SpatiallyWeighted)
score(vol::AbstractMatrix, μ, σ, alg::SpatiallyWeighted)
score(vol::AbstractArray, calibration, alg::SpatiallyWeighted)
score(vol::AbstractArray, μ, σ, alg::SpatiallyWeighted)
Calculate the calcium score via the Spatially Weighted Calcium Scoring algorithm. This method avoids thresholding by weighting each voxel based on a previous calibration (usually 100 mg/cc) as outlined in the MESA study.
The function can be called with different parameters:
vol::AbstractMatrix
,calibration
,alg::SpatiallyWeighted
- Applies the algorithm to a 2D volume with a calibration array.vol::AbstractMatrix
,μ
,σ
,alg::SpatiallyWeighted
- Applies the algorithm to a 2D volume with given meanμ
and standard deviationσ
.vol::AbstractArray
,calibration
,alg::SpatiallyWeighted
- Applies the algorithm to a 3D volume with a calibration array.vol::AbstractArray
,μ
,σ
,alg::SpatiallyWeighted
- Applies the algorithm to a 3D volume with given meanμ
and standard deviationσ
.
Inputs
vol
: input volume containing just the region of interest. This can be a 2D (AbstractMatrix
) or 3D (AbstractArray
) volume.calibration
: a previous calibration for weighting each voxel.μ
,σ
: given mean and standard deviation.alg::SpatiallyWeighted
: Spatially Weighted scoring algorithmSpatiallyWeighted()
.
Returns
sw_score
: total Spatially Weighted score, providing a continuous and improved measure of atherosclerosis compared to existing coronary artery calcium scoring methods.
References
CalciumScoring.score
— Methodscore
(Agatston)
score(vol, spacing, alg::Agatston; kV=120, min_size_mm=1)
score(vol, spacing, mass_cal_factor, alg::Agatston; kV=120, min_size_mm=1)
Calculate the calcium score via the traditional Agatston scoring technique, as outlined in the original paper. Energy (kV
) specific threshold
s are determined based on previous publications. Also, it converts the Agatston score to a calcium mass score via the mass_cal_factor
if provided.
Inputs
vol
: input volume containing just the region of interestspacing
: known pixel/voxel spacingalg::Agatston
: Agatston scoring algorithmAgatston()
mass_cal_factor
: (optional) a factor to calibrate the calculated mass- kwargs:
kV=120
: energy of the input CT scan imagemin_size=1
: minimum connected component size (seelabel_components
)
Returns
agatston_score
: total Agatston scorevolume_score
: total calcium volume via Agatston scoringabs_mass_score
: (optional) total calcium mass after calibration, returned only whenmass_cal_factor
is provided
References
Quantification of coronary artery calcium using ultrafast computed tomography
CalciumScoring.score
— Methodscore
(Integrated)
score(S_Bkg, S_Obj, algorithm::Integrated)
score(S_Bkg, S_Obj, size, algorithm::Integrated)
score(S_Bkg, S_Obj, size, ρ, algorithm::Integrated)
Use the integrated intensity approach to find the total number of object voxels/volume/mass contained in vol
.
The function can be called with different parameters:
S_Bkg
,S_Obj
,algorithm
- Returns the total number of object voxels.S_Bkg
,S_Obj
,size
,algorithm
- Returns the total object volume.S_Bkg
,S_Obj
,size
,ρ
,algorithm
- Returns the total object mass.
Inputs
S_Bkg
: pure background signal intensity in thevol
S_Obj
: pure object signal intensity in thevol
size
: (optional) size of the voxels in the givenvol
(only for the 2nd and 3rd variations)ρ
: (optional) density of the given object of interest contained within thevol
(only for the 3rd variation)algorithm
: theIntegrated
algorithm which accounts for noise and partial volume effect by integrating the intensity of the entire volumevol
References
Integrated intensity-based technique for coronary artery calcium mass measurement: A phantom study
Accurate quantification of vessel cross-sectional area using CT angiography: a simulation study