scanDir {biopixR} | R Documentation |
Scan Directory for Image Analysis
Description
This function scans a specified directory, imports images, and performs various analyses including object detection, size filtering, and proximity filtering. Optionally, it can perform these tasks in parallel and log the process.
Usage
scanDir(
path,
parallel = FALSE,
backend = "PSOCK",
cores = "auto",
method = "edge",
alpha = 1,
sigma = 2,
sizeFilter = FALSE,
upperlimit = "auto",
lowerlimit = "auto",
proximityFilter = FALSE,
radius = "auto",
Rlog = FALSE
)
Arguments
path |
directory path to folder with images to be analyzed |
parallel |
processing multiple images at the same time (default - FALSE) |
backend |
'PSOCK' or 'FORK' (see |
cores |
number of cores for parallel processing (numeric / 'auto') ('auto' uses 75% of the available cores) |
method |
choose method for object detection ('edge' / 'threshold')
(from |
alpha |
threshold adjustment factor (numeric / 'static' / 'interactive' / 'gaussian')
(from |
sigma |
smoothing (numeric / 'static' / 'interactive' / 'gaussian')
(from |
sizeFilter |
applying |
upperlimit |
highest accepted object size (only needed if sizeFilter = TRUE) |
lowerlimit |
smallest accepted object size (numeric / 'auto') |
proximityFilter |
applying |
radius |
distance from one center in which no other centers are allowed (in pixels) (only needed if proximityFilter = TRUE) |
Rlog |
creates a log markdown document, summarizing the results (default - FALSE) |
Details
The function scans a specified directory for image files, imports them,
and performs analysis using designated methods. The function is capable of
parallel processing, utilizing multiple cores to accelerate computation.
Additionally, it is able to log the results into an R Markdown file.
Duplicate images are identified through the use of MD5 sums. In addition a
variety of filtering options are available to refine the analysis. If
logging is enabled, the results can be saved and rendered into a report.
When Rlog = TRUE
, an R Markdown file and a CSV file are generated in the
current directory. More detailed information on individual results,
can be accessed through saved RDS files.
Value
data.frame
summarizing each analyzed image, including details such as the number of objects, average size and intensity, estimated rejections, and coverage.
See Also
imgPipe()
, objectDetection()
, sizeFilter()
, proximityFilter()
, resultAnalytics()
Examples
if (interactive()) {
path2dir <- system.file("images", package = 'biopixR')
results <- scanDir(path2dir, alpha = 'interactive', sigma = 'interactive')
print(results)
}