Skip to contents

Convenience wrapper around resample that maps human-friendly method names to the integer interpolation argument and (eventually) switches engines.

Usage

resample_to(source, target, method = c("nearest","linear","cubic"),
            engine = c("internal"), ...)

Arguments

source

A NeuroVol

target

A NeuroVol or NeuroSpace

method

Interpolation method: "nearest", "linear", or "cubic".

engine

Resampling engine. Currently only "internal" is supported.

...

Reserved for future options

Value

A NeuroVol in the target space.

See also

Examples

img <- read_vol(system.file("extdata","global_mask_v4.nii", package="neuroim2"))
sp  <- space(img); sp2 <- NeuroSpace(sp@dim*2, sp@spacing/2, origin=sp@origin, trans=trans(img))
r1  <- resample_to(img, sp2, method = "linear")