In this tutorial we will discuss performing brain segmentation using:
FSL
(Jenkinson et al. 2012)
malf
command (method 3).extrantsr
, fslbet_robust
Let’s reset and read in the T1 image from a MS lesion data set:
library(neurobase) t1_fname = "training01_01_t1.nii.gz" t1 = neurobase::readnii(t1_fname) rt1 = robust_window(t1, probs = c(0, 0.975)); red0.5 = scales::alpha("red", 0.5) # for plotting later
ortho2(rt1)
Here we will use FSL’s Brain Extraction Tool (BET) to extract the brain tissue from the rest of the image (general overview):
fslr
- wraps FSL commands to use in R - registration, image manipulation
fslr::fslbet
- takes in a filename/nifti and calls FSL bet
function - additional options can be passed to FSL command in using opts
library(fslr) ss = fslbet(infile = t1_fname)
ortho2(robust_window(ss))