oasis_erode.Rd
An alternative to using fslerode
for mask erosion of a
brain mask by a box kernel defined by millimeter
oasis_erode(mask, mm = c(5, 5, 5))
mask | object of class |
---|---|
mm | Number of erosion (in millimeters) |
Object of class nifti
library(neurobase)
#> Loading required package: oro.nifti
#> oro.nifti 0.10.3
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)
res = oasis_erode(flair > 0)
}
#> Loading required package: httr