plotThresholdedFrame {scalpel}R Documentation

Plot a frame of the video with shading.

Description

We plot a specified frame of the processed video, which results from Step 0 of SCALPEL, with shading to indicate values above a specified threshold.

Usage

plotThresholdedFrame(
  scalpelOutput,
  frame,
  threshold,
  shrinkLargest = FALSE,
  shrinkCutoff = NULL,
  title = NULL,
  col = "yellow",
  Y = NULL
)

Arguments

scalpelOutput

An object returned by one of the SCALPEL functions: scalpel, scalpelStep0, scalpelStep1, scalpelStep2, or scalpelStep3.

frame

The frame to plot.

threshold

Value above which pixels will be shaded.

shrinkLargest

Logical value indicating whether the values above shrinkCutoff should be shrunk when plotting. Shrinking these values allows us to better visualize the areas with the largest fluorescence.

shrinkCutoff

The value above which pixel values will be shrunk. By default, this will be chosen as scalpelOutput$lowThreshold if class(scalpelOutput)=="scalpelStep0" or min(scalpelOutput$thresholdVec) otherwise.

title

Label for the title. By default, it gives the threshold value.

col

Color of shading to use, which is yellow by default.

Y

An object of class scalpelY, which results from running the getY function. When not specified, Y is automatically read in, but specifying Y is recommended when the user would like to call this function many times, as this avoids reading the video into memory repeatedly.

Value

None

See Also

scalpelStep0, scalpel

Examples

## Not run: 
### many of the functions in this package are interconnected so the
### easiest way to learn to use the package is by working through the vignette,
### which is available at ajpete.com/software

#assumes you have run the example for the "scalpel" function

#simplest example with default parameters:
plotThresholdedFrame(scalpelOutput = scalpelOutput, frame = 100,
                    threshold = scalpelOutput$thresholdVec[1])

#example with optional parameters:
#change shading to purple and add a title
plotThresholdedFrame(scalpelOutput = scalpelOutput, frame = 100, col = "purple",
                   threshold = scalpelOutput$thresholdVec[2])

#if you have video data read in already using 'getY' function, you can provide it
processedY = getY(scalpelOutput = scalpelOutput, videoType = "processed")
plotThresholdedFrame(scalpelOutput = scalpelOutput, frame = 100,
                    threshold = scalpelOutput$thresholdVec[1], Y = processedY)

## End(Not run)

[Package scalpel version 1.0.3 Index]