hyperspectR provides a complete R pipeline for biomedical hyperspectral imaging analysis -- from camera data to reproducible research maps.
# install.packages("remotes")
# remotes::install_github("cttir/hyperspectR")
install.packages("hyperspectR", repos = c('https://cttir.r-universe.dev', 'https://cloud.r-project.org'))
library(hyperspectR)
# Load example cube (synthetic 30x30 tissue scene, 61 bands, 430-910 nm)
cube <- hs_example_cube()
print(cube)
# Plot RGB composite
autoplot(cube, type = "rgb")
# Compute tissue oxygenation
sto2 <- hs_sto2(cube)
hs_plot_index(sto2, title = "Fitted Hb fraction (%)", palette = "sto2")
# Clinical 5-panel display (TIVITA-style)
hs_plot_clinical(cube)
# Launch interactive explorer
hs_run_app(cube)
To cite hyperspectR in publications, please use:
@Manual{,
title = {hyperspectR: Hyperspectral Imaging Analysis for Biomedical Applications},
author = {R. Heller and V. Forstmeier},
year = {2026},
note = {R package version 0.1.0},
url = {https://github.com/cttir/hyperspectR},
}
MIT
The development version changes numerical behavior from 0.1.0. hs_sto2() now
fits tabulated hemoglobin reference spectra; method = "ratio" raises a migration
error. hs_band_ratio() and the legacy NPI/THI/TWI functions return dimensionless,
unscaled ratios. They are not vendor clinical indices or calibrated physiological
measurements. The simulator is a software demonstration, not validation data.
hs_beer_lambert() requires a declared reflectance/absorbance domain. It returns
coefficients in mol/L * cm; concentrations is available only with a supplied
pathlength_cm. Sensor response and tissue scattering require separate evaluation.
See the repository's migration details, implementation record, and analysis protocol.
recipe <- hs_recipe(list(list(method = "smooth", args = list(window = 5))))
processed <- hs_process(hs_example_cube(), recipe)
# Use the saved recipe; MSC references, if present, are fitted only once.
new_data <- hs_process(hs_example_cube(), processed$recipe, learn = FALSE)
hs_batch() saves input checksums, recipes, results, implementation fingerprints
and environment versions, isolates failed recordings, and resumes matching work.
hs_grouped_evaluate() keeps subjects together across validation splits;
hs_group_summary() reports uncertainty using independent groups rather than pixels.
Device readers are covered by software fixtures and SDK mocks. Real camera, phantom and independently labeled study validation remain separate evidence gates.
Where applicable, LLM tools were used for narrowly defined, non-authorial tasks: copyediting, prose refinement, Markdown/LaTeX formatting, boilerplate scaffolding (such as CI configurations and build scripts), and code refactoring. Tools included Chat AI, the KISSKI (GWDG) service, and self-hosted Mistral Small (24B, Apache-2.0) served through a local vLLM architecture on an Ubuntu Linux workstation with Intel processors and NVIDIA GPUs. The self-hosted model ran locally, with no data sent to third parties.
All scientific claims, methodological choices, analyses, interpretations and conclusions remain the authors' own. Where applicable, LLM-generated material must be reviewed and revised before inclusion, and references must be verified against their DOI, arXiv ID or ISBN.
Local software setup: vLLM with Python/PyTorch, plus R and RStudio.