View source: R/helperfunctions.R
spotsInBox | R Documentation |
Takes a dataframe containing Mesh x/y coordinates and a dataframe containing Spots/Object x/y coordinates and returns the relative localization of the Spots/Objects inside the meshes, and the relative coordinates of the meshes from the mid-point of each mesh, where the longest axis of the cell is horizontal in the x/y plane.
spotsInBox(spotdata, meshdata, Xs = "x", Ys = "y", Xm = "X", Ym = "Y", meshInOutput=FALSE)
spotdata |
dataframe containing spot coordinates. Needs at least the columns |
meshdata |
dataframe containing mesh coordinates. Needs at least the columns |
Xs |
column in dataframe |
Ys |
column in dataframe |
Xm |
column in dataframe |
Ym |
column in dataframe |
meshInOutput |
When TRUE, the 'mesh' (see below) will be part of the output of the spotsInBox function. |
A list of two data frames:
spots_relative:
$x |
x-coordinate of the spot or object point (same as original dataframe) |
$y |
y-coordinate of the spot or object point (same as original dataframe) |
$cell |
identifies the cell the spot/object point belongs to |
$frame |
frame number of original image stack |
$max.width |
maximum cell width |
$length |
length of the cell |
$L |
relative location of the spot/object point to the length axis of the cell |
$D |
relative location of the spot/object point to the width axis of the cell |
mesh:
$X |
x-coordinate of the mesh contour point (same as original dataframe) |
$Y |
y-coordinate of the mesh contour point (same as original dataframe) |
$cell |
identifies the cell |
$frame |
frame number of the original image stack |
$max.width |
maximum cell width |
$length |
length of the cell |
$X_rot |
x-coordinate of the mesh point when the cell is turned with the length axis horizontally, midpoint at coordinate (0,0) |
$Y_rot |
y-coordinate of the mesh point when the cell is turned with the length axis horizontally, midpoint at coordinate (0,0) |
Renske van Raaphorst
## Not run:
##get spot data from ISBatch
spots <- bactMAP::extr.ISBatch(file.choose())$spotframe
##get mesh data from Oufti
mesh <- bactMAP::extr.Oufti(file.choose())$mesh
##get relative spot and mesh locations
outlist <- spotsInBox(spots, mesh, Xm="x", Ym="y")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.