cuvis.r provides R bindings to the Cubert CUVIS SDK for reading, calibrating, and exporting hyperspectral data from Cubert cameras.
This is the R equivalent of cuvis.python.
CUVIS_SDK environment variable to the install directory# install.packages("remotes")
# remotes::install_github("cttir/cuvis.r")
install.packages("cuvis.r", repos = c('https://cttir.r-universe.dev', 'https://cloud.r-project.org'))
library(cuvis.r)
cuvis_init()
# Load a session file
session <- cuvis_session("path/to/measurement.cu3s")
print(session)
# Extract the data cube
mesu <- cuvis_get_measurement(session, 1)
ctx <- cuvis_processing_context(session)
cuvis_reprocess(ctx, mesu, mode = "raw")
cube <- cuvis_get_cube(mesu)
dim(cube) # [rows, cols, bands]
attr(cube, "wavelengths") # wavelengths in nm
# Calibrate to reflectance
cuvis_reprocess(ctx, mesu, mode = "reflectance")
ref_cube <- cuvis_get_cube(mesu)
# Export to ENVI
cuvis_export_envi(mesu, "output/")
cuvis_shutdown()
cuvis_init()
session <- cuvis_session("measurement.cu3s")
mesu <- cuvis_get_measurement(session, 1)
# Load separate dark/white reference files
dark_session <- cuvis_session("dark.cu3s")
white_session <- cuvis_session("white.cu3s")
ctx <- cuvis_processing_context(session)
cuvis_set_reference(ctx, cuvis_get_measurement(dark_session, 1), "dark")
cuvis_set_reference(ctx, cuvis_get_measurement(white_session, 1), "white")
cuvis_reprocess(ctx, mesu, mode = "reflectance")
ref_cube <- cuvis_get_cube(mesu)
cuvis_shutdown()
| Function | Description |
|---|---|
cuvis_init() |
Initialize the CUVIS SDK |
cuvis_shutdown() |
Release SDK resources |
cuvis_available() |
Check if SDK is linked |
cuvis_session(path) |
Load a .cu3s session file |
cuvis_get_measurement(session, i) |
Extract measurement by index |
cuvis_get_metadata(mesu) |
Get measurement metadata |
cuvis_get_cube(mesu) |
Extract 3D data array |
cuvis_get_wavelengths(mesu) |
Get wavelength vector |
cuvis_processing_context(session) |
Create calibration context |
cuvis_set_reference(ctx, mesu, type) |
Set dark/white reference |
cuvis_reprocess(ctx, mesu, mode) |
Reprocess to target level |
cuvis_export_envi(mesu, dir) |
Export to ENVI format |
cuvis_export_tiff(mesu, dir) |
Export to TIFF format |
cuvis_export_session(mesu, dir) |
Export to .cu3s format |
cuvis.r is designed as the I/O backend for hyperspectR:
library(hyperspectR)
# hyperspectR uses cuvis.r internally for .cu3s files
cube <- hs_read_cubert("measurement.cu3s")
Apache License 2.0
If you use this software, please cite it as:
Heller, R. (2026). cuvis.r: R bindings for the Cubert CUVIS hyperspectral SDK (Version 0.1.0) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.21889930
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.