plotBrightest: Plot the most active frames for a given neuron.

Description Usage Arguments Value See Also Examples

Description

For a given neuron, we plot the frames with the highest estimated fluorescence, which results from fitting the sparse group lasso in Step 3 of SCALPEL.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
plotBrightest(
  scalpelOutput,
  AfilterIndex,
  videoType = "processed",
  neuronsToOutline = "all",
  brightIndex = 1,
  shrinkLargest = FALSE,
  shrinkCutoff = NULL,
  title = NULL,
  Y = NULL
)

Arguments

scalpelOutput

An object returned by one of the SCALPEL functions: scalpel or scalpelStep3.

AfilterIndex

Scalar giving the neuron for which to plot the brightest frames. The index refers to which column of scalpelOutput$Afilter is of interest.

videoType

Specify whether to plot the processed data from Step 0 (default; videoType="processed") or raw data (videoType="raw"). This is ignored if Y is provided.

neuronsToOutline

Specify whether to plot outlines of all neurons (default; neuronsToOutline="all"), only the outline for neuron (neuronsToOutline="main"), outlines of only the neurons kept using a previous call to reviewNeurons or reviewNeuronsInteractive (neuronsToOutline="kept"), or none (neuronsToOutline="none").

brightIndex

Scalar giving which of the ordered brightest frames to plot. The default is 1, i.e., the brightest frame.

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 min(scalpelOutput$thresholdVec).

title

Label for the title. The default is frame number.

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

scalpel, scalpelStep3

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## 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:
plotBrightest(scalpelOutput = scalpelOutput, AfilterIndex = 2)

#example with optional parameters:
#only outline neuron corresponding to frame, plot 5th brightest with raw data
plotBrightest(scalpelOutput = scalpelOutput, AfilterIndex = 2, videoType = "raw",
             neuronsToOutline = "main", brightIndex = 5)

#same plot but if you have video data read in already
#using 'getY' function, you can provide it
rawY = getY(scalpelOutput = scalpelOutput, videoType = "raw")
plotBrightest(scalpelOutput = scalpelOutput, AfilterIndex = 2, Y = rawY,
             neuronsToOutline = "main", brightIndex = 5)

## End(Not run)

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