Skip to content

About

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

hyperspectR hyperspectR logo

DOI

R-CMD-check pkgdown CRAN status Codecov test coverage CRAN downloads CRAN downloads total License: MIT Lifecycle: experimental

hyperspectR provides a complete R pipeline for biomedical hyperspectral imaging analysis -- from camera data to reproducible research maps.

Installation

# install.packages("remotes")
remotes::install_github("cttir/hyperspectR")

Quick Start

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)

Features

  • I/O: Read ENVI, multi-channel TIFF, and Cubert .cu3s files
  • Calibration: Dark correction, white reference normalization, bad pixel repair
  • Preprocessing: Savitzky-Golay smoothing, SNV, MSC, spectral derivatives
  • Research indices: fitted hemoglobin fraction, dimensionless band ratios and normalized differences
  • Analysis: PCA, MNF, SAM classification, SVM/RF pixel classification, Beer-Lambert unmixing
  • Visualization: ggplot2-based spectral plots, research panel displays, interactive Shiny app
  • Clinical focus: Intraoperative oxygenation mapping, compartment syndrome assessment

Citation

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},
}

License

MIT

Corrected research semantics

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.

Reproducible processing

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.

Use of LLM tools

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.

Branding

Editable R sources and regeneration instructions are in tools/branding.

About

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages