Resamples an antsImage or nifti object

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

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

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

# S4 method for 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

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
#> NIfTI-1 format #> Type : nifti #> Data Type : 16 (FLOAT32) #> Bits per Pixel : 32 #> Slice Code : 0 (Unknown) #> Intent Code : 0 (None) #> Qform Code : 1 (Scanner_Anat) #> Sform Code : 0 (Unknown) #> Dimension : 60 x 60 x 60 #> Pixel Dimension : 0.5 x 0.5 x 0.5 #> Voxel Units : mm #> Time Units : Unknown