table.to.nii {nifti.io} | R Documentation |
Table to NII file
Description
Write Dataframe or Matrix to NII file
Usage
table.to.nii(in.table,
coords,
save.dir,
prefix=NULL,
do.log=TRUE,
model.string=NULL,
ref.nii=NULL,
img.dims=NULL,
pixdim=NULL,
orient=NULL)
Arguments
in.table |
dataframe or matrix object to output to NII file |
coords |
voxel coordinates of location in NII file to write values |
save.dir |
directory location to save output |
prefix |
prefix to be the base of filenames, default is the name of the input table object |
do.log |
logical, whether or not to write log file providing details about what the output contents are. this may be helpful for sorting through volumes. |
model.string |
A string to wirte to the log file specifying describing or specifying the model that was run |
ref.nii |
a reference NII image to draw image properties from (e.g., dimensions and orientation) |
img.dims |
voxel dimensions of target NII file |
pixdim |
voxel dimensions of NII output |
orient |
orientation list object of NII output |
Value
Output directly to log.text file and write to specified coordinates in a set of NII files.
Author(s)
Timothy R. Koscik <timothy-koscik@uiowa.edu>
Examples
# get filename for example NII file included in nifti.io package
ref.nii <- system.file("extdata", "egBrain.nii", package="nifti.io")
mdl <- lm(mpg ~ cyl, mtcars)
mdl.coef <- as.data.frame(summary(mdl)$coef)
table.to.nii(in.table=mdl.coef,
coords=c(20,35,20),
save.dir=tempdir(),
prefix="exampleModel_coef",
model.string="lm(mpg ~ cyl, mtcars)",
ref.nii=ref.nii)