I do not remember if we had a reason to throwing errors when the input of image/label elements are just single arrays.
|
rgb <- \(n) sample(seq_len(255), n, replace=TRUE) |
|
mat <- array(rgb(3*20*20), dim=c(3,20,20)) |
|
# invalid |
|
expect_error(SpatialDataImage(mat)) |
A single 3 dimensional array (or 2 for labels) should be a reasonable input.
I do not remember if we had a reason to throwing errors when the input of image/label elements are just single arrays.
spatialdataR/tests/testthat/test-sdarray.R
Lines 25 to 28 in 772f956
A single 3 dimensional array (or 2 for labels) should be a reasonable input.