fslbet_robust: Robust Skull Stripping with COG estimation and Bias...

Description Usage Arguments Value Note Examples

View source: R/fslbet_robust.R

Description

Skull Stripping (using FSL's BET) a file using fslr functions and robustified by registration and neck removal

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
fslbet_robust(
  img,
  outfile = NULL,
  retimg = TRUE,
  correct = TRUE,
  correction = "N4",
  recog = TRUE,
  reorient = FALSE,
  bet.opts = "",
  nvoxels = 0,
  swapdim = TRUE,
  remove.neck = TRUE,
  remover = c("remove_neck", "double_remove_neck"),
  robust.mask = FALSE,
  rbm.voxels = 7,
  template.file = file.path(fsldir(), "data/standard", "MNI152_T1_1mm_brain.nii.gz"),
  template.mask = file.path(fsldir(), "data/standard",
    "MNI152_T1_1mm_brain_mask.nii.gz"),
  verbose = TRUE,
  ...
)

Arguments

img

(character) File to be skull stripped or object of class nifti

outfile

(character) output filename

retimg

(logical) return image of class nifti

correct

Perform bias field correction

correction

(character) N3 or N4 correction?

recog

Rerun bet with a new center of gravity (COG) estimate

reorient

(logical) If retimg, should file be reoriented when read in? Passed to readnii.

bet.opts

Options for fslbet

nvoxels

Number of voxels to dilate/erode. See fslfill2. If nvoxels = 0, then no smoothing is done.

swapdim

Use fslswapdim to reorient image

remove.neck

Run remove_neck to register the template to a thresholded image to remove neck slices.

remover

if remove.neck = TRUE, then which function would you like to use to remove the neck

robust.mask

Run robust_brain_mask to register the template to a thresholded image and inflate for

rbm.voxels

Number of voxels to inflate mask for robust_brain_mask

template.file

Template to warp to original image space, passed to remove_neck

template.mask

Mask of template to use as rough brain mask, passed to remove_neck

verbose

(logical) Should diagnostic output be printed?

...

additional arguments passed to robust_brain_mask or remove_neck.

Value

Skull-stripped nifti object

Note

This function first thresholds an image, runs a rigid registration (default in remove_neck) to drop any slices below the transformed skull stripped template to remove neck slices. The neck-removed image is then skull stripped using defaults in fslbet. A new center of gravity is estiamted using cog, then the image is skull stripped again using the new cog. After the skull stripped mask is created, the image is dilated and eroded using fslfill2 to fill holes using a box kernel with the number of voxels nvoxels in all 3 directions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
  stubs = c("T1Strip.nii.gz",
  "T2Strip.nii.gz")
  img_files = system.file(stubs,
  package="WhiteStripe")
  
  if (all(file.exists(img_files)){
   fslbet_robust(system.file('T1Strip.nii.gz', package="WhiteStripe"))
  }

## End(Not run)

muschellij2/extrantsr documentation built on July 27, 2021, 7:41 a.m.