slitflow.trj.wtrackpy module
Caution
This module consists of brief wrapper classes of Trackpy.
Wrapper classes do not cover all functionality of Trackpy functions. Please create your custom class to use Trackpy functions that are not provided in this module.
Do not ask the Trackpy developers any questions about the wrapper part that is not directly related to the Trackpy package.
If you use Trackpy functions in this module, please cite original package according to the package documentation.
- class Link(info_path=None)[source]
Bases:
TableBrief wrapper of trackpy link function.
See also trackpy.link function. While trackpy supports 3D, this wrapper class uses only 2D image.
The input localization table should have all frames for linking. You have to split data into appropriate depths. Currently, only the table containing
img_no,frm_no,x_(length_unit)andy_(length_unit)is available.- Parameters:
reqs[0] (Table) – X,Y-coordinate of localization. Required params;
length_unit. Required columns;img_no,frm_no,x_(length_unit)andy_(length_unit).param["search_range"] (float) – Maximum distance features can move between frames in length_unit.
param["split_depth"] (int) – File split depth number.
- Returns:
Trajectory Table
- Return type:
- set_info(param)[source]
Copy info from reqs[0] and add params.
Caution
Currently, only the table containing
img_no,frm_no,x_(length_unit)andy_(length_unit)is available.
- static process(reqs, param)[source]
Brief wrapper of trackpy link function.
- Parameters:
reqs[0] (pandas.DataFrame) – X,Y-coordinate of localization. Required params;
length_unit. Required columns;img_no,frm_no,x_(length_unit)andy_(length_unit).param["search_range"] (float) – Maximum distance features can move between frames in length_unit.
param["calc_cols"] (list of str) – Column names of X,Y-coordinate.
- Returns:
Trajectory table
- Return type:
- class RefineCoM(info_path=None)[source]
Bases:
TableRefine localization using center of mass in trackpy.
- Parameters:
- Returns:
Refined X,Y-coordinate
- Return type:
- static process(reqs, param)[source]
Refine localization using center of mass in trackpy.
- Parameters:
reqs[0] (numpy.ndarray) – Raw movie Image.
reqs[1] (pandas.DataFrame) – X,Y-coordinate of trajectory. Required columns;
x_(length_unit),y_(length_unit).param["img_size"] (list of int) – [width, height] of each image in pixel.
param["pitch"] (float) – Pixel size in length_unit/pix.
param["radius"] (int) – Mask radius for trackpy in pixel.
param["calc_cols"] (list of str) – Column names for [x, y] coordinates.
- Returns:
Refined X,Y-coordinate
- Return type:
- class Locate(info_path=None)[source]
Bases:
TableBrief wrapper of trackpy batch function.
This class uses only two-dimensional image. Image stack should be split into the image number.
- Parameters:
- Returns:
X,Y-coordinate of detected points
- Return type:
- static process(reqs, param)[source]
Brief wrapper of trackpy batch function.
- Parameters:
reqs[0] (numpy.ndarray) – Numpy 2D array of image for location detection.
param["diameter"] (odd integer) – Feature size in pixel.
param["pitch"] (float) – Pixel size in length_unit/pix.
param["col_names"] (list of str) – List of column names. This should be [frame number (frm_no), point number (point_no), X-coordinate (x_[length_unit]), Y-coordinate (y_[length_unit]), Total integrated brightness (mass), Radius of gyration (size), Eccentricity (ecc), Signal (signal), Total integrated brightness in raw_image (raw_mass), Error in a feature’s position (ep)].
- Returns:
X,Y-coordinate and other parameters of detected points
- Return type: