# Create a simple spherical mask
dims <- c(32, 32, 20)
mask_array <- array(FALSE, dims)
center <- dims / 2
for (i in 1:dims[1]) {
for (j in 1:dims[2]) {
for (k in 1:dims[3]) {
if (sum(((c(i,j,k) - center) / (dims/3))^2) <= 1) {
mask_array[i,j,k] <- TRUE
}
}
}
}
mask <- NeuroVol(mask_array, NeuroSpace(dims, c(3,3,3)))
# Simulate 100 time points
sim_data <- simulate_fmri(mask, n_time = 100, seed = 42)
# Check dimensions
dim(sim_data) # Should be c(32, 32, 20, 100)
Run the code above in your browser using DataLab