img_cov_matrix: Neighborhood Covariance Matrix

View source: R/img_cov_matrix.R

img_cov_matrixR Documentation

Neighborhood Covariance Matrix

Description

Calculates the neighborhood of multiple images, and then does the covariance of each neighbor with itself in the other imaging modality

Usage

img_cov_matrix(
  imgs,
  mask = NULL,
  radius = rep(1, 3),
  method = c("pearson", "spearman"),
  center = TRUE,
  scale = FALSE,
  verbose = TRUE
)

Arguments

imgs

list of images of class nifti, antsImage, character

mask

Binary image of class nifti, antsImage, character. Only neighborhoods inside the mask will be taken

radius

vector of length 3 for number of voxels to go in each direction. Default is 27 neighbors (including voxel at center). Passed to getNeighborhoodInMask.

method

Type of correlation. If pearson, scaling done on original data. If spearman, the ranks. If you want a covariance, you simply need to do scale = FALSE

center

Should the data be centered

scale

Should the data be scaled

verbose

print diagnostic messages

Value

List of matrix of covariances for each voxel and the order the columns are in.

#' @export

Note

Divisor is n - 1.


muschellij2/extrantsr documentation built on June 3, 2024, 7:04 p.m.