Skip to contents

This function processes .mat files, generated by the code in the ifcb-analysis repository (Sosik and Olson 2007), to count and summarize the annotations for each class based on the class2use information provided in a file.

Usage

ifcb_count_mat_annotations(
  manual_files,
  class2use_file,
  skip_class = NULL,
  sum_level = "class",
  mat_recursive = FALSE
)

Arguments

manual_files

A character string specifying the path to the .mat files or a folder containing .mat files.

class2use_file

A character string specifying the path to the file containing the class2use variable.

skip_class

A numeric vector of class IDs or a character vector of class names to be excluded from the count. Default is NULL.

sum_level

A character string specifying the level of summarization. Options: "sample", "roi" or "class" (default).

mat_recursive

Logical. If TRUE, the function will search for MATLAB files recursively when manual_files is a folder. Default is FALSE.

Value

A data frame with the total count of images per class, roi or per sample.

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{
# Count annotations excluding specific class IDs
result <- ifcb_count_mat_annotations("path/to/manual_folder",
                                     "path/to/class2use_file",
                                     skip_class = c(99, 100))
print(result)

# Count annotations excluding a specific class name
result <- ifcb_count_mat_annotations("path/to/manual_folder",
                                     "path/to/class2use_file",
                                     skip_class = "unclassified")
print(result)
} # }