resample_image-methods: Resample an image

Description Usage Arguments Value Examples

Description

Resamples an antsImage or nifti object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
resample_image(
  img,
  parameters,
  parameter_type = c("mm", "voxels"),
  interpolator = c("nearestneighbor", "linear", "gaussian", "windowedsinc", "bspline"),
  ...
)

## S4 method for signature 'character'
resample_image(
  img,
  parameters,
  parameter_type = c("mm", "voxels"),
  interpolator = c("nearestneighbor", "linear", "gaussian", "windowedsinc", "bspline"),
  ...
)

## S4 method for signature 'nifti'
resample_image(
  img,
  parameters,
  parameter_type = c("mm", "voxels"),
  interpolator = c("nearestneighbor", "linear", "gaussian", "windowedsinc", "bspline"),
  ...
)

## S4 method for signature 'antsImage'
resample_image(
  img,
  parameters,
  parameter_type = c("mm", "voxels"),
  interpolator = c("nearestneighbor", "linear", "gaussian", "windowedsinc", "bspline"),
  ...
)

.resample_image(
  img,
  parameters,
  parameter_type = c("mm", "voxels"),
  interpolator = c("nearestneighbor", "linear", "gaussian", "windowedsinc", "bspline")
)

Arguments

img

character path of image or an object of class nifti, or antsImage

parameters

parameters to pass as resampleParams in resampleImage

parameter_type

Are the parameters in units of voxels or millimeters (mm)

interpolator

what type of interpolation should be done

...

not currently used

Value

An antsImage or nifti depending on input

Examples

1
2
3
4
5
6
library(oro.nifti)
library(extrantsr)
n = 30
x = nifti(array(rnorm(n^3*10), dim = c(n, n, n)))
res = resample_image(x, parameters = c(0.5, 0.5, 0.5))
res

neuroconductor/extrantsr documentation built on Sept. 28, 2020, 11:31 a.m.