if (FALSE) {
# Example usage:
# Assuming the following directory structure:
# path/to/png_folder/
# |- class1/
# | |- sample1_00001.png
# | |- sample1_00002.png
# | |- sample2_00001.png
# |- class2/
# | |- sample1_00003.png
# | |- sample3_00001.png
png_folder <- "path/to/png_folder"
hdr_folder <- "path/to/hdr_folder" # This folder should contain corresponding .hdr files
# Summarize by sample
summary_sample <- ifcb_summarize_png_counts(png_folder,
hdr_folder,
sum_level = "sample",
verbose = TRUE)
print(summary_sample)
# Summarize by class
summary_class <- ifcb_summarize_png_counts(png_folder,
hdr_folder,
sum_level = "class",
verbose = TRUE)
print(summary_class)
}
Run the code above in your browser using DataLab