Learn R Programming

neuroSCC (version 1.0.0)

calculateMetrics: 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)

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).

Arguments

detectedPoints

A data frame containing detected coordinates (x, y). SCC-detected points should be obtained using getPoints. SPM-detected points should be obtained using getSPMbinary.

truePoints

A data frame with ground truth ROI coordinates (x, y), extracted via processROIs.

totalCoords

A list with the full voxel grid dimensions, created by getDimensions. Must include named elements xDim and yDim.

regionName

A character string used to label the output region.

Details

This function requires three precomputed objects

  • detectedPoints: SCC-detected points from getPoints or SPM-detected points from getSPMbinary.

  • truePoints: Ground truth ROIs extracted using processROIs.

  • totalCoords: Full voxel coordinate grid from getDimensions.

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

Run this code
# 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)
})

Run the code above in your browser using DataLab