scalpelStep1: Perform Step 1 of SCALPEL.

Description Usage Arguments Details Value See Also Examples

View source: R/SCALPEL_stepFunctions.R

Description

This step involves constructing a spatial component dictionary. We apply a simple image segmentation procedure to each frame of the video in order to derive a dictionary of preliminary dictionary elements. Ideally, this dictionary is a superset of the true spatial components.

Usage

1
2
3
4
5
6
7
8
scalpelStep1(
  step0Output,
  minSize = 25,
  maxSize = 500,
  maxWidth = 30,
  maxHeight = 30,
  thresholdVec = NULL
)

Arguments

step0Output

An object of class scalpel or scalpelStep0, which result from running the scalpel or scalpelStep0 functions, respectively.

minSize, maxSize

The minimum and maximum size, respectively, for a preliminary dictionary element with default values of 25 and 500, respectively.

maxWidth, maxHeight

The maximum width and height, respectively, for a preliminary dictionary element with default values of 30.

thresholdVec

Optional advanced user argument: A vector with the desired thresholds to use for image segmentation. If not specified, the default is to use the negative of the minimum of the processed Y data (i.e., step0Output$highThreshold), the negative of the 0.1% quantile of the processed Y data (i.e., step0Output$lowThreshold), and the mean of these. These automatically chosen thresholds can also be updated using updateThreshold.

Details

Several files containing data from this step and a summary of the step are saved in "outputFolder/Step1_version" where version is a 5-digit unique identifier that is automatically generated.

Value

An object of class scalpelStep1, which can be summarized using summary, used to run SCALPEL Step 2 using scalpelStep2, or can be used with the plotting function plotCandidateFrame.

See Also

The entire SCALPEL pipeline can be implemented using the scalpel function. The other steps in the pipeline can be run using the scalpelStep0, scalpelStep2, scalpelStep3 functions. Results from this step can be summarized using summary, loaded at a later time using getScalpelStep1, and plotted using plotCandidateFrame.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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 "scalpelStep0" function

#run Step 1 of SCALPEL
Step1Out = scalpelStep1(step0Output = Step0Out)
summary(Step1Out)

## End(Not run)

scalpel documentation built on Feb. 3, 2021, 9:05 a.m.