# Transform points between voxel and “world” coordinates

### Description

These functions are used to transform points from dimensionless pixel or
voxel coordinates to “real-world” coordinates, typically in millimetres,
and back. Actual pixel units can be obtained using the
`pixunits`

function.

### Usage

1 2 3 | ```
voxelToWorld(points, image, simple = FALSE, ...)
worldToVoxel(points, image, simple = FALSE, ...)
``` |

### Arguments

`points` |
A vector giving the coordinates of a point, or a matrix with one point per row. |

`image` |
The image in whose space the points are given. |

`simple` |
A logical value: if |

`...` |
Additional arguments to |

### Value

A vector or matrix of transformed points.

### Note

Voxel coordinates are assumed by these functions to use R's indexing convention, beginning from 1.

### Author(s)

Jon Clayden <code@clayden.org>

### See Also

`xform`

, `pixdim`

, `pixunits`

### Examples

1 2 3 4 | ```
im <- readNifti(system.file("extdata", "example.nii.gz", package="RNifti"))
# Find the origin
worldToVoxel(c(0,0,0), im)
``` |

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.