Removes the neck from axially acquired scan so skull stripping can be done.
remove_neck( file, template.file, template.mask = NULL, ret_mask = FALSE, typeofTransform = "Rigid", rep.value = 0, swapdim = TRUE, verbose = TRUE, ... )
file | File for neck removal - either filename or class nifti |
---|---|
template.file | Template to warp to original image space |
template.mask | Mask of template to use as rough brain mask. If
|
ret_mask | Return mask of slices to keep |
typeofTransform | Transformation for template to image, passed to
|
rep.value | Value to replace neck slices with |
swapdim | Should the dimensions be swapped before registration, and then reset after |
verbose | Print out diagnostic messages |
... | Additional arguments passed to |
Object of class nifti or vector of indices
if (fslr::have.fsl()){ print(fslr::fsl_version()) in_ci <- function() { nzchar(Sys.getenv("CI")) } if (in_ci()) { destfile = tempfile(fileext = ".nii.gz") dl = download.file(paste0( "https://github.com/muschellij2/", "Neurohacking/files/3454385/113-01-MPRAGE2.nii.gz"), destfile = destfile) tfile = fslr::mni_fname(brain = TRUE) if (file.exists(tfile)) { res = remove_neck( destfile, template.file = tfile, template.mask = fslr::mni_fname(brain = TRUE, mask = TRUE) ) } } }