# Create a simple 3D volume in LPI orientation
space <- NeuroSpace(c(10,10,10), c(2,2,2))
# Create a reoriented space in RAS orientation
space_ras <- reorient(space, c("R", "A", "S"))
# Convert coordinates between orientations
voxel_coords <- t(matrix(c(1,1,1)))
new_coords <- grid_to_grid(space_ras, voxel_coords)
print(new_coords)
Run the code above in your browser using DataLab