Package xroi. February 13, 2019

Similar documents
Package ECctmc. May 1, 2018

Package projector. February 27, 2018

Package gifti. February 1, 2018

Package tiler. June 9, 2018

Package fastdummies. January 8, 2018

Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package docxtools. July 6, 2018

Package spark. July 21, 2017

Package canvasxpress

Package validara. October 19, 2017

Package barcoder. October 26, 2018

Package weco. May 4, 2018

Package datasets.load

Package profvis. R topics documented:

Package tabulizer. June 7, 2018

Package colourpicker

Package sigqc. June 13, 2018

Package pairsd3. R topics documented: August 29, Title D3 Scatterplot Matrices Version 0.1.0

Package WordR. September 7, 2017

Package rnaturalearth

Package editdata. October 7, 2017

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package sankey. R topics documented: October 22, 2017

Package bigreadr. R topics documented: August 13, Version Date Title Read Large Text Files

Package crossword.r. January 19, 2018

Package rcmdcheck. R topics documented: November 10, 2018

Package TrafficBDE. March 1, 2018

Package regexselect. R topics documented: September 22, Version Date Title Regular Expressions in 'shiny' Select Lists

Package linkspotter. July 22, Type Package

Package rprojroot. January 3, Title Finding Files in Project Subdirectories Version 1.3-2

Package effectr. January 17, 2018

Package slickr. March 6, 2018

Package sigmanet. April 23, 2018

Package zip. R topics documented: March 11, Title Cross-Platform 'zip' Compression Version 2.0.1

Package ggextra. April 4, 2018

Package tfruns. February 18, 2018

Package robotstxt. November 12, 2017

Package rnn. R topics documented: June 21, Title Recurrent Neural Network Version 0.8.1

Package ggimage. R topics documented: December 5, Title Use Image in 'ggplot2' Version 0.1.0

Package kirby21.base

Package arphit. March 28, 2019

Package nngeo. September 29, 2018

Package pdfsearch. July 10, 2018

Package githubinstall

Package postgistools

Package io. January 15, 2018

Package SEMrushR. November 3, 2018

Package ggimage. R topics documented: November 1, Title Use Image in 'ggplot2' Version 0.0.7

Package lumberjack. R topics documented: July 20, 2018

Package radix. September 17, 2018

Package IncucyteDRC. August 29, 2016

Package dkanr. July 12, 2018

Package rosm. April 8, 2017

Package shinyhelper. June 21, 2018

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package smapr. October 20, 2017

Package memery. February 13, 2018

Package ecoseries. R topics documented: September 27, 2017

Package jstree. October 24, 2017

Package farver. November 20, 2018

Package statsdk. September 30, 2017

Package narray. January 28, 2018

Package shinyfeedback

Package kdtools. April 26, 2018

Package meme. November 2, 2017

Package sfdct. August 29, 2017

Package ECOSolveR. February 18, 2018

Package messaging. May 27, 2018

Package gfcanalysis. August 29, 2016

Package knitrprogressbar

Package omu. August 2, 2018

Package goodpractice

Package redlistr. May 11, 2018

Package wikitaxa. December 21, 2017

Package shiny.semantic

Package nmslibr. April 14, 2018

Package RTNduals. R topics documented: March 7, Type Package

Package jpmesh. December 4, 2017

Package jdx. R topics documented: January 9, Type Package Title 'Java' Data Exchange for 'R' and 'rjava'

Package vinereg. August 10, 2018

Package inpdfr. December 20, 2017

Package CatEncoders. March 8, 2017

Package calpassapi. August 25, 2018

Package d3plus. September 25, 2017

Package areaplot. October 18, 2017

Package Grid2Polygons

Package rbgm. May 18, 2018

Package qualmap. R topics documented: September 12, Type Package

Package condir. R topics documented: February 15, 2017

Package internetarchive

Package ssh. June 4, 2018

Package smoothr. April 4, 2018

Package sessioninfo. June 21, 2017

Package BASiNET. October 2, 2018

Package fitbitscraper

Package rpostgislt. March 2, 2018

Package tidytransit. March 4, 2019

Package bisect. April 16, 2018

Package data.world. April 5, 2018

Package CorporaCoCo. R topics documented: November 23, 2017

Transcription:

Package xroi February 13, 2019 Title Delineate Region of Interests (ROI's) and Extract Time-Series Data from Digital Repeat Photography Images Version 0.9.13 Date 2019-02-12 Author Bijan Seyednasrollah, Thomas Milliman, Andrew D. Richardson Maintainer Bijan Seyednasrollah <bijan.s.nasr@gmail.com> Digital repeat photography and near-surface remote sensing have been used by environmental scientists to study the environmental change for nearly a decade. However, a userfriendly, reliable, and robust platform to extract color-based statistics and timeseries from a large stack of images is still lacking. Here, we present an interactive opensource toolkit, called 'xroi', that facilitate the process time-series extraction and improve the quality of the final data. 'xroi' provides a responsive environment for scientists to interactively a) delineate regions of interest (ROI), b) handle field of view (FOV) shifts, and c) extract and export time series data characterizing image color (i.e. red, green and blue channel digital numbers for the defined ROI). Using 'xroi', user can detect FOV shifts without minimal difficulty. The software gives user the opportunity to readjust the mask files or redraw new ones every time an FOV shift occurs. 'xroi' helps to significantly improve data accuracy and continuity. Depends R (>= 3.4.0) Imports colourpicker, data.table, graphics, jpeg, lubridate, methods, moments, plotly, RCurl, raster, rgdal, rjson, shiny, shinyjs, shinybs, shinyace, shinytime, shinyfiles, shinydashboard, shinythemes, sp, stats, stringr, tiff, utils Suggests knitr, testthat, rmarkdown, License AGPL-3 Encoding UTF-8 LazyData true BugReports https://github.com/bnasr/xroi/issues RoxygenNote 6.1.1 VignetteBuilder knitr NeedsCompilation no Repository CRAN Date/Publication 2019-02-13 22:00:03 UTC 1

2 addmask R topics documented: addmask........................................... 2 detectshifts......................................... 3 drawpolygon........................................ 3 extractccc......................................... 4 extractccctimeseries................................... 5 getcl............................................ 5 getclarray......................................... 6 getserver.......................................... 6 gettmpdir.......................................... 7 getui............................................ 7 Launch........................................... 8 parsephenocamfilenames.................................. 8 parseroi.......................................... 9 plotclarray......................................... 9 plotjpeg.......................................... 10 rasterizeroi......................................... 11 writeroi.......................................... 11 Index 13 addmask Plot or add a mask This function plots or adds a mask raster on the default graphics. addmask(mask, add = TRUE, col = "black") mask add col a binary or logical matrix, describing the mask (0:black for selected pixels, 1:white for not selected pixels) a logical variable, whether to add the mask to an existing plot a character string, color value of the plotted mask #read a mask file in TIFF format m <- tiff::readtiff(system.file(package = 'xroi', 'dukehw-mask.tif')) str(m) #plot the mask in black color

detectshifts 3 addmask(m, add = FALSE) #add the same mask in the red color to the existing plot addmask(m, add = TRUE, col = 'red') detectshifts Detect FOV shift This function calculates day-to-day similarity of images based on the CLI file. detectshifts(cli_path) cli_path a character string, path to the CLI file a data.frame with two columns containing day-to-day correlations of the brightness and blue bands cli_path <- system.file(package = 'xroi', 'archboldbahia-cli.jpg') cor_mat <- detectshifts(cli_path) plot(cor_mat$brightness.cor) plot(cor_mat$blue.cor) drawpolygon Interactive drawing of a polygon This function provides an interactive tool for drawing of polygons by user clicks on the plotted graphics drawpolygon(col = "#80303080", lty = 1,...)

4 extractccc col a character string, color value of the polygon polygon lty a numeric value, lty variable as line type... passing graphical arguments the coodinates of the clicked points #user can click to add vertices, pressing the Escape key would end it. if(interactive()){ drawpolygon() } extractccc Extract chromatic coefficients and their statistics This function applies a mask matrix to a jpeg image and extract statstical metrics for each chromatic coordinate on R, G and B. extractccc(path, m) path m a character string, path to the JPEG file a binary mask, mask binary matrix (0 for included, 1 for not) The function returns statistical metrics for each color channel. It returns NULL, if dimensions do not agree. m <- tiff::readtiff(system.file(package = 'xroi', 'dukehw-mask.tif')) jpgfile <- system.file(package = 'xroi', 'dukehw.jpg') cc <- extractccc(jpgfile, m)

extractccctimeseries 5 extractccctimeseries Extract chromatic coefficients and their statistics for an array of JPEG files This function apples a list of mask matrices to a vector of jpeg images and extract statstical metrics for each chromatic coordinate on R, G and B. extractccctimeseries(rmsklist, mindex, paths) rmsklist mindex paths a list, rasters of mask as list a numeric vector, a vector of integer numbers as the index of mask files, same length as paths. This vector shows which mask should be used with which JPEG file. a vector of character strings, paths to the JPEG files This function returns statistical metrics for each color channel. The function returns NULL, if dimensions do not agree. getcl Center line column of an image This function returns the R,G,B vectors extracted from the center-line of a JPEG file getcl(file) file a character string, path to the JPEF file a three-column matrix of red, green blue bands of the center line

6 getserver f <- system.file(package = 'xroi', 'dukehw.jpg') cli <- getcl(f) getclarray Center line arrary of an array of image This function returns CLI array for vector of JPEG files getclarray(files) files a vector of character strings, paths to the JPEF files A 3D array. The center line image as an array (NxHx3), where N is number of files, and H is the height of an image in pixels. f <- system.file(package = 'xroi', 'dukehw.jpg') cli <- getcl(f) getserver Server function This funciton constructs the server functions of the shiny app. getserver(exdir, inputdir = NULL)

gettmpdir 7 exdir inputdir path to the example directory a character string. the path to the input directory the shiny server object gettmpdir Path to the TEMP directory This function returns the path to the TEMP directory gettmpdir() the path to the system temporary directory p <- gettmpdir() getui UI function This funciton constructs the user interface of the shiny app. getui() the user intrface module of the shiny app.

8 parsephenocamfilenames Launch Launch xroi app This function launches the app by opening the default web browser. Launch(inputDir = NULL, Interactive = FALSE) inputdir Interactive a character string. path to the input directory. logical variable to force an interactive session this should be run in an interactive R session #Launch xroi app xroi::launch() parsephenocamfilenames Parse Phenocam filenames This function parse filename to extract sitename, date and timing of the images based on the phenocam naming convention. parsephenocamfilenames(filepaths) filepaths a character vector of filenames a datatable containing filenames, with site name, date and timing

parseroi 9 parseroi Parse ROI list file This function reads the ROI list file and returns it as a list variable parseroi(roifilepath) roifilepath a character string. path to the ROI file a list. ROI list file as a list. f <- system.file(package = 'xroi', 'example/roi/example_db_0001_roi.csv') roi <- parseroi(f) plotclarray Plot CLI array This function plots a CLI array on the graphics. plotclarray(clarray, bands = 1:3) clarray bands a numeric array. A 3D array of CLI (HxWx3) an integer vector. integer vector of length 3, showing bands to be plotted invisibly returns the dimension of the plotted image

10 plotjpeg f <- system.file(package = 'xroi', 'dukehw-cli.jpg') jp <- jpeg::readjpeg(f) plotclarray(jp) plotjpeg Plot JPEG image This funciton plots a jpeg image as a raster given image path. plotjpeg(path, add = FALSE, xlim = NULL, ylim = NULL) path add xlim ylim a character string. path to the JPEG file to be plotted. logical. logical variable whether to add the image to the existing graphics. numeric vector of lenght 2, x axis range numeric vector of lenght 2, y axis range This function returns statistical metrics for each color channel. The function returns NULL, if dimensions do not agree. f <- system.file(package = 'xroi', 'dukehw.jpg') plotjpeg(f)

rasterizeroi 11 rasterizeroi Rasterize ROI Polygons This function convert point-based polygons to raster format rasterizeroi(pnts, imgsize) pnts imgsize a numeric matrix. a two column matrix of points as relative x and y values (0 to 1) a numeric vector, size of the final raster a binary matrix. matrix of the mask file. pnts <- matrix(c(0.1, 0.2, 0.1, 0.4, 0.5, 0.4, 0.5, 0.2), 4, 2, byrow= TRUE) imgsize <- c(300, 400) m <- rasterizeroi(pnts, imgsize) xroi::addmask(m, add = FALSE) writeroi Write ROI list file This function writes the ROI list file on a disk space. writeroi(roilist, roifilepath)

12 writeroi ROIList roifilepath a list, ROI List variable to be written a character string, path to the ROI file #loading the ROI files from the example directory f <- system.file(package = 'xroi', 'example/roi/example_db_0001_roi.csv') #parsing the example ROI file and store in roi roi <- parseroi(f) #write the loaded ROI in the temporary path temppath <- file.path(tempdir(), 'roi.csv') writeroi(roi, temppath)

Index Topic App getserver, 6 getui, 7 Launch, 8 Topic CLI getcl, 5 getclarray, 6 Topic Center-line getcl, 5 getclarray, 6 Topic FOV detectshifts, 3 Topic Filename parsephenocamfilenames, 8 Topic Launch Launch, 8 Topic Parse parsephenocamfilenames, 8 Topic Polygons rasterizeroi, 11 Topic ROIList parseroi, 9 writeroi, 11 Topic ROI parseroi, 9 rasterizeroi, 11 writeroi, 11 Topic Rasterize rasterizeroi, 11 Topic Run Launch, 8 Topic Server getserver, 6 Topic Shiny getserver, 6 getui, 7 Topic UI getui, 7 Topic Write writeroi, 11 Topic bcc extractccc, 4 extractccctimeseries, 5 plotclarray, 9 plotjpeg, 10 Topic chromatic extractccc, 4 extractccctimeseries, 5 plotclarray, 9 plotjpeg, 10 Topic coefficients plotclarray, 9 plotjpeg, 10 Topic coordinates extractccc, 4 extractccctimeseries, 5 Topic directory gettmpdir, 7 Topic exract extractccc, 4 extractccctimeseries, 5 plotclarray, 9 plotjpeg, 10 Topic gcc extractccc, 4 extractccctimeseries, 5 plotclarray, 9 plotjpeg, 10 Topic image getcl, 5 getclarray, 6 Topic interactive drawpolygon, 3 Topic mask addmask, 2 Topic plot addmask, 2 drawpolygon, 3 13

14 INDEX Topic polygon drawpolygon, 3 Topic raster addmask, 2 Topic rcc extractccc, 4 extractccctimeseries, 5 plotclarray, 9 plotjpeg, 10 Topic shift detectshifts, 3 Topic temporary gettmpdir, 7 Topic xroi Launch, 8 addmask, 2 detectshifts, 3 drawpolygon, 3 extractccc, 4 extractccctimeseries, 5 getcl, 5 getclarray, 6 getserver, 6 gettmpdir, 7 getui, 7 Launch, 8 parsephenocamfilenames, 8 parseroi, 9 plotclarray, 9 plotjpeg, 10 rasterizeroi, 11 writeroi, 11