Learn R Programming

RFishBC (version 0.2.7)

digitizeRadii: Collect radial measurements from a calcified structure by interactively selecting annuli

Description

The user interactively select points on an image of a calcified structure. When finished, radial measurements (from the structure focus to the selected points) are calculated (either with arbitrary units or actual units if a scale-bar is included on the image) and written to an external file for later use.

Usage

digitizeRadii(
  img,
  id,
  reading,
  suffix,
  description,
  edgeIsAnnulus,
  popID,
  IDpattern,
  IDreplace,
  windowSize,
  deviceType,
  closeWindow,
  scaleBar,
  scaleBarLength,
  scaleBarUnits,
  col.scaleBar,
  lwd.scaleBar,
  scalingFactor,
  makeTransect,
  snap2Transect,
  col.transect,
  lwd.transect,
  pch.sel,
  col.sel,
  cex.sel,
  pch.del,
  col.del,
  showInfo,
  pos.info,
  cex.info,
  col.info,
  addNote,
  note
)

Value

NULL if more than one file was given in img; otherwise (i.e., only one file was given) a list with the following:

image:

The full filename given in img.

datanm:

The R data filename.

description:

The description given in description.

edgeIsAnnulus:

The logical given in edgeIsAnnulus that identified whether the structure edge/margin should be considered as an annulus.

snap2Transect:

The logical from snap2Transect that identified whether the selected points were “snapped” to the transect or not.

scalingFactor:

A single numeric used to convert measurements on the structure image to actual measurements on the structure. Measurements on the structure image were multiplied by this value.

sfSource:

A character string that identifies whether the scaling factor was "Provided" through the scalingFactor argument or derived from a "scaleBar".

sbPts:

A data.frame of x and y coordinates for the endpoints of the scale-bar if the scaling factor was derived from a scale-bar.

sbLength:

A single numeric that is the known (actual) length of the scale-bar if the scaling factor was derived from a scale-bar.

sbUnits:

A single character that is the units of measurement for the known (actual) length of the scale-bar if the scaling factor was derived from a scale-bar.

slpTransect:

The slope of the transect.

intTransect:

The intercept of the transect.

slpPerpTransect:

The slope of the line perpendicular to the transect.

windowSize:

A numeric of length two that contains the width and height of the window used to display the structure image. One of these units was set by the given windowSize value.

pixW2H:

The ratio of pixel width to height. This is used to correct measurements for when an image is not square.

pts:

A data.frame that contains the x and y coordinates on the image for the selected annuli. These points may have been “snapped” to the transect if snap2Transect==TRUE.

radii:

A data.frame that contains the unique id, the reading code, the age-at-capture in agecap, the annulus number in ann, the radial measurements in rad, and the radial measurement at capture in radcap.

note:

A string that contains a note about the reading (e.g., a note that the image was poor, some annulus were suspect, or the image should be re-read.)

Arguments

img

A vector of strings that indicates the image (must be PNG, JPG, BMP, or TIFF) to be loaded and plotted. By default the user will be provided a dialog box from which to choose the file(s). Alternatively the user can supply the name(s) of the file(s). Either way the file(s) must be in the current working directory.

id

A vector of unique identifiers for the fish or structure(s) being examined. Will be coerced to a character. If length of img is greater than 1, then the length of id must be the same. If missing then you will be prompted to enter a value.

reading

See details in RFBCoptions.

suffix

See details in RFBCoptions.

description

See details in RFBCoptions.

edgeIsAnnulus

See details in RFBCoptions.

popID

See details in RFBCoptions.

IDpattern

See details in RFBCoptions.

IDreplace

See details in RFBCoptions.

windowSize

See details in RFBCoptions.

deviceType

See details in RFBCoptions.

closeWindow

See details in RFBCoptions.

scaleBar

See details in RFBCoptions.

scaleBarLength

See details in RFBCoptions.

scaleBarUnits

See details in RFBCoptions.

col.scaleBar

See details in RFBCoptions.

lwd.scaleBar

See details in RFBCoptions.

scalingFactor

See details in RFBCoptions.

makeTransect

See details in RFBCoptions.

snap2Transect

See details in RFBCoptions.

col.transect

See details in RFBCoptions.

lwd.transect

See details in RFBCoptions.

pch.sel

See details in RFBCoptions.

col.sel

See details in RFBCoptions.

cex.sel

See details in RFBCoptions.

pch.del

See details in RFBCoptions.

col.del

See details in RFBCoptions.

showInfo

See details in RFBCoptions.

pos.info

See details in RFBCoptions.

cex.info

See details in RFBCoptions.

col.info

See details in RFBCoptions.

addNote

See details in RFBCoptions.

note

A specific note about this reading (e.g., a note that the image was poor, some annulus were suspect, or the image should be re-read.). If missing then the user will be prompted to include a note if addNote=TRUE.

Author

Derek H. Ogle, DerekOgle51@gmail.com.

Details

This function requires interaction from the user. A detailed description of its use is in the vignettes on the RFishBC website.

See Also

showDigitizedImage and RFBCoptions.

Examples

Run this code
## None because this requires interaction from the user.
## See the link to the extensive documentation in the Details.

Run the code above in your browser using DataLab