resample_to_target-methods | R Documentation |
Resamples an antsImage
or
nifti
object to a target
resample_to_target(
img,
target,
interpolator = c("linear", "nearestNeighbor", "multiLabel", "gaussian", "bSpline",
"cosineWindowedSinc", "welchWindowedSinc", "hammingWindowedSinc",
"lanczosWindowedSinc", "genericLabel"),
copy_origin = FALSE,
...
)
## S4 method for signature 'character'
resample_to_target(
img,
target,
interpolator = c("linear", "nearestNeighbor", "multiLabel", "gaussian", "bSpline",
"cosineWindowedSinc", "welchWindowedSinc", "hammingWindowedSinc",
"lanczosWindowedSinc", "genericLabel"),
copy_origin = FALSE,
...
)
## S4 method for signature 'nifti'
resample_to_target(
img,
target,
interpolator = c("linear", "nearestNeighbor", "multiLabel", "gaussian", "bSpline",
"cosineWindowedSinc", "welchWindowedSinc", "hammingWindowedSinc",
"lanczosWindowedSinc", "genericLabel"),
copy_origin = FALSE,
...
)
## S4 method for signature 'antsImage'
resample_to_target(
img,
target,
interpolator = c("linear", "nearestNeighbor", "multiLabel", "gaussian", "bSpline",
"cosineWindowedSinc", "welchWindowedSinc", "hammingWindowedSinc",
"lanczosWindowedSinc", "genericLabel"),
copy_origin = FALSE,
...
)
.resample_to_target(
img,
target,
interpolator = c("linear", "nearestNeighbor", "multiLabel", "gaussian", "bSpline",
"cosineWindowedSinc", "welchWindowedSinc", "hammingWindowedSinc",
"lanczosWindowedSinc", "genericLabel"),
copy_origin = FALSE,
...
)
img |
character path of image or an object of class nifti, or antsImage |
target |
image of reference,
the output will be in this space.
Will be coerced using |
interpolator |
what type of interpolation should be done |
copy_origin |
Copy image origin from |
... |
additional arguments to pass to
|
An antsImage
or nifti
depending on
input
library(oro.nifti)
library(extrantsr)
n = 30
x = nifti(array(rnorm(n^3*10), dim = c(n, n, n)))
new_pixdim = c(0.5, 0.5, 0.5)
res = resample_image(x, parameters = new_pixdim)
x2 = resample_to_target(x, res)
pixdim(x2)[2:4]
stopifnot(all(pixdim(x2)[2:4] == new_pixdim))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.