Reads a multi-band TIFF file as a hyperspectral cube. Requires the terra
package for TIFF reading.
Value
An hsi_cube object.
Examples
# \donttest{
if (requireNamespace("terra", quietly = TRUE)) {
cube <- hs_example_cube()
path <- file.path(tempdir(), "example_cube.tif")
hs_write_tiff(cube, path, verbose = FALSE)
back <- hs_read_tiff(path, wavelengths = cube$wavelengths, verbose = FALSE)
dim(back)
}
#> [1] 30 30 61
# }