grid_to_coord | R Documentation |
Generic function to convert N-dimensional grid coordinates to real world coordinates
grid_to_coord(x, coords)
## S4 method for signature 'NeuroSpace,matrix'
grid_to_coord(x, coords)
## S4 method for signature 'NeuroSpace,matrix'
grid_to_coord(x, coords)
## S4 method for signature 'NeuroSpace,numeric'
grid_to_coord(x, coords)
## S4 method for signature 'NeuroVol,matrix'
grid_to_coord(x, coords)
x |
the object |
coords |
a matrix of grid coordinates |
A numeric matrix
of real-world coordinates.
# Create a simple 3D volume
bvol <- NeuroVol(array(0, c(10,10,10)), NeuroSpace(c(10,10,10), c(1,1,1)))
grid_coords <- matrix(c(1.5,1.5,1.5, 5.5,5.5,5.5), ncol=3, byrow=TRUE)
world <- grid_to_coord(bvol, grid_coords)
grid <- coord_to_grid(bvol, world)
all.equal(grid_coords, grid)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.