Lazily transform a frame into a new feature domain
Examples
parent <- volume_space(c(2, 2, 1), support = 1:4, template = "toy")
frame <- fmri_frame(
assays = list(signal = matrix(1:12, nrow = 3)),
observations = data.frame(.obs_id = paste0("o", 1:3)),
space = parent
)
parcels <- parcel_space(
parent,
parcel_ids = c("left", "right"),
membership = Matrix::sparseMatrix(
i = 1:4, j = c(1L, 1L, 2L, 2L), x = 1, dims = c(4L, 2L)
),
atlas = "toy-atlas"
)
parcel_frame <- map_features(frame, target = parcels)
dim(collect_assay(parcel_frame))
#> [1] 3 2