Extract Annotated Images from IFCB Data
Source:R/ifcb_extract_annotated_images.R
ifcb_extract_annotated_images.Rd
This function extracts labelled images from IFCB (Imaging FlowCytobot) data,
annotated using the MATLAB code from the ifcb-analysis
repository (Sosik and Olson 2007).
It reads manually classified data, maps class indices to class names, and extracts
the corresponding Region of Interest (ROI) images, saving them to the specified directory.
Usage
ifcb_extract_annotated_images(
manual_folder,
class2use_file,
roi_folder,
out_folder,
skip_class = NA,
verbose = TRUE,
manual_recursive = FALSE,
roi_recursive = TRUE,
overwrite = FALSE
)
Arguments
- manual_folder
A character string specifying the path to the directory containing the manually classified .mat files.
- class2use_file
A character string specifying the path to the file containing class names.
- roi_folder
A character string specifying the path to the directory containing the ROI files.
- out_folder
A character string specifying the output directory where the extracted images will be saved.
- skip_class
A numeric vector of class IDs or a character vector of class names to be excluded from the count. Default is NULL.
- verbose
A logical value indicating whether to print progress messages. Default is TRUE.
- manual_recursive
Logical. If TRUE, the function will search for MATLAB files recursively within the
manual_folder
. Default is FALSE.- roi_recursive
Logical. If TRUE, the function will search for data files recursively within the
roi_folder
(if provided). Default is TRUE.- overwrite
A logical value indicating whether to overwrite existing PNG files. Default is FALSE.