# Create a simple 3D volume
space <- NeuroSpace(c(10,10,10), c(1,1,1))
vol <- NeuroVol(array(rnorm(10*10*10), c(10,10,10)), space)
# Get all slices along the z-axis
slc <- slices(vol)
# Number of slices equals the z dimension
length(slc) == dim(vol)[3]
# Each slice is a 2D matrix
dim(slc[[1]]) == c(10,10)
Run the code above in your browser using DataLab