Creates a rectangular region of interest on an HSI cube.
Arguments
- cube
An hsi_cube object.
- x_range
Numeric vector of length 2 (column indices, min and max).
- y_range
Numeric vector of length 2 (row indices, min and max).
Examples
cube <- hs_example_cube()
roi <- hs_roi_rect(cube, x_range = c(5, 15), y_range = c(5, 15))
sum(roi$mask)
#> [1] 121