Skip to content

Image-Based Estimation of Soil Aggregate Stability

License

Notifications You must be signed in to change notification settings

Soil-Health-Institute/SlakeItEasy

Repository files navigation

SlakeItEasy: Image-Based Estimation of Soil Aggregate Stability

{SlakeItEasy} provides utility functions to estimate soil aggregate stability via analysis of images of air-dried soil and soil undergoing slaking in water, following Fajardo et al. (2016). Functions are provided to analyze individual images, multiple images per sample, and the output of high-throughput image aquisition schemes (e.g., multiple replicates, multiple samples). See here for the Soil Health Institute's Standard Operating Procedure for multi-sample image acquisition.

SlakeItEasy hexsticker

Installation

First, install R and R Studio. If you are running Windows, you will also need to install Rtools.

Run the following lines in R Studio to install the latest version of {SlakeItEasy} from GitHub using the {remotes} package:

# install {remotes} if missing
if (!require(remotes)) {
install.packages('remotes')
}
# install latest version of {SlakeItEasy} from GitHub repository
remotes::install_github('Soil-Health-Institute/SlakeItEasy')

{SlakeItEasy} allows users to analyze batches of images in parallel with the {foreach} package. Run the following lines to install dependencies for parallelization. (Note: users on Mac OSX and Linux can alternatively opt to use the pre-installed {parallel} package.)

install.packages(c('foreach', 'future', 'doFuture'))

Note that users on Windows may need to install Strawberry Perl before using image metadata extraction utilities from the {exifr} package. After installing Strawberry Perl, complete configuration in R as follows:

exifr::configure_exiftool()

If {fftwtools} and {EBImage} fail to install on Linux, run the following in the terminal:

sudo apt-get install libfftw3-dev

File structure

For batch processing, image sequences (i.e., images of air-dried soil, soil upon submersion in water, and soil after slaking for a predetermined interval) should be organized into one directory per replicate (e.g., per petri dish). To make data wrangling easier, name directories with the sample ID and Petri dish number (e.g., SampleID_PetriDishNumber, as below).

Example file structure

Example workflow

Detailed vignettes are under development. In the meantime, an example workflow can be accessed within R Studio as follows (or by clicking here).

invisible(rstudioapi::navigateToFile(system.file("demo", "example_workflow.R", package = "SlakeItEasy")))

Citation

To cite {SlakeItEasy} in publications, run the following to generate a text reference and BibTeX entry:

citation('SlakeItEasy')