Skip to contents

Given the path of the .csv file corresponding to TrackR output, this function returns an object of class "tracklets", a list of tracklets (data frame) containing 7 elements classically used for further computations using MoveR package:

  • 'maj.ax': the length of the major axis (i.e., the midline) for a particle over frame (i.e., length of the ellipse).

  • 'angle': the particle's absolute angle in radians, orientation of the particle according to y-axis.

  • 'min.ax': the length of the minor axis for a particle over frame (i.e., width of the ellipse).

  • 'x.pos': x position of the particle's centroid.

  • 'y.pos': y position of the particle's centroid.

  • 'identity': the particle's identity given by the tracking software.

  • 'frame': the video frame number at which the measurements has been made.

The function can also append all the others elements returned by the tracking software (see rawDat argument) Also, the function can flip y coordinates (see flipY argument).

Usage

readTrackR(trackRPath, flipY = FALSE, imgHeight = NULL, rawDat = FALSE)

Arguments

trackRPath

The full path of the TrackR output file (.csv).

flipY

A logical value (i.e., TRUE or FALSE) indicating whether the origin of y coordinates should be flipped. If TRUE, y coordinates are flipped to start on the top-left (default = FALSE).

imgHeight

A numeric value expressed in pixels, the length of Y axis corresponding to the height of the image or video resolution (optional, only used when flipY = TRUE).

rawDat

A logical value (i.e., TRUE or FALSE) indicating whether all other elements retrieved from the tracking output should appended to the tracklets data (see trackR). Note that this may drastically increase the size of the object returned by the function (default = FALSE).

Value

An object of class "tracklets" containing a list of tracklets and their characteristics classically used for further computations. In case rawDat argument is TRUE, it also append all the others elements returned by the tracking software (for TrackR it corresponds to "n" the number of pixels covered by the object in a given frame). Also, by default the function returns y coordinates starting on the bottom-left.

Author

Quentin PETITJEAN

Examples

if (FALSE) {

# Download the first dataset from the sample data repository
Path2Data <- MoveR::DLsampleData(dataSet = 1, tracker = "TrackR")
Path2Data

# Import the data as an object of class "tracklets"
# also do not flip Y coordinates (start on the bottom-left)
Data <-
  MoveR::readTrackR(Path2Data[[1]])
  
str(Data)

}