multichannelPCA: Shape analysis of multichannel images based on PCA

Description Usage Arguments Value Author(s) Examples

View source: R/multichannelPCA.R

Description

Converts a set of multichannel images (e.g. deformation fields ) to a matrix to enable various forms of PCA. Returns the components of shape variability and variance explained. May employ different decomposition methods (WIP).

Usage

1
2
multichannelPCA(x, mask, k = NA, pcaOption = "PCA", auxiliaryModality,
  center = TRUE, sigma = NA, verbose = FALSE)

Arguments

x

list containing multichannel images all of the same size

mask

mask to apply to the multichannel images

k

rank to use

pcaOption

currently only PCA and randPCA, latter being much faster. We also allow fastICA.

auxiliaryModality

if you pass this matrix, then will do CCA. This will only work with one option.

center

subtract the mean column vector.

sigma

parameter for kernel PCA.

verbose

produces more explanatory output.

Value

list of the pca output and conversion to multichannel images

Author(s)

Avants BB

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
img1 = antsImageRead( getANTsRData( "r16" ) ) %>%
  resampleImage( c(4,4) )
img2 = antsImageRead( getANTsRData( "r64" ) ) %>%
  resampleImage( c(4,4) )
img3 = antsImageRead( getANTsRData( "r27" ) ) %>%
  resampleImage( c(4,4) )
img4 = antsImageRead( getANTsRData( "r30" ) ) %>%
  resampleImage( c(4,4) )
reg1 = antsRegistration( img1, img2, 'SyN' )
reg2 = antsRegistration( img1, img3, 'SyN' )
reg3 = antsRegistration( img1, img4, 'SyN' )
w1 = antsImageRead( reg1$fwdtransforms[1] )
w2 = antsImageRead( reg2$fwdtransforms[1] )
w3 = antsImageRead( reg3$fwdtransforms[1] )
mask = getMask( img1 )
x = list( w1, w2, w3 )
dpca = multichannelPCA( x, mask )
warpTx = antsrTransformFromDisplacementField( dpca$pcaWarps[[1]] )
warped = applyAntsrTransform( warpTx, data = img1, reference = img1)

neuroconductor-devel/ANTsR documentation built on Jan. 29, 2019, 9:30 p.m.