Description Usage Arguments Details Value Examples
Convert observations stored in the array format into the data.frame format.
1 2 |
array |
the array that should be converted into a data.frame. array or matrix. REQUIRED. |
coords |
the spatial coordinates of the observations contained in |
name_newparam |
the name of the contrast parameter to which cooresponds |
names_coords |
the name of the coordinates. character vector. |
na.rm |
should observations with missing values be removed ? logical. |
ARGUMENTS :
If coords is set to NULL, the coordinates will be defined by the position of the observations in array.
If na.rm is set to TRUE, the coord argument will only contains the coordinates of the non-NA observations of array.
A dataframe with in columns the coordinates and the parameter values, and in rows the observations.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
## load a NIFTI file (array format)
path.Pat1 <- system.file(file.path("nifti"), package = "MRIaggr")
nifti.Pat1_TTP_t0 <- readMRI(file.path(path.Pat1, "TTP_t0"), format = "nifti")
dim(nifti.Pat1_TTP_t0)
## conversion to data frame format
res128 <- array2dt(array = nifti.Pat1_TTP_t0, name_newparam = "TTP_t0")
dim(res128)
head(res128)
## conversion to data frame format with specific coordinates
res256 <- array2dt(array = nifti.Pat1_TTP_t0, name_newparam = "TTP_t0",
coords = expand.grid(129:206, 129:228, 1:3, 1))
dim(res256)
head(res256)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.