Description Usage Arguments Value Examples
Get Patches from 3D Volume
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | get_patch_from_volume(
vol,
mask = NULL,
patchsize,
verbose = TRUE,
pad = TRUE,
normalize = TRUE,
contrast,
seed = NULL,
run_mask_patches = TRUE,
peak_estimator = c("Python", "R"),
...
)
get_num_patches(mask)
norm_pad(
vol,
mask = NULL,
patchsize,
verbose = TRUE,
pad = TRUE,
normalize = TRUE,
peak_estimator = c("Python", "R"),
contrast
)
get_mask_patches(mask, patchsize, pad = TRUE, seed = NULL, verbose = TRUE)
|
vol |
3D array or |
mask |
binary 3D array or |
patchsize |
Vector of length 2 (or more) |
verbose |
print diagnostic messages |
pad |
Run |
normalize |
Run |
contrast |
What imaging sequence of MRI is this volume, passed
to |
seed |
Seed for random sampling of indices. If |
run_mask_patches |
Should the patches for the mask be made as well? |
peak_estimator |
Which functions to use to estimate peak, either wrapper Python code or native R code. |
... |
not used |
A list of image and mask Patches
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | user = Sys.getenv("USER")
if (user == "johnmuschelli") {
reticulate::use_python(paste0(
"/Library/Frameworks/Python.framework/Versions/3.5/bin/python3"))
mpl = reticulate::import("matplotlib")
mpl$use('TkAgg')
}
library(neurobase)
fname = system.file("extdata", "MPRAGE.nii.gz", package = "flexconn")
vol = readnii(fname)
mask = vol > 0
patchsize = c(5, 5)
verbose = TRUE
patch = get_patch_from_volume(vol, mask, patchsize = patchsize,
contrast = "T1")
rm(patch)
patch = get_patch_from_volume(vol, mask, patchsize = c(1,1,1),
contrast = "T1")
rm(patch)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.