View source: R/ifcb_extract_pngs.R
| ifcb_extract_pngs | R Documentation |
This function reads an IFCB (.roi) file and its corresponding .adc file, extracts regions of interest (ROIs),
and saves each ROI as a PNG image in a specified directory. Optionally, you can specify ROI numbers
to extract, useful for specific ROIs from manual or automatic classification results. Additionally, a scale bar
can be added to the extracted images based on a specified micron-to-pixel conversion factor.
ifcb_extract_pngs(
roi_file,
out_folder = dirname(roi_file),
ROInumbers = NULL,
taxaname = NULL,
gamma = 1,
normalize = FALSE,
overwrite = FALSE,
scale_bar_um = NULL,
scale_micron_factor = 1/3.4,
scale_bar_position = "bottomright",
scale_bar_color = "black",
old_adc = FALSE,
verbose = TRUE
)
This function is called for its side effects: it writes PNG images to a directory.
ifcb_extract_classified_images for extracting ROIs from automatic classification.
ifcb_extract_annotated_images for extracting ROIs from manual annotation.
## Not run:
# Convert ROI file to PNG images
ifcb_extract_pngs("path/to/your_roi_file.roi")
# Extract specific ROI numbers from ROI file
ifcb_extract_pngs("path/to/your_roi_file.roi", "output_directory", ROInumbers = c(1, 2, 3))
# Extract images with a 5 micrometer scale bar
ifcb_extract_pngs("path/to/your_roi_file.roi", scale_bar_um = 5)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.