Description Usage Arguments Value Note Examples
Get Patches from T1 and FLAIR image
1 2 3 4 5 6 7 8 9 10 11 12 13 |
t1 |
3D array or |
flair |
3D array or |
t2 |
3D array or |
mask |
binary 3D array or |
patchsize |
Vector of length 2 (or more) |
pad |
Run |
normalize |
Run |
verbose |
print diagnostic messages |
only_patches |
Only return the patches, not additional information. |
seed |
Seed for random sampling of indices. If |
... |
additional arguments to pass to
|
A list of T1, FLAIR, and Mask Patches
If mask = NULL
, a mask will be created based on
voxels greater than the 75th percentile of the FLAIR image.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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)
}
library(neurobase)
fname = system.file("extdata", "MPRAGE.nii.gz", package = "flexconn")
t1 = readnii(fname)
fname = system.file("extdata", "FLAIR.nii.gz", package = "flexconn")
flair = readnii(fname)
patchsize = c(3, 3)
verbose = TRUE
patch = get_patches(t1, flair, mask = NULL, patchsize = patchsize)
rm(patch)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.