Learn R Programming

vprr

The goal of vprr is to process Video Plankton Recorder (VPR) data in R. This package allows for manual image classification, calculation of important ecological metrics such as concentration of plankton, data visualization, and data output with self-contained metadata.

Detailed information about vprr can be found in the package vignette.

Installation

You can install the released version of vprr from CRAN with:

install.packages("vprr")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("EOGrady21/vprr")

Details

vprr is designed to be used after processing VPR data with an automated image classification system. vprr utilizes file formats and directory structures consistent with those from Visual Plankton (VP), a Matlab image classification software designed for VPR datasets; however, vprr is not dependent on any specific elements of VP.

All the technical details of vprr can be found in the package vignette, available through Rstudio or at https://eogrady21.github.io/vprr/ (under Articles).

Figure 1. VPR data processing flow chart. Blue boxes represent software, green and yellow boxes represent data sets, where yellow is visual data and green is text format data. This package represents ‘Processing and Visualization (R)’.

The first element of processing VPR data is to classify the images collected. This can be done using machine learning techniques and then checked and manually edited in vprr. vprr uses a GUI, called through vpr_manual_classification() to allow a user to review and change image classifications.

Figure 2. A screenshot from the vprr manual reclassification process. VPR images are displayed in the RStudio Viewer (right), prompts are displayed in the RStudio console (left). Users are asked if classifications are correct, if not, they are asked to select the proper classification from a pre-set list of categories.

Once images have been properly classified, all data sources are combined, in order to analyze data and calculate metrics such as plankton concentration. Data from CTD files (vpr_ctd_read()) and image classification (vpr_autoid_read()) can be read in and combined into data frames. vprr can combine VPR CTD, and VPR image classifications into depth bins, and calculate concentration (vpr_roi_concentration()).

After data is processed, it can be visualized for easy interpretation. Although this package does not focus on visualization, it does provide some basic plotting functions for tow-yo VPR data (vpr_plot_contour()).

Figure 3. An example of visualization of VPR data showing calculated concentration of Calanus along the VPR tow-yo path, over density contours.

Copy Link

Version

Install

install.packages('vprr')

Monthly Downloads

124

Version

0.2.3

License

MIT + file LICENSE

Maintainer

Emily Chisholm

Last Published

July 12th, 2022

Functions in vprr (0.2.3)

getRoiMeasurements

THIS FUNCTION HAS BEEN DEPRECATED
insertRow

INTERNAL USE ONLY quick data frame function from github to insert row inside dat frame
roi_dat_combine

VPR ROI data
px_to_mm

Get conversion factor for pixels to mm for roi measurements
vpr_autoid_create

Modifies aid and aid mea files based on manual reclassification
vpr_autoid_copy

Copy VPR images into folders
ctd_roi_merge

VPR CTD data combined with tabulated ROIs
bin_cast

Bin vpr data
bin_calculate

Get bin averages for VPR and CTD data
roimeas_dat_combine

VPR measurement data calculated by Visual Plankton
vpr_ctd_read

Read and format CTD VPR data
vpr_ctd_ymd

Add Year/ month/ day hour:minute:second information
size_df_f

VPR size information dataframe
vpr_img_copy

Image copying function for specific taxa of interest
vpr_roi_concentration

Calculate VPR concentrations
vpr_save

Save VPR data as an as.oce object
vpr_img_check

Remove ROI strings from aid and aidmeas files based on a manually organized folder of images
vpr_day

Get day identifier
taxa_conc_n

A binned data frame of concentration data per category
vpr_size_bin

Bin VPR size data
ctd_roi_oce

VPR data including CTD and ROI information
vpr_plot_TScat

Make a balloon plot
vpr_plot_TS

Make a balloon plot against a TS plot
normalize_matrix

Normalize a matrix
ctd_df_cols

Read CTD data (SBE49) and Fluorometer data from CTD- VPR package
isopycnal_calculate

Get vector to draw isopycnal lines on TS plot Used internally to create TS plots
ctd_dat_combine

VPR CTD data
vpr_ctdroi_merge

Merge CTD and ROI data from VPR
vpr_summary

Data Summary Report
vpr_ctdroisize_merge

Format CTD and Size data from VPR
vpr_hour

Get hour identifier
vpr_img_category

Explore images by depth and classification
vpr_dayhour

Find day & hour info to match each station of interest for processing
vp_plot_matrix

Plots normalized confusion matrix
vpr_plot_contour

Interpolated contour plot of particular variable
vpr_autoid_read

Read VPR aid files
vpr_category

Get taxa ids from string
vpr_manual_classification

Function to check results of classification manually
vpr_oce_create

Create ctd oce object with vpr data
ctd_cast

Isolate ascending or descending section of ctd cast
concentration_category

Binned concentrations
vpr_plot_histsize

Plot size frequency histogram
vp_plot_unkn

Function to visualize losses to unknown category due to disagreement in Dual classifier
vpr_autoid_check

Checks manually created aid files for errors
vpr_category_create

Create a new taxa to be considered for classification after processing with VP
vpr_ctd_files

Create a list of ctd files to be read
vpr_img_depth

Explore VPR images by depth bin
vpr_img_reclassified

Explore reclassified images
vpr_pred_read

Read prediction output from a CNN model
vpr_roi

Get roi ids from string
vpr_trrois_size

Get size data from idsize files
vpr_plot_profile

Plots VPR profiles of temperature, salinity, density, fluorescence and concentration (by classification group)
vpr_plot_sizefreq

Size Frequency plots for VPR data