% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/functions.R
\name{generate_GP_Masks}
\alias{generate_GP_Masks}
\title{Generate cell masks by fast Gaussian processes}
\usage{
generate_GP_Masks(
  file_path,
  delta = 0.01,
  nugget = TRUE,
  middle_threshold = 0.15,
  boundary_threshold = 0.05,
  compress_output = FALSE,
  return_gradient = FALSE,
  seed = NULL
)
}
\arguments{
\item{file_path}{File path for cell image to segment}

\item{delta}{Step size for percentages to be tested for criterion 1 (default is 0.01)}

\item{nugget}{Nugget boolean for rgasp()}

\item{middle_threshold}{Size threshold for filtering object masks not touching the image boundary (removes anything smaller than threshold * mean mask size); default is 0.15}

\item{boundary_threshold}{Size threshold for filtering object masks touching the image boundary (removes anything smaller than threshold * mean mask size); default is 0.05}

\item{compress_output}{Determines if binary and cell mask results should be represented in matrix (FALSE) or list (TRUE) form; default is FALSE}

\item{return_gradient}{Returns vertical, horizontal, and magnitude gradients for predictive mean if TRUE; default is FALSE}

\item{seed}{Seed for reproducibility (default is NULL)}
}
\value{
Returns a list containing:
\item{ori_images}{Original version of sectioned image}
\item{processed_images}{Predictive mean for each image section}
\item{gradients}{Vertical, horizontal, and magnitude gradients for predictive mean if \code{return_gradient} is TRUE}
\item{crit_1_opt_thresholds}{Optimal threshold by criterion 1 for each image section}
\item{connected_parts_count}{Number of unique objects for each image section after thresholding before watershed}
\item{outliers}{IDs for thresholded image section that contains unusually large object counts}
\item{combined_predmean}{Predictive mean matrix for entire image}
\item{combined_thresholded1}{Binary matrix for entire image before watershed}
\item{GP_masks}{Cell masks for entire image after thresholding binary matrix, with each cell mask having a unique ID}
}
\description{
Generates object masks for cell microscopy images using fast Gaussian processes for smoothing,
a data-driven threshold for foreground/background segmentation, and watershed for separating touching cell objects.
Note that this function divides the original image into sections for more robust processing.
}
\examples{
# Example: Segmentation of JPEG nuclear channel image
img_path <- system.file("extdata", "example_cells_small.jpg", package = "FastSegmentation")
gp_masks_result <- generate_GP_Masks(img_path)
}
