Creates a rough mask of the face from a head scan
ct_face_mask( file, skull_strip = TRUE, mask = NULL, robust = TRUE, template.file = system.file(ifelse(skull_strip, "scct_unsmooth_SS_0.01.nii.gz", "scct_unsmooth.nii.gz"), package = "ichseg"), template.face_mask = NULL, template.face_mask_inds = list(50:130, 170:217, 1:15), extend_mask = TRUE, typeofTransform = "Affine", swapdim = TRUE, verbose = TRUE, ... ) mri_face_mask( ..., skull_strip = TRUE, mask = NULL, robust = FALSE, template.file = mni_fname(brain = skull_strip) )
file | File for face masking - either filename or class nifti |
---|---|
skull_strip | Should the data require skull stripping if no mask is provided? |
mask | file or |
robust | If |
template.file | Template to warp to original image space |
template.face_mask | Mask of template to use as rough face mask. If
|
template.face_mask_inds | List of length 3 for indices of
|
extend_mask | after transformation, should the mask be extended to the front of the image to ensure all face has been removed? |
typeofTransform | Transformation for template to image, passed to
|
swapdim | Should the dimensions be swapped before registration, and then reset after |
verbose | Print out diagnostic messages |
... | arguments passed to |
Object of class nifti
if (FALSE) { file = "~/Desktop/Desktop/scratch/100-318_20070723_0957_CT_3_CT_Head-.nii.gz" mask = NULL robust = FALSE face = ct_face_mask( file = file, robust = FALSE ) img = readnii(file) rimg = randomize_mask(img, mask = face) } if (FALSE) { library(fslr) library(extrantsr) mri = "~/Desktop/Desktop/scratch/SUBJ0001-01-MPRAGE.nii.gz" template.file = mni_fname(brain = TRUE) tmask = mni_fname(brain = TRUE, mask = TRUE) template.face_mask_inds = list(50:130, 170:217, 1:15) brain = fslbet_robust(mri, remove.neck = TRUE, remover = "double_remove_neck", template.file = template.file, template.mask = tmask) mask = brain > 0 img = brain template.face_mask = NULL verbose = TRUE face = mri_face_mask( file = img, mask = mask, template.file = template.file ) }