calculateMetrics {neuroSCC} | R Documentation |
Evaluate SCC or SPM Detection Performance
Description
Computes Sensitivity, Specificity, Positive Predictive Value (PPV), and Negative Predictive Value (NPV) by comparing detected points with ground truth ROI points. This function is used to assess the accuracy of SCC- or SPM-based detection in neuroimaging analysis.
Usage
calculateMetrics(detectedPoints, truePoints, totalCoords, regionName)
Arguments
detectedPoints |
A data frame containing detected coordinates ( |
truePoints |
A data frame with ground truth ROI coordinates ( |
totalCoords |
A list with the full voxel grid dimensions, created by |
regionName |
A character string used to label the output region. |
Details
This function requires three precomputed objects
-
detectedPoints
: SCC-detected points fromgetPoints
or SPM-detected points fromgetSPMbinary
. -
truePoints
: Ground truth ROIs extracted usingprocessROIs
. -
totalCoords
: Full voxel coordinate grid fromgetDimensions
.
Value
A data frame with the following evaluation metrics
-
region
: Name of the analyzed region. -
sensitivity
: True positive rate (TP / (TP + FN) * 100). -
specificity
: True negative rate (TN / (TN + FP) * 100). -
PPV
: Positive predictive value (TP / (TP + FP) * 100). -
NPV
: Negative predictive value (TN / (TN + FN) * 100).
See Also
getPoints
for SCC-detected regions.
getSPMbinary
for binary SPM-detected points.
processROIs
for defining ground truth ROIs.
getDimensions
for generating the coordinate grid.
Examples
# Load precomputed inputs for the example
data("calculateMetricsExample", package = "neuroSCC")
# Evaluate SCC and SPM detection performance
with(calculateMetricsExample, {
metricsSCC <- calculateMetrics(detectedSCC, trueROI, totalCoords, "Region2_SCC")
metricsSPM <- calculateMetrics(detectedSPM, trueROI, totalCoords, "Region2_SPM")
print(metricsSCC)
print(metricsSPM)
})