Learn R Programming

fslr (version 2.25.3)

fsl_resample: Resample an Image to Specific Voxel Size

Description

Resample an Image to Specific Voxel Size

Usage

fsl_resample(
  file,
  voxel_size,
  outfile = NULL,
  retimg = TRUE,
  reorient = FALSE,
  opts = NULL,
  verbose = TRUE
)

Value

If retimg then object of class nifti. Otherwise, the output file.

Arguments

file

Input file to resample

voxel_size

Voxel size (in mm). This should be a scalar number.

outfile

(character) output filename

retimg

(logical) return image of class nifti

reorient

(logical) If retimg, should file be reoriented when read in? Passed to readnii.

opts

options to pass to flirt

verbose

(logical) print out command before running

Examples

Run this code
if (have_fsl()) {
file = mni_fname(mm = 1, brain = TRUE)
est2 = fsl_resample(file = file, voxel_size = 1, retimg = FALSE)
pixdim(est2)
est = fsl_resample(file = file, voxel_size = 1)
pixdim(est)
}

Run the code above in your browser using DataLab