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