voxel_selection: Voxel Selection Procedure

Description Usage Arguments Value Examples

View source: R/voxel_selection.R

Description

This function creates a binary mask for the voxel selection procedure for OASIS.

Usage

1
2
3
4
voxel_selection(flair, brain_mask, cutoff)

voxel_selection_with_erosion(flair, brain_mask, verbose = TRUE,
  eroder = c("fsl", "oasis"))

Arguments

flair

FLAIR volume of class nifti

brain_mask

brain mask of class nifti

cutoff

the percentile cutoff for the thresholding, passed to quantile

verbose

print diagnostic output

eroder

Should fslerode or oasis_erode be used

Value

Returns the voxel selection mask as an object of class nifti.

Examples

 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
library(neurobase)
library(fslr)
library(oasis)
niis = tempfile(fileext = ".nii.gz")
if (require(httr)) {
   url = paste0("https://s3.us-east-2.amazonaws.com/brainder/software/",
   "flair/templates/GG-853-FLAIR-2.0mm.nii.gz")
   req <- httr::GET(url,
   httr::write_disk(path = niis))
   httr::stop_for_status(req)

 flair <- readnii(niis)
 if (have.fsl()) {
   brain_mask = fslbet(niis) > 0
 } else {
   ind = list(c(10L, 81L), c(12L, 101L), c(3L, 78L))
   all.ind = lapply(ind, function(x) seq(x[1], x[2]))
   brain_mask = niftiarr(flair, 0)
   eg = expand.grid(all.ind)
   eg = as.matrix(eg)
   brain_mask[eg] = 1
 }
 voxel_selection_mask <- voxel_selection(flair,
   brain_mask, cutoff = .85)
}

oasis documentation built on Feb. 22, 2018, 1:02 a.m.

Related to voxel_selection in oasis...