normalize_image: Normalize Image Based on the Peak

Description Usage Arguments Value Examples

View source: R/normalize_image.R

Description

Normalize Image Based on the Peak

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
normalize_image(
  vol,
  contrast = c("T1", "PD", "T2", "FLAIR", "FL"),
  peak_estimator = c("Python", "R"),
  verbose = TRUE
)

image_peak(vol, contrast = c("T1", "PD", "T2", "FLAIR", "FL"), verbose = TRUE)

flexconn_image_peak(
  vol,
  contrast = c("T1", "PD", "T2", "FLAIR", "FL"),
  verbose = TRUE
)

Arguments

vol

3D array or nifti image

contrast

What imaging sequence of MRI is this volume

peak_estimator

Which functions to use to estimate peak, either wrapper Python code or native R code.

verbose

print diagnostic messages

Value

The peak of the image is returned for image_peak and the normalized image in normalize_image

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
user = Sys.getenv("USER")
if (user %in% c("johnmuschelli", "travis") &
Sys.info()["sysname"] == "Darwin"){
reticulate::use_python(paste0(
"/Library/Frameworks/Python.framework/Versions/3.5/bin/python3"))
} else {
python = system("which python", intern = TRUE)
print(python)
reticulate::use_python(python)
}
set.seed(1)
vol = array(rpois(10^3, lambda = 10), dim = rep(10, 3))
vol[ vol < 6] = 0
normed = normalize_image(vol, "T1")

neuroconductor-releases/flexconn documentation built on Nov. 14, 2020, 11:54 p.m.