sizeFilter {biopixR} | R Documentation |
Size-based exclusion
Description
Takes the size of the objects in an image and discards objects based
on a lower and an upper size limit.
(Input can be obtained by objectDetection
function)
Usage
sizeFilter(centers, coordinates, lowerlimit = "auto", upperlimit = "auto")
Arguments
centers |
center coordinates of objects (value|mx|my|size data frame) |
coordinates |
all coordinates of the objects (x|y|value data frame) |
lowerlimit |
smallest accepted object size (numeric / 'auto' / 'interactive') |
upperlimit |
highest accepted object size (numeric / 'auto' / 'interactive') |
Details
The sizeFilter
function is designed to filter
detected objects based on their size, either through automated detection or
user-defined limits. The automated detection of size limits uses the 1.5*IQR
method to identify and remove outliers. This approach is most effective when
dealing with a large number of objects, (typically more than 50), and when
the sizes of the objects are relatively uniform. For smaller samples or when
the sizes of the objects vary significantly, the automated detection may not
be as accurate, and manual limit setting is recommended.
Value
list of 2 objects:
Remaining centers after discarding according to size.
Remaining coordinates after discarding according to size.
Examples
res_objectDetection <- objectDetection(
beads,
method = 'edge',
alpha = 1,
sigma = 0
)
res_sizeFilter <- sizeFilter(
centers = res_objectDetection$centers,
coordinates = res_objectDetection$coordinates,
lowerlimit = 50, upperlimit = 150
)
changePixelColor(
beads,
res_sizeFilter$coordinates,
color = "darkgreen",
visualize = TRUE
)