Skip to contents

This function reads a MATLAB classified sample file (.mat) generated by the start_classify_batch_user_training function from the ifcb-analysis repository (Sosik and Olson 2007), extracts specified taxa images from the corresponding ROI files, and saves each image in a specified directory.

Usage

ifcb_extract_classified_images(
  sample,
  classified_folder,
  roi_folder,
  out_folder,
  taxa = "All",
  threshold = "opt",
  verbose = TRUE,
  overwrite = FALSE
)

Arguments

sample

A character string specifying the sample name.

classified_folder

A character string specifying the directory containing the classified files.

roi_folder

A character string specifying the directory containing the ROI files.

out_folder

A character string specifying the directory to save the extracted images.

taxa

A character string specifying the taxa to extract. Default is "All".

threshold

A character string specifying the threshold to use ("none", "opt", "adhoc"). Default is "opt".

verbose

A logical value indicating whether to print progress messages. Default is TRUE.

overwrite

A logical value indicating whether to overwrite existing PNG files. Default is FALSE.

Value

No return value, called for side effects. Extracts and saves taxa images to a directory.

References

Sosik, H. M. and Olson, R. J. (2007), Automated taxonomic classification of phytoplankton sampled with imaging-in-flow cytometry. Limnol. Oceanogr: Methods 5, 204–216.

Examples

if (FALSE) { # \dontrun{
# Define the parameters
sample <- "D20230311T092911_IFCB135"
classified_folder <- "path/to/classified_folder"
roi_folder <- "path/to/roi_folder"
out_folder <- "path/to/outputdir"
taxa <- "All"  # or specify a particular taxa
threshold <- "opt"  # or specify another threshold

# Extract taxa images from the classified sample
ifcb_extract_classified_images(sample, classified_folder, roi_folder, out_folder, taxa, threshold)
} # }