Spat_Corr_images: Spatially varying correlation analysis between two groups of...

Description Usage Arguments Value Author(s) References Examples

View source: R/SpatCorrImage.R

Description

This function is to estimate and test voxel-wise spatially varying correlation between two groups of 3D images

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
Spat_Corr_images(
  img_1,
  img_2,
  coords,
  voxel_neighbors,
  mask = NULL,
  rho_list = sort(c(0, seq(-0.95, 0.95, length = 100))),
  adj_dist = 1,
  size = 5,
  n_cor = 0.9,
  pos_prob = 0.8,
  neg_prob = 0.8,
  est_cormat = TRUE
)

Arguments

img_1

a V by n matrix for n images with V voxels

img_2

a V by n matrix for n images with V voxels

coords

a V by d matrix of coordinates of the d-dimensional image #'@param voxel_neighbors a list object contains two matrices: idx and dist. idx contains the neighbor indices of each voxel in each row. dist contains the distances between neightbors and the voxel in each row.

mask

a vector of length V for the mask taking logical values. The default is NULL.

rho_list

a vector of correlation values to be tested.

adj_dist

the distance of adjacent nodes.

size

the minimum clutersize.

n_cor

the correlation between neighboring voxels for smoothing.

pos_prob

positive correlation cluster threshold probablity.

neg_prob

negative correlation cluster threshold probablity.

est_cormat

TRUE or FALSE indicating that whether a minimum contrast method is used to estimate the spatial correlations within each imaging modality. Default is TRUE

Value

a list of objects containing all the results

cor_img

A correlation map

smooth_cor_est

A smoothed correlation map

pos_cluster

A logical image for all clusters with positive correlation

neg_cluster

A logical image for all clusters with negative correlation

neg_group

A list of voxel indices for all clusters with negative correlation

pos_group

A list of voxel indices for all clusters with positive correlation

all_group

A list of voxel indices for all clusters

simple_est_all

A vector of mean correlation estimates within clusters

mle_all

A list objects of the MLEs and likelihood ratio tests results

tab

A summary of results

dat_1

preprocessed images for img_1 with each raw representing one image in vector format

dat_2

preprocessed images for img_2 with each raw representing one image in vector format

coords

locations for all voxels

Author(s)

Jian Kang <jiankang@umich.edu>

References

Li L, Kang J, Lockhart SN, Adams J, Jagust WJ. (2019) Spatially adaptive varying correlation analysis for multimodal neuroimaging data. IEEE Trans Med Imaging. 38(1):113-123. PMCID: PMC6324929

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
set.seed(1000)
dim_img = c(10,10,10)
num_voxels = prod(dim_img)
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(num_voxels*n),dim=c(num_voxels,n))
img_2 <- array(rnorm(num_voxels*n),dim=c(num_voxels,n))
cor_region <- create_sphere_mask(grids,radius=3)
cor_region_list <- array(cor_region,dim=dim(img_2))
img_2 <- ifelse(cor_region_list,img_1+rnorm(num_voxels*n,sd=0.5),img_2)
mask <- c(create_sphere_mask(grids,radius=5))
cor_img <- comp_images_corr(img_1,img_2,mask)
plot_3D_image_slices(array(cor_img,dim=dim_img),grids,c(-2,2))
voxel_neighbors <- find_image_neighbors(grids)
coords <- expand.grid(grids)
res <- Spat_Corr_images(img_1,img_2,coords,voxel_neighbors,mask=mask,pos_prob=0.90,neg_prob=0.90,n_cor=0.5,size=10)
plot_3D_image_slices(list(cor=array(res$cor_img,dim=dim_img),
smooth_cor=array(res$smooth_cor_est,dim=dim_img),
pos_cluster=array(res$pos_cluster,dim=dim_img)),grids,c(-3,3))

kangjian2016/SpatCorrImage documentation built on Oct. 22, 2021, 1:21 a.m.