predict_flexconn: Predict from FLEXCONN model

Description Usage Arguments Value Examples

View source: R/predict_flexconn.R

Description

Predict from FLEXCONN model

Usage

1
2
3
predict_flexconn(t1, flair, t2 = NULL, outdir = NULL, gpu = "cpu",
  normalize = TRUE, num_atlases = c("21", "61"),
  outcomes = c("mask1", "mask2"), verbose = TRUE)

Arguments

t1

T1-weighted image to predict from: skullstripped, bias-corrected). Since the training is 2D, make sure the test image is properly oriented, i.e. the in-plane has the highest native resolution. E.g. the training images are axial because their native resolution is 1x1x4mm^3 in axial RAI orientation.

flair

FLAIR image to predict from, must be registered to T1 and have same orientation as T1

t2

(optional) T2 image to predict from, must be registered to T1 and have same orientation as T1

outdir

Output directory for predictions

gpu

Either an integer for the GPU. Use "cpu" to use CPU.

normalize

Should the images be normalized?

num_atlases

Specifies which model to use. Determined by the number of atlases in the FLEXCONN model.

outcomes

The outcome used to train the model, from rater 1 or rater 2

verbose

Print diagnostic messages

Value

A vector of filenames

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# predict_flexconn(python_cmd = "python3)
library(reticulate)
## Not run: 
reticulate::use_python("/Library/Frameworks/Python.framework/Versions/3.5/bin/python3")
# reticulate::use_python("python3")

flair = system.file("extdata", "FLAIR.nii.gz", package = "flexconnr")
t1 = system.file("extdata", "T1.nii.gz", package = "flexconnr")
pp = predict_flexconn(t1 = t1, flair = flair)
# result = RNifti::readNifti(pp[2])

## End(Not run)

muschellij2/flexconnr documentation built on May 14, 2019, 11:13 a.m.