Learn R Programming

ANTsR (version 0.3.1)

antsSpatialICAfMRI: Perform spatial ICA on fMRI bold data.

Description

Perform spatial ICA on group or individual fMRI data. Preprocessing should be performed prior to calling this function (cf preprocessfMRI.R).

Usage

antsSpatialICAfMRI(boldImages, maskImage = NA, numberOfICAComponents = 20,
  normalizeComponentImages = TRUE)

Arguments

boldImages

a list of 4-D ANTs image fMRI data.

maskImage

A 3-D ANTs image defining the region of interest. This must be specified.

numberOfICAComponents

Number of estimated observers (components).

normalizeComponentImages

Boolean to specify whether each component vector element is normalized to its z-score.

Value

Output list includes standard ICA matrices from the fastICA algorithm:

X = pre-processed data matrix

K = pre-whitening matrix that projects data onto the first n.comp principal components

W = estimated un-mixing matrix (see definition in details)

A = estimated mixing matrix

S = estimated source matrix

and the component images.

Examples

Run this code
# NOT RUN {
set.seed( 123 )
boldImages <- list()
n=16
nvox <- n*n*n*12
dims <- c(n,n,n,12)
boldImages[[1]] <- makeImage( dims , rnorm( nvox )+500 )
boldImages[[2]] <- makeImage( dims , rnorm( nvox )+500 )
boldImages[[3]] <- makeImage( dims , rnorm( nvox )+500 )

cleanBoldImages <- list()
for( i in 1:length( boldImages ) )
  {
  fmri <- preprocessfMRI( boldImages[[i]], residualizeMatrix=FALSE )
  if( i == 1 ) maskImage <- fmri$maskImage
  cleanBoldImages[[i]] <- fmri$cleanBoldImage
  }

icaResults <- antsSpatialICAfMRI( cleanBoldImages, maskImage,
  numberOfICAComponents = 2 )
# }

Run the code above in your browser using DataLab