vwnrfs.predict: voxelwise neighborhood random forest prediction

Description Usage Arguments Value Author(s) Examples

View source: R/vwnrfs.R

Description

Takes a model created with vwnrfs and builds a prediction based on similar features used to train vwnrfs

Usage

1
2
3
4
5
6
7
8
9
vwnrfs.predict(
  rfm,
  x,
  labelmasks,
  rad = NA,
  asFactors = TRUE,
  voxchunk = 30000,
  reduceFactor = 1
)

Arguments

rfm

random forest model trained with vwnrfs with certain number of features.

x

a list of lists. Each list contains the list of feature images required to predict a response or an image. The features must be the same used during training. I.e., if you train on T1 and T2 images, those should be the same features used for prediction, in the same exact order for each subject.

labelmasks

a list of masks where each mask defines the space to predict from. These can be individual masks for each subject (i.e., custom brain masks) or a single antsImage that will be used for all subjects.

rad

vector of dimensionality d define the neighborhood radius. Must be the same radius with which the model was trained, i.e., c(1,1,1)

asFactors

boolean - treat the y entries as factors. If this is true, the prediction will be a classification, and the output will produce images. If this is false, the prediction will be a regression, and the output will produce a single response value.

voxchunk

value of maximal voxels to predict at once. This value is used to split the prediction into smaller chunks such that memory requirements do not become too big.

reduceFactor

value of resolution reduction (i.e., for 1mm voxels and reduceFactor=3) the model will be trained on ~3mm images.

Value

list a 2-list with the rf model, training vector, feature matrix and the random mask

Author(s)

Pustina D

Examples

1
2
3
4
5
## Do not run
## vwnrfs.predict(rfm, x=x, labelmasks=labelmasks,
## rad=rad, asFactors=TRUE, voxchunk=voxchunk,
## reduceFactor = mr)mask<-makeImage( c(10,10), 0 )
## End do not run

neuroconductor-devel/ANTsR documentation built on April 1, 2021, 1:02 p.m.