ifcb_correct_annotation.RdThis function corrects annotations in MATLAB classlist files located in a specified manual folder, generated by the code in the `ifcb-analysis` repository (Sosik and Olson 2007). It replaces the class ID of specified regions of interest (ROIs) in the classlist files based on a correction file.
ifcb_correct_annotation(
manual_folder,
out_folder,
correction_file,
correct_classid
)A character string specifying the path to the folder containing the original MAT classlist files to be updated.
A character string specifying the path to the folder where updated MAT classlist files will be saved.
A character string specifying the path to the correction file. The correction file should have columns `class_folder` and `image_filename`, but only `image_filename` is used.
An integer specifying the class ID to use for corrections.
This function does not return any value; it updates the classlist files in the specified output directory.
This function requires a python interpreter to be installed. The required python packages can be installed in a virtual environment using `ifcb_py_install`
The correction file is expected to contain at least two columns: `class_folder`, which indicates the folder of the class, and `image_filename`, which includes the filenames of the images (with or without additional trailing information). The function processes each file, corrects the annotations, and saves the updated files in the output folder.
The `correction_file` is typically generated using a Shiny app that provides an interactive interface for browsing and managing IFCB (Imaging FlowCytobot) image galleries. This Shiny app can be initialized using the function `ifcb_run_image_gallery()`.
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.
if (FALSE) {
# Correct class ID in .mat classlist files
ifcb_correct_annotation("input/manual", "output/manual", "corrections.txt", 99)
}