This example compares regions in a synthetic image. The package has not been validated to diagnose compartment syndrome, detect ischemia, or replace clinical assessment. No clinical threshold is defined by these simulated outputs.
The region parameters vary synthetic spectral shapes. Their assigned values are simulation inputs, not established tissue oxygenation ground truth.
The fitted fractions may disagree with simulation parameters because the simulator and reference inversion use different models.
roi_affected <- hs_roi_rect(cube, x_range = c(30, 50), y_range = c(30, 50))
roi_normal <- hs_roi_rect(cube, x_range = c(1, 20), y_range = c(1, 20))
stats_aff <- hs_roi_stats(cube, roi_affected)
stats_norm <- hs_roi_stats(cube, roi_normal)
library(ggplot2)
ggplot() +
geom_line(data = stats_norm,
aes(x = wavelength, y = mean, color = "Normal"), linewidth = 0.8) +
geom_line(data = stats_aff,
aes(x = wavelength, y = mean, color = "Affected"), linewidth = 0.8) +
scale_color_manual(values = c(Normal = "#2E86AB", Affected = "#E41A1C")) +
labs(x = "Wavelength (nm)", y = "Reflectance",
title = "Spectral Comparison: Normal vs. Affected Tissue", color = "") +
theme_hsi()This plot describes within-image spectral variation. Pixel SD is not
a confidence interval for a population effect. For repeated
measurements, define subjects as independent groups and use
hs_group_summary() on prespecified ROI summaries.