number: Calculate number from image series.

Description Usage Arguments Value References Examples

View source: R/number.R

Description

Given a time stack of images, number() performs a calculation of the number for each pixel.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
number(
  img,
  def,
  thresh = NULL,
  detrend = FALSE,
  quick = FALSE,
  filt = NULL,
  s = 1,
  offset = 0,
  readout_noise = 0,
  gamma = 1,
  parallel = FALSE
)

Arguments

img

A 4-dimensional array of images indexed by img[y, x, channel, frame] (an object of class ijtiff::ijtiff_img). The image to perform the calculation on. To perform this on a file that has not yet been read in, set this argument to the path to that file (a string).

def

A character. Which definition of number do you want to use, "n" or "N"?

thresh

The threshold or thresholding method (see autothresholdr::mean_stack_thresh()) to use on the image prior to detrending and number calculations. If there are many channels, this may be specified as a vector or list, one element for each channel.

detrend

Detrend your data with detrendr::img_detrend_rh(). This is the best known detrending method for brightness analysis. For more fine-grained control over your detrending, use the detrendr package. If there are many channels, this may be specified as a vector, one element for each channel.

quick

FALSE repeats the detrending procedure (which has some inherent randomness) a few times to hone in on the best detrend. TRUE is quicker, performing the routine only once. FALSE is better.

filt

Do you want to smooth (filt = 'mean') or median (filt = 'median') filter the number image using smooth_filter() or median_filter() respectively? If selected, these are invoked here with a filter radius of 1 (with corners included, so each median is the median of 9 elements) and with the option na_count = TRUE. If you want to smooth/median filter the number image in a different way, first calculate the numbers without filtering (filt = NULL) using this function and then perform your desired filtering routine on the result. If there are many channels, this may be specified as a vector, one element for each channel.

s

A positive number. The S-factor of microscope acquisition.

offset, readout_noise

Microscope acquisition parameters. See reference Dalal et al.

gamma

Factor for correction of number n due to the illumination profile. The default (gamma = 1) has no effect. Changing gamma will have the effect of dividing the result by gamma, so the result with gamma = 0.5 is two times the result with gamma = 1. For a Gaussian illumination profile, use gamma = 0.3536; for a Gaussian-Lorentzian illumination profile, use gamma = 0.0760.

parallel

Would you like to use multiple cores to speed up this function? If so, set the number of cores here, or to use all available cores, use parallel = TRUE.

Value

A matrix, the number image.

References

Digman MA, Dalal R, Horwitz AF, Gratton E. Mapping the Number of Molecules and Brightness in the Laser Scanning Microscope. Biophysical Journal. 2008;94(6):2320-2332. doi: 10.1529/biophysj.107.114645.

Dalal, RB, Digman, MA, Horwitz, AF, Vetri, V, Gratton, E (2008). Determination of particle number and brightness using a laser scanning confocal microscope operating in the analog mode. Microsc. Res. Tech., 71, 1:69-81. doi: 10.1002/jemt.20526.

Hur K-H, Macdonald PJ, Berk S, Angert CI, Chen Y, Mueller JD (2014) Quantitative Measurement of Brightness from Living Cells in the Presence of Photodepletion. PLoS ONE 9(5): e97440. doi: 10.1371/journal.pone.0097440.

Examples

1
2
3
4
img <- ijtiff::read_tif(system.file("extdata", "50.tif", package = "nandb"))
ijtiff::display(img[, , 1, 1])
num <- number(img, "N", thresh = "Huang")
num <- number(img, "n", thresh = "tri")

nandb documentation built on May 17, 2021, 1:09 a.m.