Performs SPM12 realignment estimation and reslicing on an Image
build_spm12_realign(
filename,
time_points = NULL,
fwhm = 5,
quality = 0.9,
separation = 4,
register_to = c("first", "mean"),
est_interp = c("bspline2", "trilinear", paste0("bspline", 3:7)),
wrap_x = FALSE,
wrap_y = FALSE,
wrap_z = FALSE,
weight_image = NULL,
reslice = c("all+mean", "all", "2:n", "mean"),
reslice_interp = c("bspline4", "nearestneighbor", "trilinear", paste0("bspline",
2:3), paste0("bspline", 5:7), "fourier"),
mask = FALSE,
prefix = "r",
verbose = TRUE,
...
)spm12_realign(
...,
add_spm_dir = TRUE,
spmdir = spm_dir(verbose = verbose, install_dir = install_dir),
clean = TRUE,
retimg = FALSE,
reorient = FALSE,
verbose = TRUE,
outdir = NULL,
install_dir = NULL
)
Files to be realigned and resliced
A vector of time points to run realignment,
If filename
is a
4D file, then will do all the time points. Otherwise,
filename
must be a character
vector of 3D files or a list of 3D nifti objects.
Full-Width Half Max to smooth. Gaussian smoothing to apply to the 256x256 joint histogram.
Quality versus speed trade-off. Highest quality (1) gives most precise results, whereas lower qualities gives faster realignment.
The average distance between sampled points (in mm). Can be a vector to allow a coarse registration followed by increasingly fine
Should the files be registered to the first or the mean
Interpolator for estimation
wrap in x-direction
wrap in y-direction
wrap in z-direction
weighting image to weight each voxel of the reference image during estimation. The weights are proportional to the inverses of the standard deviations. May be used when there is a lot of motion.
Options for reslicing all - all images in filename, 2:n - all images in filename 2:length(filename), all+mean - all images and the mean, mean - mean only
Interpolator for reslicing
Mask the data. With masking enabled, the program searches through the whole time series looking for voxels which need to be sampled from outside the original images. Where this occurs, that voxel is set to zero for the whole set of images
Prefix to append to front of image filename
Print diagnostic messages
Arguments passed to run_spm12_script
Add SPM12 directory from this package
SPM dir to add, will use package default directory
Remove scripts from temporary directory after running
(logical) return image of class nifti
(logical) If retimg, should file be reoriented when read in?
Directory to copy results.
If full filename given, then results will
be in dirname(filename)
directory to download SPM12
List of output files, the matlabbatch
object,
and the script
# NOT RUN {
dims = rep(10, 4)
temp_nii = array(rnorm(prod(dims)), dim = dims)
temp_nii = oro.nifti::nifti(temp_nii)
res = build_spm12_realign(temp_nii)
# }
Run the code above in your browser using DataLab