% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ear_mask.R
\name{ct_ear_mask}
\alias{ct_ear_mask}
\alias{ct_ear_mask,mri_ear_mask}
\alias{mri_ear_mask}
\title{Create Mask of the Ears}
\usage{
ct_ear_mask(
file,
skull_strip = TRUE,
mask = NULL,
robust = TRUE,
template.file = system.file("scct_unsmooth_SS_0.01.nii.gz", package = "ichseg"),
template.ear_mask = NULL,
template.left_ear_inds = list(170:180, 60:110, 1:60),
template.right_ear_inds = list(1:10, 60:110, 1:60),
extend_left = TRUE,
extend_right = TRUE,
typeofTransform = "Affine",
swapdim = TRUE,
verbose = TRUE,
...
)
mri_ear_mask(
...,
skull_strip = TRUE,
mask = NULL,
robust = FALSE,
template.file = mni_fname(brain = skull_strip)
)
}
\arguments{
\item{file}{File for face masking - either filename or class nifti}
\item{skull_strip}{Should the data require skull stripping if
no mask is provided?}
\item{mask}{file or \code{nifti} to mask the \code{file}}
\item{robust}{If \code{mask = NULL}, then \code{robust} is
passed to \code{\link{CT_Skull_Stripper}}}
\item{template.file}{Template to warp to original image space}
\item{template.ear_mask}{Mask of template to use as rough ear mask. If
\code{template.file} is not specified, \code{template.left_ear_inds} and
\code{template.right_ear_inds}
must be}
\item{template.left_ear_inds}{List of length 3 for indices of
\code{template.file} to indicate the left-ear mask.}
\item{template.right_ear_inds}{List of length 3 for indices of
\code{template.file} to indicate the right-ear mask.}
\item{extend_left}{after transformation, should the mask be extended to the
left of the image to ensure all left ear has been removed?}
\item{extend_right}{after transformation, should the mask be extended to the
right of the image to ensure all right ear has been removed?}
\item{typeofTransform}{Transformation for template to image, passed to
\code{\link{ants_regwrite}}.}
\item{swapdim}{Should the dimensions be swapped before registration,
and then reset after}
\item{verbose}{Print out diagnostic messages}
\item{...}{arguments passed to \code{\link{CT_Skull_Stripper}}}
}
\value{
Object of class nifti
}
\description{
Creates a rough mask of the ear from a head scan
}
\examples{
\dontrun{
file = "~/Desktop/Desktop/scratch/100-318_20070723_0957_CT_3_CT_Head-.nii.gz"
mask = NULL
robust = FALSE
ears = ct_ear_mask(
file = file,
robust = FALSE
)
img = readnii(file)
rimg = randomize_mask(img, mask = ears)
}
}