Calibrate_Database: Calibrate the SizeExtractR database, based on known...

Description Usage Arguments Value Examples

View source: R/Calibrate_Database.R

Description

Calibrate the SizeExtractR database, based on known calibration length (cm)

Usage

1
Calibrate_Database(datalab, known.length)

Arguments

datalab

An object of class dataframe as output directly from SizeExtractR::Add_ROILabelCodeVars()

known.length

a numerical value of the length of calibration lengths from image analyses (in user-defined units, e.g. centimeters).

Value

For each image independently, this function returns a calibrated SizeExtractR database (dataframe object).

It does these calibrations on a per image basis. The mean number of pixels is calculated among all the calibration lengths in that image (i.e., ROIs with ROI.Type of "M"). This is then compared to the 'known.length' parameter, to compute all aspects of size of each ROI.

Length, Position, Area, and Volume are all given in user-defined units, e.g. centimeters.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# load in the output of Add_ROILabelCodeVars
data(Database.ROILabelCode)

#Run the function
Database.cal = Calibrate_Database(Database.ROILabelCode, known.length = 1)

# Histogram of Egg Sizes:
par(mfrow = c(1,2))
# Uncalibrated
ind = which(Database.ROILabelCode$ROI.Type == "e")
hist(Database.ROILabelCode$Area[ind], xlab = "Area (pixels)", main = "Uncalibrated Egg Sizes")

# Calibrated
ind2 = which(Database.cal$ROI.Type == "e")
hist(Database.cal$Area[ind2], xlab = bquote(Area~(cm^2)), main = "Calibrated Egg Sizes")

liamlachs/SizeExtractR documentation built on Feb. 13, 2022, 9:46 p.m.