ants_resample_image {rpyANTs} | R Documentation |
Resample image
Description
See ants$resample_image
for more details
Usage
ants_resample_image(
x,
resample_params,
use_voxels = FALSE,
interp_type = c("linear", "nn", "guassian", "sinc", "bspline")
)
Arguments
x |
input image |
resample_params |
either relative number or absolute integers |
use_voxels |
whether the |
interp_type |
interpolation type; either integer or character; see 'Usage' for available options |
Value
Resampled image
Examples
if(interactive() && ants_available()) {
ants <- load_ants()
fi <- as_ANTsImage(ants$get_ants_data("r16"))
# linear (interp_type = 0 or "linear)
filin <- ants_resample_image(fi, c(50, 60), TRUE, "linear")
# nearest neighbor (interp_type = 1 or "nn)
finn <- ants_resample_image(fi, c(50, 60), TRUE, "nn")
par(mfrow = c(1, 3), mar = c(0, 0, 0, 0))
pal <- gray.colors(256, start = 0)
image(fi[], asp = 1, axes = FALSE,
ylim = c(1,0), col = pal)
image(filin[], asp = 1, axes = FALSE,
ylim = c(1,0), col = pal)
image(finn[], asp = 1, axes = FALSE,
ylim = c(1,0), col = pal)
}
[Package rpyANTs version 0.0.3 Index]