Detrend Images

Detrend fluorescence microscopy image series for fluorescence fluctuation and correlation spectroscopy ('FCS' and 'FFS') analysis. This package contains functionality published in a 2016 paper but it has been extended since then with the Robin Hood algorithm and thus contains unpublished work.


Detrend image series.

Travis-CI Build Status AppVeyor Build Status CRAN_Status_Badge RStudio CRAN downloads Project Status: Active – The project has reached a stable, usable state and is being actively developed.

Installation

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")

Use

First let's load the library:

library(detrendr)

Image I/O and display

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

Detrending

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.

Vignette

For more detailed instruction on how to use the package, see vignette("detrendr").

Contribution

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.

News

0.5.1

BUG FIXES

  • Fix tests for CRAN fedora and mac.

0.5.0

NEW FEATURES

  • The package no longer depends on RSAGA, making it lighter.
  • Robin Hood detrending has been added.

0.4.0

NEW FEATURES

  • Add the option to detrend for the purpose of FCS or FFS.

0.3.0

NEW FEATURES

  • Batch processing: detrend an entire folder with the likes of dir_detrend_exp().

BUG FIXES

  • Asymmetric images caused R to crash.
  • NAs in simulated brightnesses were needlessly causing the automatic parameter-finding routines to fail.

0.2.0

NEW FEATURES

  • The process of extending time series prior to smoothing is not done any more. This was introducing errors for images with low counts. Smoothing works fine without it. Dropping this extension gives a massive improvement in detrending speed :-)
  • TIFF I/O and image display are now taken care of by the ijtiff package.
  • Images are now represented in the style of an ijtiff::ijtiff_img.

DEFUNCT

  • This package no longer exports functions for TIFF I/O nor image display.

detrendr 0.1.0

  • The first CRAN-worthy version.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("detrendr")

0.6.0 by Rory Nolan, 3 months ago


https://www.github.com/rorynolan/detrendr


Report a bug at https://www.github.com/rorynolan/detrendr/issues


Browse source code at https://github.com/cran/detrendr


Authors: Rory Nolan [aut, cre] , Luis Alvarez [ctb, cph] , Sergi Padilla-Parra [ctb, ths, cph]


Documentation:   PDF Manual  


BSD_3_clause + file LICENSE license


Imports Rcpp, RcppParallel, parallel, checkmate, magrittr, dplyr, foreach, doParallel, iterators, purrr, ijtiff, autothresholdr, rlang, stringr, filesstrings, plyr, glue, sigmoid, matrixStats, stringi, assertthat

Suggests testthat, knitr, rmarkdown, covr, abind, lattice, pacman, tidyr, graphics, gridExtra, arrayhelpers, ore, clipr, styler, MASS, mgcv, spelling

Linking to Rcpp, RcppParallel

System requirements: GNU make


Imported by nandb.


See at CRAN