Description Usage Arguments Value Author(s) Examples
View source: R/SpatCorrImage.R
This function is to compute voxel-wise spatially varying correlation between two groups of 3D images
1 | comp_3D_images_corr(img_1, img_2, mask = NULL)
|
img_1 |
a 4D array of multiple 3D images |
img_2 |
a 4D array of multiple 3D images |
mask |
a 3D array of maske taking logicdal values. The default is NULL. |
a 3D array of the correlation maps
Jian Kang <jiankang@umich.edu>
1 2 3 4 5 6 7 8 9 10 11 12 | set.seed(1000)
dim_img = c(10,10,10)
n = 50
grids <- lapply(1:3,function(i) seq(-round(dim_img[i]/2)+1,round(dim_img[i]/2),length=dim_img[i]))
img_1 <- array(rnorm(prod(dim_img)*n),dim=c(dim_img,n))
img_2 <- array(rnorm(prod(dim_img)*n),dim=c(dim_img,n))
cor_region <- create_sphere_mask(grids,radius=2)
cor_region_list <- array(cor_region,dim=dim(img_2))
img_2 <- ifelse(cor_region_list,img_1+rnorm(prod(dim_img)*n,sd=0.5),img_2)
mask <- create_sphere_mask(grids,radius=4)
cor_map <- comp_3D_images_corr(img_1,img_2,mask)
plot_3D_image_slices(cor_map,grids,c(-2,2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.