number_folder: Number calculations for every image in a folder.

Description Usage Arguments Note See Also Examples

View source: R/number.R

Description

Perform number() calculations on all tif images in a folder and save the resulting number images to disk.

Usage

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

Arguments

folder_path

The path (relative or absolute) to the folder you wish to process.

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

Microscope acquisition parameters. See reference Dalal et al.

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.

Note

Extreme number values (of magnitude greater than 3.40282e+38) will be written to the TIFF file as NA, since TIFF files cannot handle such huge numbers.

See Also

number()

Examples

1
2
3
4
5
6
7
## Not run: 
setwd(tempdir())
img <- ijtiff::read_tif(system.file("extdata", "50.tif", package = "nandb"))
ijtiff::write_tif(img, "img2.tif")
number_folder(def = "n", thresh = "Huang", parallel = 2)

## End(Not run)

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