make_segmentation_filter (generic function)
make_segmentation_filter.Rd
make_segmentation_filter (generic function)
Make a segmentation filter for a slice object
Make a segmentation filter for a slice within a mouse object
Usage
make_segmentation_filter(x, ...)
# S3 method for slice
make_segmentation_filter(
s,
channels = "eyfp",
params = list(c("Vol..unit.", "Moment1", "Moment2", "Moment3", "Moment4", "Sigma")),
ranges = list(list(c(200, 12000), c(3, 50), c(0, 600), c(0, 2000), c(0, 5), c(20,
Inf)))
)
# S3 method for mouse
make_segmentation_filter(
m,
slice_ID = NA,
hemisphere = NULL,
channels = c("eyfp"),
params = list(c("Vol..unit.", "Moment1", "Moment2", "Moment3", "Moment4", "Sigma")),
ranges = list(list(c(200, 12000), c(3, 50), c(0, 600), c(0, 2000), c(0, 5), c(20,
Inf))),
replace = FALSE
)
Arguments
- ...
- channels
(str vector, default = "eyfp") Channels to process. If NULL, defaults to the channels stored in the slice object attributes (not recommended).
- params
(list) Has same length as channels. Each element contains a vector of parameters names used for filtering that channel
- ranges
(list of lists) Has same length as channels. Each element of outer list corresponds the order of channels you want to process. Inner list contains vectors of parameter ranges for that channel.
- m
mouse object
- slice_ID
(str) ID of slice
- hemisphere
'left', 'right' or NULL (both)
- replace
(bool, default = FALSE) replace existing filters.
Value
s slice object. Vector of indices of cells to remove are stored as the channel filters in the slice object.
m mouse object. Vector of indices of cells to remove are stored as the channel filters in the slice object within the mouse.
Examples
s <- make_segmentation_filter(s, channels = c('eyfp'),
params = list(c("Vol..unit.","Moment1","Moment2","Moment3","Moment4","Sigma")),
ranges = list(list(c(200, 12000), c(3, 50), c(0, 600), c(0, 2000), c(0, 5), c(20, Inf))))
#> Error in make_segmentation_filter(s, channels = c("eyfp"), params = list(c("Vol..unit.", "Moment1", "Moment2", "Moment3", "Moment4", "Sigma")), ranges = list(list(c(200, 12000), c(3, 50), c(0, 600), c(0, 2000), c(0, 5), c(20, Inf)))): object 's' not found
m <- make_segmentation_filter(m, slice_ID = '1_10', hemisphere = NULL , channels = c('eyfp'),
params = list(c("Vol..unit.","Moment1","Moment2","Moment3","Moment4","Sigma")),
ranges = list(list(c(200, 12000), c(3, 50), c(0, 600), c(0, 2000), c(0, 5), c(20, Inf))))
#> Error in make_segmentation_filter(m, slice_ID = "1_10", hemisphere = NULL, channels = c("eyfp"), params = list(c("Vol..unit.", "Moment1", "Moment2", "Moment3", "Moment4", "Sigma")), ranges = list(list(c(200, 12000), c(3, 50), c(0, 600), c(0, 2000), c(0, 5), c(20, Inf)))): object 'm' not found