cuvis.r provides R bindings to the Cubert CUVIS C SDK for reading, processing, and exporting hyperspectral imaging data from Cubert snapshot cameras. It mirrors the API of cuvis.python.
CUVIS_SDK environment variable to the SDK
install directoryEvery cuvis.r session begins with cuvis_init() and ends
with cuvis_shutdown():
Cubert cameras store measurements in .cu3s session
files. Load one with cuvis_session():
Session files contain one or more measurements. Access them by index (1-based):
The hyperspectral data cube is returned as a 3D R array
[rows, cols, bands] with wavelength metadata attached:
# First, process to generate the cube
ctx <- cuvis_processing_context(session)
cuvis_reprocess(ctx, mesu, mode = "raw")
cube <- cuvis_get_cube(mesu)
dim(cube) # e.g., c(100, 100, 61)
attr(cube, "wavelengths") # wavelengths in nmYou can subset bands, compute means, or use standard R array operations:
vignette("cuvis-r-calibration") for the full
calibration workflow (dark/white references, reflectance
conversion)