View source: R/transforms_convert.R
| transform2voxel | R Documentation |
The inverse operation of transform2world: given a transformation that operates
on world coordinates, compute the matrix that maps voxel indices of one volume to voxel indices of another.
The result can be saved as an FSL matrix, see write.fs.transform.fslmat.
transform2voxel(tf, src = NULL, dst = NULL)
tf |
an |
src |
|
dst |
|
an fs.transform instance whose matrix operates on (zero-based) voxel coordinates.
Other header coordinate space:
invert.fs.transform(),
is.fs.transform(),
mghheader.is.ras.valid(),
mghheader.ras2vox(),
mghheader.ras2vox.tkreg(),
mghheader.scanner2tkreg(),
mghheader.tkreg2scanner(),
mghheader.vox2ras(),
mghheader.vox2ras.tkreg(),
print.fs.transform(),
read.fs.transform(),
read.fs.transform.dat(),
read.fs.transform.fslmat(),
read.fs.transform.itk(),
read.fs.transform.lta(),
read.fs.transform.xfm(),
sm0to1(),
sm1to0(),
summary.fs.transform(),
transform2lps(),
transform2ras(),
transform2world(),
write.fs.transform(),
write.fs.transform.dat(),
write.fs.transform.fslmat(),
write.fs.transform.itk(),
write.fs.transform.lta(),
write.fs.transform.xfm()
lta_file <- system.file("extdata", "talairach.lta", package = "freesurferformats", mustWork = TRUE)
tf_world <- transform2world(read.fs.transform(lta_file))
tf_voxel <- transform2voxel(tf_world)
max(abs(tf_voxel$matrix - read.fs.transform(lta_file)$matrix)) # back where we started
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.