best_degree {detrendr} | R Documentation |

## Find the best polynomial degree for polynomial detrending.

### Description

Use Nolan's algorithm to find the ideal polynomial degree for polynomial detrending.

### Usage

```
best_degree(img, parallel = FALSE, purpose = c("FCS", "FFS"))
```

### Arguments

`img` |
A 4-dimensional array in the style of an
ijtiff_img (indexed by |

`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 |

`purpose` |
What type of calculation do you intend to perform on the
detrended image? If it is an FFS (fluorescence fluctuation spectroscopy)
calculation (like number and brightness), choose 'FFS'. If it is an FCS
(fluorescence correlation spectroscopy) calculation (like cross-correlated
number and brightness or autocorrelation), choose 'FCS'. The difference is
that if |

### Value

If no detrend is necessary, this function returns `NA`

. If a detrend
is required, this function returns a natural number which is the ideal
polynomial degree for polynomial detrending. If there are multiple
channels, the function returns a vector, one `degree`

parameter for each
channel.

### References

Rory Nolan, Luis A. J. Alvarez, Jonathan Elegheert, Maro Iliopoulou, G. Maria Jakobsdottir, Marina Rodriguez-MuĂ±oz, A. Radu Aricescu, Sergi Padilla-Parra; nandbâ€”number and brightness in R with a novel automatic detrending algorithm, Bioinformatics, https://doi.org/10.1093/bioinformatics/btx434.

### Examples

```
## Not run:
## These examples are not run on CRAN because they take too long.
## You can still try them for yourself.
img <- ijtiff::read_tif(system.file("extdata", "bleached.tif",
package = "detrendr"
))
best_degree(img, parallel = 2)
## End(Not run)
```

*detrendr*version 0.6.15 Index]