Get the offset vector
Examples
if (FALSE) { # \dontrun{
# For LatentNeuroVec:
if (!is.null(fmristore:::create_minimal_LatentNeuroVec)) {
lnv <- NULL
tryCatch({
lnv <- fmristore:::create_minimal_LatentNeuroVec(
space_dims = c(3L, 3L, 2L),
n_mask_voxels = 4L # Specify a small number of voxels in mask
)
off_vector <- offset(lnv)
print(head(off_vector))
# The LatentNeuroVec constructor (used by helper) defaults to zero offset.
# Length should be n_voxels_in_mask.
if (inherits(lnv, "LatentNeuroVec")) {
# Assuming lnv@mask is a LogicalNeuroVol created by the helper
# The offset vector length should match the number of TRUE voxels in the mask.
# print(length(off_vector) == sum(lnv@mask@.Data))
}
}, error = function(e) {
message("offset example for LatentNeuroVec failed: ", e$message)
})
} else {
message("Skipping offset example for LatentNeuroVec: helper not available.")
}
} # }