xy_splits: Analyses for each xy position

View source: R/xy_splits.R

xy_splitsR Documentation

Analyses for each xy position

Description

Splits the image in each xy position and then run an analysis

Usage

xy_splits(imgs, channels, do, upper.part = 0.5, layer.start = NULL, cores = 1)

Arguments

imgs

The paths of array files; i.e. output from loadIMG or findIMG functions.

channels

Character vector with name(s) of channels. Channel names should be in the names of the array files

do

What to do?

  • "max" and "min" find the max or min layer where the first 1 is found.

  • "sum" sums the pixels (e.g. for biomass xy-distribution).

  • "which" returns z-positions of pixels for each xy dimension.

  • "section" first sections the image in an upper/lower part and then sums for each part. Sectioning is done for each xy-position and therefore takes a variable biomass distribution across the image into account.

  • Alternatively a user-defined function that will be applied for each xy-position. E.g. function(x) median(which(x > 0)) will return the median position of each channel at each xy-position.

upper.part

Only if do="section". Either the fraction to assign to the upper section (between 0 and 1), or a fixed number of layers that are assigned to the upper part (an integer, 1L, 2L, 3L etc.. Remember the L!). The upper fraction is inclusive (i.e. x >= upper.part)

layer.start

Only if do="section". Are first layers the "Top" or the "Bottom" of the specimen?

cores

Cores to use for parallel computing. Defaults to 1, i.e. not parallel.

Details

For sectioning, NA is returned if a channel is absent at a specific xy-position, but a zero is returned if the channel is present at that xy-position but absent in the section.

Value

A recursive list. First layer are the images, within those are the channels. Each element is a matrix with a value for each xy position. If do="section" an extra layer is added denoting the upper and lower section.


Russel88/RCon3D documentation built on Dec. 14, 2022, 11:06 p.m.