spatial.perm: Random permutation of the scan-label of each voxel while...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

spatial.perm() takes a list of scans (arrays), randomly permute the scan labels of each voxel while keeping the spatial information intact. This function is used in rep.test(). flip() is a shortcut for pre/post analysis. diff.permed <- flip(pre - post) is equivalent to XY <- spatial.perm(pre, post); diff.permed <- XY[[1]] - XY[[2]].

Usage

1
2
3
spatial.perm(XYlist)

flip(diff.array)

Arguments

XYlist

Lists of multivariate samples to be spatially permuted. As an example, it can be a list of FA maps sampled from both groups. The elements in this list must be either R vectors or arrays.

diff.array

An array/vector of pre/post differences.

Details

Spatial permutations.

Value

A list of N-distances using different kernels (Ndist()) or an K by N dimensional matrix of N-distances (Ndist.perm()), where each row represents one permutation and each column a kernel.

Author(s)

Xing Qiu

See Also

sample, combn

Examples

1
2
3
4
5
6
7
8
9
## Generate some FA maps
N.x <- 64; N.y <- 64; N.z <- 3
for (i in 1:8) assign(paste("FA",i,sep=""), array(rnorm(N.x*N.y*N.z), c(N.x,N.y,N.z)))
Xlist <- list(FA1, FA2, FA3, FA4); Ylist <- list(FA5, FA6, FA7, FA8)

diff.orig <- FA2 -FA1 
diff.permed <- flip(diff.orig)

FAs.permed <- spatial.perm(c(Xlist, Ylist))

ygu427/iSPREADR documentation built on May 20, 2019, 4:37 p.m.