Skull Stripping (using FSL's BET) a CT file
using fslr
functions and robustified by registration
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 )
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 |
retimg | (logical) return image of class nifti |
reorient | (logical) If retimg, should file be
reoriented when read in?
Passed to |
int | Fractional Intensity passed to
|
lthresh | (default: 0) Lower value to threshold CT
|
uthresh | (default: 100) Upper value to threshold CT
|
nvoxels | Number of voxels to dilate/erode.
See |
remove.neck | Run |
remover | if |
smooth.factor | Smoothing factor for |
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
|
template.mask | Mask of template to use as rough
brain mask, passed
to |
... | additional arguments passed to
|
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
|
Skull-stripped nifti
object
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.