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.
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
)
data.frame
summarizing each analyzed image, including details such as the number of objects, average size and intensity, estimated rejections, and coverage.
directory path to folder with images to be analyzed
processing multiple images at the same time (default - FALSE)
'PSOCK' or 'FORK' (see makeCluster
)
number of cores for parallel processing (numeric / 'auto') ('auto' uses 75% of the available cores)
choose method for object detection ('edge' / 'threshold')
(from objectDetection
)
threshold adjustment factor (numeric / 'static' / 'interactive' / 'gaussian')
(from objectDetection
)
smoothing (numeric / 'static' / 'interactive' / 'gaussian')
(from objectDetection
)
applying sizeFilter
function (default - FALSE)
highest accepted object size (only needed if sizeFilter = TRUE)
smallest accepted object size (numeric / 'auto')
applying proximityFilter
function (default - FALSE)
distance from one center in which no other centers are allowed (in pixels) (only needed if proximityFilter = TRUE)
creates a log markdown document, summarizing the results (default - FALSE)
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.
imgPipe()
, objectDetection()
, sizeFilter()
, proximityFilter()
, resultAnalytics()
# \donttest{
if (interactive()) {
path2dir <- system.file("images", package = 'biopixR')
results <- scanDir(path2dir, alpha = 'interactive', sigma = 'interactive')
print(results)
}
# }
Run the code above in your browser using DataLab