CT_Skull_Strip_robust: Robust CT Skull Stripping

Description Usage Arguments Value Note

View source: R/CT_Skull_Strip_robust.R

Description

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

Usage

 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
CT_Skull_Strip_robust(
  img,
  outfile = NULL,
  keepmask = TRUE,
  maskfile = NULL,
  retimg = TRUE,
  reorient = FALSE,
  int = "0.01",
  lthresh = 0,
  uthresh = 100,
  nvoxels = 5,
  remove.neck = TRUE,
  remover = c("remove_neck", "double_remove_neck"),
  smooth.factor = 2,
  recog = TRUE,
  verbose = TRUE,
  opts = NULL,
  mask_to_background = FALSE,
  template.file = system.file("scct_unsmooth_SS_0.01.nii.gz", package = "ichseg"),
  template.mask = system.file("scct_unsmooth_SS_0.01_Mask.nii.gz", package = "ichseg"),
  ...
)

CT_Skull_Strip_register(
  img,
  outfile = NULL,
  keepmask = TRUE,
  maskfile = NULL,
  retimg = TRUE,
  reorient = FALSE,
  lthresh = 0,
  uthresh = 100,
  remove.neck = TRUE,
  remover = c("remove_neck", "double_remove_neck"),
  verbose = TRUE,
  mask_to_background = FALSE,
  ...
)

CT_Skull_Strip_smooth(
  img,
  ...,
  smooth_before_threshold = TRUE,
  smooth.factor = 1,
  remove.neck = TRUE,
  remover = c("remove_neck", "double_remove_neck"),
  recog = FALSE,
  nvoxels = 0,
  add_1024 = FALSE
)

Arguments

img

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

outfile

(character) output filename

keepmask

(logical) Should we keep the mask?

maskfile

(character) Filename for mask (if keepmask = TRUE). If NULL, then will do paste0(outfile, "_Mask").

retimg

(logical) return image of class nifti

reorient

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

int

Fractional Intensity passed to CT_Skull_Strip and subsequently fslbet.

lthresh

(default: 0) Lower value to threshold CT fslthresh

uthresh

(default: 100) Upper value to threshold CT fslthresh

nvoxels

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

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

smooth.factor

Smoothing factor for fslbet. See -w option in fslbet.help().

recog

Re-estimate the center of gravity (COG) and skull strip.

verbose

(logical) Should diagnostic output be printed?

opts

Not used

mask_to_background

When masking, should the values outside the mask be set to 0 (default) or -1024 (when TRUE)

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

...

additional arguments passed to CT_Skull_Strip or remove_neck.

smooth_before_threshold

Should the image be smoothed before thresholding? This can be useful for bone-window scans.

add_1024

Adding 1024 to the image *before* running the skull stripping. The values are subtracted after. This has interplay with mask_to_background

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 CT_Skull_Strip. A new center of gravity is estiamted using cog, then the image is skull stripped again using the new cog and the smoothness factor (passed to -w argument in BET). After the skull stripped mask is created, the image is dilated and eroded using dil_ero to fill holes using a box kernel with the number of voxels nvoxels in all 3 directions.

CT_Skull_Strip_register removes the neck, registers the image to the template, using a rigid-body transformation, runs the skull stripper to get a mask, then transforms the mask back to native space.


neuroconductor/ichseg documentation built on Sept. 29, 2020, 2:31 p.m.