Detrend fluorescence microscopy image series for
fluorescence fluctuation and correlation spectroscopy ('FCS' and
'FFS') analysis. This package contains functionality published in a
2016 paper
Detrend image series.
To install the release version (recommended) from CRAN, in R, enter
install.packages("detrendr")
To install the development version, in R, first install devtools
via install.packages("devtools")
. Then enter
devtools::install_github("rorynolan/detrendr")
First let's load the library:
library(detrendr)
The package contains a sample image series which can be found at system.file("extdata", "cells.tif", package = "detrendr")
. Let's read it in and inspect the first and last frames:
path <- system.file("extdata", "bleached.tif", package = "detrendr")img <- ijtiff::read_tif(path)dim(img) # img has 500 frames
mean(img[, , 1, 1]) # first channel, first frame
#> [1] 152.4489
mean(img[, , 1, 500]) # first channel, last frame
#> [1] 68.51583
We see that the intensity is much lower for the last frame, this is because the image series has been bleached. We can correct for this (and check how long it takes):
system.time(corrected <- img_detrend_exp(img, "auto",seed = 0, parallel = 2))["elapsed"]
#> elapsed
#> 7.589
mean(corrected[, , 1, 1]) # first channel, first frame
#> [1] 112.9569
mean(corrected[, , 1, 500]) # first channel, last frame
#> [1] 103.33
So we see that the corrected series does not have this drop-off in intensity.
For more detailed instruction on how to use the package, see vignette("detrendr")
.
Contributions to this package are welcome. The preferred method of contribution is through a github pull request. Feel free to contact me by creating an issue. Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
detrendr
0.6.1glue
.base::sample()
. A more permanent fix should be provided when R 3.6 has landed.detrendr
0.6.0pkgdown
website!detrendr
0.5.2detrendr
0.5.1detrendr
0.5.0RSAGA
, making it lighter.detrendr
0.4.0detrendr
0.3.0dir_detrend_exp()
.NA
s in simulated brightnesses were needlessly causing the automatic parameter-finding routines to fail.detrendr
0.2.0ijtiff
package.ijtiff::ijtiff_img
.detrendr
detrendr 0.1.0