Description Usage Arguments Value See Also Examples
Standardizes an image either by the axial, sagittal, or coronal slice or whole image
1 2 3 4 5 6 7 8 9 10 11 12 13  | 
img | 
 character path of image or an object of class nifti  | 
mask | 
 character path of mask or an object of class nifti  | 
margin | 
 Margin of image to z-score over (  | 
centrality | 
 (character) Measure to center the data, either mean or median  | 
variability | 
 (character) Measure to scale the data  | 
trim | 
 if centrality is   | 
remove.na | 
 (logical) change NAs to remove.val  | 
remove.nan | 
 (logical) change NaN to remove.val  | 
remove.inf | 
 (logical) change Inf to remove.val  | 
remove.val | 
 (logical) value to put the NA/NaN/Inf  | 
remask | 
 (logical) Should the image be remasked after normalizing?  | 
Array of object of class nifti
aperm
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32  | dim = c(100, 30, 5)
img = array(rnorm(prod(dim), mean=4, sd=4), 
dim=dim)
truth2 = img
for (i in 1:dim(img)[2]) {
truth2[,i,] = (truth2[,i,]- mean(truth2[,i,]))/sd(truth2[,i,])
}
truth1 = img
for (i in 1:dim(img)[1]) {
truth1[i,,] = (truth1[i,,]- mean(truth1[i,,]))/sd(truth1[i,,])
}
truth3 = img
for (i in 1:dim(img)[3]) {
truth3[,,i] = (truth3[,,i]- mean(truth3[,,i]))/sd(truth3[,,i])
}
try3 = zscore_img(img, margin=3)
stopifnot(all.equal(try3, truth3))
try2 = zscore_img(img, margin=2)
stopifnot(all.equal(try2, truth2))
try1 = zscore_img(img, margin=1)
stopifnot(all.equal(try1, truth1))
  
z = zscore_img(img, margin=NULL)
ztrim = zscore_img(img, margin=NULL, 
centrality = "trimmed_mean", variability = "trimmed_sd")
z = zscore_img(img, centrality = "median", variability = "iqr")
z = zscore_img(img, centrality = "median", variability = "iqrdiff")
z = zscore_img(img, centrality = "median", variability = "maddiff")
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.