Core Classes

Fingerprint

class +TracX.@Fingerprint.Fingerprint(utils, io)

Fingerprint class constructs a Fingerprint object to compute the cell region fingerprint. Additionally it implements all the methods to compute the fingerprint and delta distance.

Authors

Andreas P. Cuny - initial implementation

Fingerprint(utils, io)

Fingerprint constructs an empty object of type Fingerprint. This class implements the fingerprint and related functionalities.

Parameters
  • utils (object) – Utils instance.

  • io (object) – IO instance.

  • configuration (object) – ImageProcessing instance.

Returns

obj – Returns a Fingerprint instance

Return type

object

Authors

Andreas P. Cuny - initial implementation

debugLevel = None

Debug level

io = None

+TracX.@IO instance implementing read/write methods

utils = None

+TracX.@Utils instance implementing utility methods

+TracX.@Fingerprint.computeAssignmentFingerprintDistanceArray(this, oldFrame, newFrame)

COMPUTEASSIGNMENTFINGERPRINTDISTANCEARRAY Computes the fingerprint distance for real fingerprints for all assigned cells between oldFrame and newFrame.

Parameters
  • this (object) – Fingerprint instance

  • oldFrame (object) – oldFrame

  • newFrame (object) – mewFrame

Returns

realFingerprintTrackDistance – Array with fingerprint distances from real fingerprints.

Return type

double

Authors

Andreas P. Cuny - initial implementation

+TracX.@Fingerprint.computeDeltaDistance(this, data, startFrame, endFrame)

COMPUTEDELTADISTANCE Computes the delta distance for non or tracked data. The delta distance is defined as the difference in fingerprint distance among two image frames of the lowest to the second lowest value. In case the data was tracked. it is the difference between the fingerprint distance of the assignment and the lowest one from either all other cells, the neighbourhood of the assigned one or the lowest one thereof.

Parameters
Returns

  • deltaDistance (double) – Array of the delta distance for each assignment on all frames concatenated.

  • deltaDistanceNeighbours (double) – Array of the delta distance of the neighbourhood of each assignment on all frames concatenated.

  • fingerprintDistance (double) – Array of the fingerprint distance for each assignment on all frames concatenated.

  • fingerprintDistanceNeighboursSize (double) – Array of the fingerprint distance of theneighbourhood of each assignment on all frames concatenated.

  • deltaDistanceLowestNeighbour (double) – Array of the lowest delta distance of the neighbourhood of each assignment on all frames concatenated.

  • deltaDistance2ndLowest (double) – Array of the second lowest delta distance for each assignment on all frames concatenated.

  • deltaDistance2ndLowestNeighbour (double) – Array of the second lowest delta distance of the neighbourhood for each assignment on all frames concatenated.

  • assignedFPdistAllFrames (cell) – Cell array of the fingerprint distance for each assignment on all frames.

  • neighbourDeltaDistTotalMovie (cell) – Cell array of the delta distances of the neighbourhood for each assignment on all frames.

Authors

Andreas P. Cuny - initial implementation

+TracX.@Fingerprint.computeFPDistThreshold(~, xFPDistAssigned, xFPDistAssignedToCompare, yDeltaDistAssigned, yDeltaDistToCompare, lowerQuantile)

COMPUTEFPDISTTHRESHOLD Computes the fingerprint distance threshold based on the lower quantile of negative delta distances.

Parameters
  • ignoredArg (object) – Fingerprint instance

  • xFPDistAssigned (array 1xN) – Fingerprint distance of all assignments

  • xFPDistAssignedToCompare (array 1xM) – Fingerprint distances of neighbouring cells for each assigned cell.

  • yDeltaDistAssigned (array 1xN) – Delta distance of all assignments to the minimal FPdist of all possible assignments for each cell.

  • yDeltaDistToCompare (array 1xM) – Delta distance of all assignments to their comparator (i.e. its direct neighbours or all other cells)

  • lowerQuantile (float 1x1) – Lower quantile in the range [0,1];

Returns

  • fpDistThreshold (float 1x1:) – Fingerprint distance threshold.

  • fpDistThresholdMadCorr (float 1x1:) – Fingerprint distance threshold outlier corrected.

  • fpDistanceSubset (float 1x1:) – Data used for fingerprint threshold determination.

Authors

Andreas P. Cuny - initial implementation

+TracX.@Fingerprint.computeFingerprint(~, img, fingerprintResizeFactor, fingerprintMaxConsideredFrequencies)

COMPUTEFINGERPRINT Computes a unique cell quality control featured based on an image using the DCT transform. Here the fingerprint is computed for the image using DCT and the frequencies containing the structural information of the cell resulting in a unique string.

Parameters
  • img (uint8 NxNx1 uint8, 16, 32, 64) – Image matrix

  • fingerprintResizeFactor (int) – fingerprintResizeFactor

  • fingerprintMaxConsideredFrequencies (int) – fingerprintMaxConsideredFrequencies

Returns

retFq – [1x64] Real frequency fingerprint array.

Return type

float 1xM

Authors

Andreas P. Cuny - initial implementation

+TracX.@Fingerprint.computeFingerprint3D(~, img, fingerprintResizeFactor, fingerprintMaxConsideredFrequencies)

COMPUTEFINGERPRINT3D Computes a unique cell quality control featured based on an image using the DCT transform. Here the fingerprint is computed for the image using DCT and binarization of the frequencies containing the structural information of the cell resulting in a unique string.

Parameters
  • ignoredArg (object) – Fingerprint instance

  • img (uint8 NxNx3 uint8, 16, 32, 64) – Image matrix

  • fingerprintResizeFactor (int) – +TracX.ParameterConfiguration.fingerprintResizeFactor

  • fingerprintMaxConsideredFrequencies (int) – +TracX.ParameterConfiguration.fingerprintMaxConsideredFrequencies

Returns

retFq – [1x64] Real frequency fingerprint array.

Return type

float 1xM

Authors

Tomas Kuendig - initial implementation

+TracX.@Fingerprint.computeFingerprintAsgmtFrac(this, crfO, crfN, dCRFAsgmt, nhbrhdM)

COMPUTEFINGERPRINTASGMTFRAC Computes the faction for each assigned cell that a neighbouring cells has lower fingerprint distance (dCRF) as the difference of dCRF(assignment) - dCRF(neighbour). So there is a more similar cell according to the fingerprint (CRF) measure.

Parameters
  • this (object) – Fingerprint instance

  • crfO (array) – Fingerprint (CRF) array for oldFrame.

  • crfN (array) – Fingerprint (CRF) array fpr newFrame.

  • dCRFAsgmt (array) – Fingerprint distance (dCRF) of all assignments between old and newFrame

  • nhbrhdM (array) – Neighbourhood indices locial matrix

Returns

  • FFPa (array) – Fraction of neighbouring cells with lower dCRF for each assigned cell

  • FFP (array) – Fraction of neighbouring cells with lower dCRF (size of # neighbour)

  • NNFPa (array) – Sum of dCRFDiff > 0 for each assigned cell

  • NNFP (array) – Sum of dCRFDiff > 0 (size of # neighbour)

  • nNhbra (array) – Total number of neighbouring cells for each assigned cell

  • nNhbr (array) – Total number of neighbouring cells (size of # neighbour)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Fingerprint.computeFingerprintDistance(~, realTrackFingerprintOldFrame, realTrackFingerprintNewFrame)

COMPUTEFINGERPRINTDISTANCE Computes the fingerprint distance between two typically subsequent image frames (oldFrame and newFrame) based on real fingerprints. For real fingerprints the least square distance is computed. The DC component (0,0) of the real fingerprints are removed.

Parameters
  • ignoredArg (object) – Fingerprint instance

  • realTrackFingerprintOldFrame (cell array) – Real fingerprint array for all cells in the oldFrame

  • realTrackFingerprintNewFrame (cell array) – Real fingerprint array for all cells in the subsequent image frame (newFrame).

Returns

realTrackFingerprintDistance – Fingerprint distances between all cells from the oldFrame and all its assigned cells in the newFrame based on the real fingerprints.

Return type

double

Authors

Andreas P. Cuny - initial implementation

Authors

Joerg Stelling - speed optimization

+TracX.@Fingerprint.computeFingerprintForFrame(this, fromFrame, toFrame, fingerprintHalfWindowSideLength, fingerprintResizeFactor, fingerprintMaxConsideredFrequencies, imageDir, imageFingerprintFileArray, imageCropCoordinateArray, cellFrameArray, cellCenterXArray, cellCenterYArray)

COMPUTEFINGERPRINTFORFRAME Computes a unique cell quality control feature based on an out-of-focus Brightfield image using the DCT transform. Here the fingerprints are computed for each frame using DCT and the frequencies containing the structural information of the cell resulting in a unique string. It is possible to only calculate the fingerprint for a number of specified image frames.

Parameters
  • this (object) – Fingerprint instance

  • fromFrame (int) – Starting frame for calculation

  • toFrame (int) – End frame for calculation

  • fingerprintHalfWindowSideLength (int) – +TracX.ParameterConfiguration.fingerprintHalfWindowSideLength

  • fingerprintResizeFactor (int) – +TracX.ParameterConfiguration.fingerprintResizeFactor

  • fingerprintMaxConsideredFrequencies (int) – +TracX.ParameterConfiguration.fingerprintMaxConsideredFrequencies

  • imageDir (str) – +TracX.ProjectConfiguration.imageDir

  • imageFingerprintFileArray (cell array 1xK) – +TracX.ProjectConfiguration.imageFingerprintFileArray

  • imageCropCoordinateArray (double 1x4) – +TracX.ProjectConfiguration.imageCropCoordinateArray

  • cellFrameArray (int) – Array with all image frame numbers.

  • cellCenterXArray (int) – Array with centroid x coordinates of segmented objects.

  • cellCenterYArray (int) – Array with centroid x coordinates of segmented objects.

Returns

retFq – fingerprints for each segmented object.

Return type

double Array with the real

Authors

Andreas P. Cuny - initial implementation

+TracX.@Fingerprint.computeFingerprintForFrame3D(this, fromFrame, toFrame, fingerprintHalfWindowSideLength, fingerprintResizeFactor, fingerprintMaxConsideredFrequencies, imageDir, imageFingerprintFileArray, imageCropCoordinateArray, cellFrameArray, cellCenterXArray, cellCenterYArray, cellCenterZArray, pixelPerZplane, active3DFingerprint)

COMPUTEFINGERPRINTFORFRAME3D Computes a unique cell quality control feature based on an out-of-focus Brightfield 3D image using the DCT transform. Here the fingerprints are computed for each frame using DCT and the frequencies containing the structural information of the cell resulting in a unique string. It is possible to only calculate the fingerprint for a number of specified image frames.

Parameters
  • this (object) – Fingerprint instance

  • fromFrame (int) – Starting frame for calculation

  • toFrame (int) – End frame for calculation

  • fingerprintHalfWindowSideLength (int) – +TracX.ParameterConfiguration.fingerprintHalfWindowSideLength

  • fingerprintResizeFactor (int) – +TracX.ParameterConfiguration.fingerprintResizeFactor

  • fingerprintMaxConsideredFrequencies (int) – +TracX.ParameterConfiguration.fingerprintMaxConsideredFrequencies

  • imageDir (str) – +TracX.ProjectConfiguration.imageDir

  • imageFingerprintFileArray (cell array 1xK) – +TracX.ProjectConfiguration.imageFingerprintFileArray

  • imageCropCoordinateArray (double 1x4) – +TracX.ProjectConfiguration.imageCropCoordinateArray

  • cellFrameArray (int) – Array with all image frame numbers.

  • cellCenterXArray (int) – Array with centroid x coordinates of segmented objects.

  • cellCenterYArray (int) – Array with centroid y coordinates of segmented objects.

  • cellCenterZArray (int) – Array with centroid z coordinates of segmented objects.

  • pixelPerZplane (int) – Number of pixel per Zplane

  • active3DFingerprint (bool) – Switch for active 3D fingerprint.

Returns

retFq – fingerprints for each segmented object.

Return type

double Array with the real

Authors

Tomas Kuendig - initial implementation

+TracX.@Fingerprint.computeNeighbourProbFPBelowAss(~, assignedFPdistTotalMovie, neighbourDeltaDistTotalMovie, FPByFraction, startIdx, nData)

COMPUTENEIGHBOURPROBFPBELOWASS Computes the cumultative probability for each assigned cell that a neighbouring cells has lower fingerprint distance (negative delta distance) and would a more similar cell according to the fingerprint measure alone.

Parameters
  • ignoredArg (object) – Fingerprint instance

  • assignedFPdistTotalMovie (cell array) – Array of fingerprint distances of the assigned cells for each tracked frame.

  • neighbourDeltaDistTotalMovie (cell array) – Array of delta distances from the neighbours of the assigned cells for each tracked frame.

  • FPByFraction (bool) – True (default): calculate faction of neighbours with lower FP distance. False: calculate if any neighbour has lower FP distance

  • startIdx (int) – Start index for the first frame tracking started.

  • nData (int) – Total length of the data columns.

Returns

pLowerFPArray – Cumultative probability for each assignment that a neighbour has a lower fingerprint distance.

Return type

float:

Authors

Joerg Stelling - initial implementation of the idea

Authors

Andreas P. Cuny - implementation for TracX evaluation

ImageProcessing

class +TracX.@ImageProcessing.ImageProcessing(io, configuration, data, utils, lineage)

ImageProcessing Class for processing image matrices. It implements methods to generate various control images.

Authors

Andreas P. Cuny - initial implementation

ImageProcessing(io, configuration, data, utils, lineage)

Constructor of an ImageProcessing object

Parameters
Returns

ImageProcessing instance

Return type

obj (object)

Authors

Andreas P. Cuny - initial implementation

configuration = None

+TracX.@TrackerConfiguration instance with the tracking parameters and project metadata

data = None

+TracX.@TrackerData instance stores all segmentation, quantification and lineage data.

io = None

+TracX.@IO instance implementing read/write methods

lineage = None

+TracX.@Lineage instance implementing lineage methods

utils = None

+TracX.@Utils instance implementing utility methods

+TracX.@ImageProcessing.addTimestampScalebar(this, img, imageFrequency, frame, varargin)

ADDTIMESTAMPSCALEBAR Adds a timestamp (frame number or time in units time as well as a scale bar to an image.

Parameters
  • this (object) – ImageProcessing instance

  • img (uint8 NxNx1 uint8, 16, 32, 64) – Image matrix

  • imageFrequency (float) – Image frequency in hours

  • frame (int) – Image frame number

  • varargin (str varchar) –

    • scaleBarLength (float): Length of scalebar in terms of unit.

    • pxToUnit (float): Pixel to unit conversion factor. I.e. for a 40X objective with 6.5 micron pixel size would result to 6.5/40.

    • unit (str): Unit of scalebar. Defaults to micron. Options are pixel, px, pixels.

Returns

Image matrix including timestamp and scalebar.

Return type

img unit8 NxM

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.computeCLAHE(image, claheBlockSize, claheClipLimit)

COMPUTECLAHE Computes the Contrast Limited Adaptive Histogram Equalization (CLAHE) to enhance the local contrast of an image.

Parameters
  • image (str) – Path to image file.

  • claheBlockSize (int [M, N]) – The size of the local region around a pixel for which the histogram is equalized. This size should be larger than the size of features to be preserved.

  • claheClipLimit (float [0-1]) – Real scalar that specifies a contrast enhancement limit. Higher numbers result in more contrast.

Returns

Image matrix with enhanced contrast.

Return type

claheImage ddouble NxM

Authors

Sotiris Dimopoulos - initial implementation in CellX

Authors

Andreas P. Cuny - adaptation for TracX

+TracX.@ImageProcessing.generate4DImageStack(this, imageFilePath, segmentationResultDir, imageFileNameArray, trackerResultMaskArray, coiFrameArray, cellCenterXArray, cellCenterYArray, halfWindowLength, imageFrameArray, trackIndexArray, trackOI, trackContainedInTrack)

GENERATE4DIMAGESTACK Generates 2D images with single precision in either greyscale or RGB into 4D stack 4th dimension here is time. To save memory, images are converted with im2uint8 from >8bit to 8bit images.

Parameters
  • this (object) – ImageProcessing instance

  • imageFilePath (str) – Path to image location

  • segmentationResultDir (str) – Path to segmentation result files.

  • imageFileNameArray (str 1xN) – Cell array with image file names

  • trackerResultMaskArray (str 1xN) – Cell array with tracker mask file names.

  • coiFrameArray (int 1xN) – Array with frame number for cell of interest.

  • cellCenterXArray (int 1xN) – Array with x coordinates for the cell of interest.

  • cellCenterYArray (int 1xN) – Array with y coordinates for the cell of interest.

  • halfWindowLength (int) – Half window length of a square around cell center to cut out from the total image matrix.

  • imageFrameArray (int 1xN) – Array of image frames where a tracked cell is present.

  • trackIndexArray (int 1xN) – Array with track indices

  • trackOI – selected Track (current track of interest)

  • trackContainedInTrack (int 1xN) – Array with track indices contained in other tracks (due to discarded miss segmented objects)

Returns

ImgStack – 4D Stack containing the image of cell of interest windowed around its cell center.

Return type

array WxHx3xN

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.generate4DImageStackMarker(this, imageFilePath, segmentationResultDir, imageFileNameArray, trackerResultMaskArray, cycleMarker, halfWindowLength, trackOI, fontSize, isPlotMarkerSignal)

GENERATE4DIMAGESTACKMARKER Generates 2D images with single precision in either greyscale or RGB into 4D stack 4th dimension here is time. To save memory, images are converted with im2uint8 from >8bit to 8bit images for cell cycle markers.

Parameters
  • this (object) – ImageProcessing instance

  • imageFilePath (str) – Path to image location

  • segmentationResultDir (str) – Path to segmentation result files.

  • imageFileNameArray (str 1xN) – Cell array with image file names

  • trackerResultMaskArray (str 1xN) – Cell array with tracker mask file names.

  • cycleMarker (array 1x2) – Cell array with marker file identifiers i.e {‘mKate’, ‘mKO’}

  • halfWindowLength (int) – Half window length of a square around cell center to cut out from the total image matrix.

  • trackOI – selected Track (current track of interest)

  • fontSize (int 1x1) – Fontsize for labels.

  • isPlotMarkerSignal (bool) – Flag if cell cycle marker signal shold be plotted as additional layer. Default to false.

Returns

ImgStack – 4D Stack containing the image of cell of interest windowed around its cell center.

Return type

array WxHx3xN

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.generateAnnotatedControlImageFrame(this, frameNumber, varargin)

GENERATEANNOTATEDCONTROLIMAGEFRAME Generates a control image where all data found on an image frame for a given property are overlayed onto a (Brightfield) image. The default property is ‘track_index’ but it can be any of ‘SegmentationData’.

Parameters
  • this (obj) – ImageProcessing object

  • frameNumber (int) – Image frame number.

  • varargin (str varchar) –

    • fieldName (str): Property to be displayed on the image. Defaults to ‘track_index’ can be any propery of +TracX.SegmentationData.

    • highlightFieldNameVal (int): Pixel to unit conversion factor. I.e. for a 40X objective with 6.5 micron pixel size would result to 6.5/40.

    • fontSize (str): Font size of property to be displayed. Defaults to 14.
      • fontName (str): Font name of property to be displayed. Defaults to Arial.

      • fontEmphasis (int): Font emphasis of property to be displayed. Defaults to 0 (regular). Options 1 (bold), 2 (italic).

    • removeContainedTracks (bool): If contained tracks within tracks should be removed. Defaults to true.

    • isMarker (bool): If markers should be displayed. Defaults to false.

Returns

labeledImg – Image with all tracks present labeled.

Return type

(array, NxM)

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.generateFingerprintControlImageFrame(this, fontSize, rectHalfSideLength, frameNumber)

GENERATEFINGERPRINTCONTROLIMAGEFRAME Generates a control image where all cell tracks found on an image frame are labeled with their track indicies overlayed onto a (Brightfield) image. Additionally the fingerprint windows are displayed to estimate the size of the cell neighbourhood.

Parameters
  • this (obj) – ImageProcessing object

  • fontSize (int) – Font size of track indicies labels.

  • rectHalfSideLength (int) – fingerprintWindowHalfSideLength

  • frameNumber (int) – Image frame number.

Returns

labeledImg – Image with the fingerprint window for all tracks present labeled.

Return type

(array, NxM)

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.generateLineageFrame(this, rootTrack, imageFrequency, frame, varargin)

GENERATELINEAGEFRAME Generates a figure for a specific image frame for the lineage movie generation. The figure consists of a labeled image, the lineage tree and a plotting area to plot quantified signals over time.

Parameters
  • this (object) – ImageProcessing instance

  • rootTrack (int) – Track index of the lineage root to be visualized.

  • imageFrequency (float) – Image frequency in hours

  • frame (int) – Image frame number

  • varargin (str varchar) –

    • figurePosition (float): Figure position and size (x,y, width, height) array for the movie generation. Default is: [10 10 1350 600]

    • scaleBarLength (float): Length of scalebar in terms of unit.

    • pxToUnit (float): Pixel to unit conversion factor. I.e. for a 40X objective with 6.5 micron pixel size would result to 6.5/40.

    • unit (str): Unit of scalebar. Defaults to micron. Opthons are pixel, px, pixels.

Returns

Figure handle.

Return type

fh object

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.generateLineageMovie(this, rootTrack, imageFrequency, movieName, varargin)

GENERATELINEAGEMOVIE Generates a video displaying the cell lineage, labeled image and quantified signals over time.

Parameters
  • this (object) – ImageProcessing instance

  • rootTrack (int) – Track index of the lineage root to be visualized.

  • imageFrequency (float) – Image frequency in hours

  • movieName (str) – Name of the movie

  • varargin (str varchar) –

    • figurePosition (float): Figure position and size (x,y, width, height) array for the movie generation. Default is: [10 10 1350 600]

    • videoQuality (int 0-100): Quality (0:100) of exported movie; Defaults to 100.

    • videoFrameRate (int ): Frame per second in exported movie; Defaults to 5.

    • videoProfile (str ): Compression format that should be used for the exported move; Defautls to ‘MPEG-4’; help VideoWriter in cmd for more help.

    • scaleBarLength (float): Length of scalebar in terms of unit.

    • pxToUnit (float): Pixel to unit conversion factor. I.e. for a 40X objective with 6.5 micron pixel size would result to 6.5/40.

    • unit (str): Unit of scalebar. Defaults to micron. Opthons are pixel, px, pixels.

Returns

Writes movie to disk directly.

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.generateMarkerControlImageFrame(this, frameNumber)

GENERATEMARKERCONTROLIMAGEFRAME Generates a marker tracking control image to visualize i.e budneck marker tracking.

Parameters
  • this (object) – ImageProcessing instance

  • frameNumber (int) – Image frame number

Returns

Image matrix including segmentation mask of cell cycle marker.

Return type

labeledMask array NxM

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.generateMarkerTimeSeriesImage(this, varargin)

GENERATEMARKERTIMESERIESIMAGE Generates and saves an image series for each track and image frame of the experimet. Each track is labeled with its segmentation mask and centered.

Parameters
  • this (object) – ImageProcessing instance

  • img (uint8 NxNx1 uint8, 16, 32, 64) – Image matrix

  • imageFrequency (float) – Image frequency in hours

  • frame (int) – Image frame number

  • varargin (str varchar) –

    • fontSize (float): Fontsize of labeles. Defaults to 12.

    • halfWindowLength (int): Half window side length around cell center to be used for each image frame. Defaults to 50.

    • cycleMarker (array): Cell array with flourescence channel identifiers depicting cell cycle markers i.e {‘mKO’, ‘mKate’}.

    • isPlotMarkerSignal (bool): Flag to plot cell cycle marker ‘raw’ signal as additional overlay; Defaults to false.

Returns

Resulting images are written to disk directly.

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.generateMaskForMatrixCorners(img)

GENERATEMASKFORMATRIXCORNERS Creates a mask of the same size of a 2D (image) matrix(NxM) with all corners are labeled by a square.

Parameters

img (array, NxM) – Image / mask matrix

Returns

Matrix with edges labeled starting top left with 1.

Return type

mask array NxM

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.generateMergedMask(this)

GENERATEMERGEDMASK Merges the bud mask with the mother mask prior cell division if exists (i.e. with CellX segmentation it does).

Parameters

this (object) – ImageProcessing instance

Returns

void – Corrected masks are saved directly to disk.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.generateMergedMaskForReSegmentation(this, tracks2Merge)

GENERATEMERGEDMASKFORRESEGMENTATION Generates masks for resegmentation and quantification by deleteing all unaffected cells from the mask and copying them into the segmentationResultDir/tmp subfolder.

Parameters
  • this (object) – ImageProcessing instance

  • tracks2Merge (array kx1) – Image matrix

Returns

Writes new massks to disk directly into a tmp folder. segmentationResultDir

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.generateMultiTrackControlMovie(this, fromImageFrame, toImageFrame, movieFileName, varargin)

GENERATEMULTITRACKCONTROLMOVIE Exports a movie for all detected and tracked cells in the indicated image frame range. The movie helps the user to visually inspect the tracking accuracy.

Parameters
  • this (object) – ImageProcessing instance

  • fromImageFrame (int) – Frame (image) number to start movie from.

  • toImageFrame (int) – Frame (image) number to end movie.

  • movieFileName (str) – Name for the resulting movie to save.

  • varargin (str varchar) –

    • fieldname (str): Field name for which to create color map. Defaults to ‘track_index’; Any SegmentationData property

    • videoQuality (int 0-100): Quality (0:100) of exported movie; Defaults to 100.

    • videoFrameRate (int ): Frame per second in exported movie; Defaults to 5.

    • videoProfile (str ): Compression format that should be used for the exported move; Defautls to ‘MPEG-4’; help VideoWriter in cmd for more help.

    • scaleBarLength (float): Length of scalebar in terms of unit. Defaults to 10.

    • pxToUnit (float): Pixel to unit conversion factor. I.e. for a 40X objective with 6.5 micron pixel size would result to 6.5/40.

    • unit (str): Unit of scalebar. Defaults to micron. Options are pixel, px, pixels.

    • imageFrequency (int): Images aquired per hour.

    • roi (array, 1x4): Region of interest to export defined as crop array [x, y, h, w]. Default is empty.

    • tracksOfInterest (array,): Array of track indices to be labeled.

Returns

A movie with all cells in a track labeled is written to disk directly.

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.generatePoleAgeControlImageFrame(this, fontSize, frameNumber)

GENERATEPOLEAGECONTROLIMAGEFRAME Generates a control image with labeled cell poles for all cell tracks found on an image frame with their pole age overlayed onto a (Brightfield) image.

Parameters
  • this (object) – ImageProcessing instance

  • fontSize (float) – Font size of track indicies labels.

  • frameNumber (int) – Image frame number.

Returns

Raw image with all tracks present labeled with their cell pole ages.

Return type

labeledImg double NxM

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.generateSingleTrackControlMovie(this, fromImageFrame, toImageFrame, trackOfInterest, movieFileName, varargin)

GENERATESINGLETRACKCONTROLMOVIE Exports a movie for one selected cell in the indicated image frame range labeled with tracking accuray information encoded in the edges of the movie frames. The movies are intended to help the user to inspect the tracking but also segmentation accuracy for a selected cell of interst.

Parameters
  • this (object) – ImageProcessing instance

  • fromImageFrame (int) – Frame (image) number to start movie from.

  • toImageFrame (int) – Frame (image) number to end movie.

  • trackOfInterest (int) – Track of interest for which a control movie should be generated.

  • movieFileName (str) – Name for the resulting movie to save.

  • varargin (str varchar) –

    • videoQuality (int 0-100): Quality (0:100) of exported movie; Defaults to 100.

    • videoFrameRate (int ): Frame per second in exported movie; Defaults to 5.

    • videoProfile (str ): Compression format that should be used for the exported move; Defautls to ‘MPEG-4’; help VideoWriter in cmd for more help.

    • scaleBarLength (float): Length of scalebar in terms of unit. Defaults to 10.

    • pxToUnit (float): Pixel to unit conversion factor. I.e. for a 40X objective with 6.5 micron pixel size would result to 6.5/40.

    • unit (str): Unit of scalebar. Defaults to micron. Options are pixel, px, pixels.

    • imageFrequency (int): Images aquired per hour.

Returns

Movie will be written directly to disk.

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.generateTimeSeriesImageMatrix(this, halfWindowLength)

GENERATETIMESERIESIMAGEMATRIX Generates and saves an image series for each track and image frame of the experimet. Each track is labeled with its segmentation mask and centered.

Parameters
  • this (object) – ImageProcessing instance

  • halfWindowLength (int, 1x1) – Half window side length around cell center to be used for each image frame.

Returns

Resulting images are written to disk directly.

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.generateTrackControlImageFramePadded(this, trackOfInterest, frameNumber, varargin)

GENERATETRACKCONTROLIMAGEFRAMEPADDED Generates a control image where all cell tracks found on that frame are labeled with the tracked segmentation mask as overlay to the raw (Brightfield) image. The final image is padded to keep the original image size i.e. for cells at image boundary. In the corners of the generated control image frame information about tracking accuracy is encoded as mentioned in the note below.

Parameters
  • this (object) – ImageProcessing instance

  • trackOfInterest (int 1x1) – Track number of a cell of interest

  • frameNumber (int 1x1) – Image frame number

  • varargin (str varchar) –

    • showImageIfTrackAbsent (bool): Shows real image for image frames where a track is absent using its last position. Otherwise a black image is shown.

Returns

Image where the track of interest is labeled with additional tracking accuracy information at the image corners.

Return type

labeledImg array NxM

Note

  • TopLeft = green := track_index and track_index_qc are identical

  • TopRight = red := track was put to VeryOld

  • BottomLeft = red := Mask identity low (bad segmentation but still tracked.

  • BottomRight = red := track_index and and mask identity ok but qc > thres

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.generateTrackerControlMaskImageFrame(this, frameNumber, varargin)

GENERATETRACKERCONTROLMASKIMAGEFRAME Generates a tracker control image where the labeled tracker mask are overlayed onto the raw image. Optionaly the label color can be set using a cmap.

Parameters
  • this (object) – ImageProcessing instance

  • frameNumber (int) – Image frame number

  • varargin (str varchar) –

    • useTrackIndices (bool): If track indices should be used. Defaults to true. Othewise cell indices are used.

    • customCMap (array kx3): Use custom colormat to color the cell segmentation masks. Otherwise auto generates one.

Returns

Image matrix with tracked cell segmentation masks.

Return type

labeledMask array NxM

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.getFieldCMap(this, property)

GETFIELDCMAP Returns a colormap based on a specific property. Where as each track_index is colored by a unique color. For track_parent each parent gets a unique_color that changes over time to longer the time distance to cell division. All other properties get a unique time invariant color.

Parameters
  • this (object) – ImageProcessing instance

  • property (str) – SegmentationData property

Returns

  • cMap float Kx3 – Color map for track indices

  • cMapFull float Kx3 – Full color map

  • cLim float 1x2 – Min and max property values

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.getTextOnJavaImage(~, image, string, position, fontColor, fontName, fontSize, fontEmphasis)

GETTEXTONJAVAIMAGE Outputs image with string label at position for a Java BufferedImage.

Parameters
  • ignoredArg (object) – ImageProcessing instance

  • image (array NxM) – Image matrix where the text string should be inserted. Note: Needs to be a BufferedImage (java).

  • string (str) – Text that should be added to the image

  • position (array 2x1) – Position with x and y coordinates to place the string onto the image

  • fontColor (str) – Font color. Defaults to green (green, red, blue)

  • fontName (str) – Font name. Defaults to Arial.

  • fontSize (int) – Font size. Defaults to 14.

  • fontEmphasis (int) – Font emphasis. Defaults to regular.

Returns

Image

Return type

image array NxM

Note

This array (image) can be used in a loop if multiple text strings need to be placed on an image.

Example:

>>> image = im2java2d(rand([100,100,3]));
>>> % Label the image with the text only in the green channel
>>> image = getTextOnJavaImage(image, 'Hello World!', [9,50], 'blue', 'Arial', 16, 1);
>>> % Convert Java BufferedImage back to Matlab array
>>> nrows = image.getHeight;
>>> ncols = image.getWidth;
>>> channel = image.getRaster.getNumBands;
>>> pixelsData = reshape(typecast(image.getData.getDataStorage, 'uint8'), ...
>>>              channel, ncols, nrows);
>>> labeledImg = cat(channel, ...
>>>     transpose(reshape(pixelsData(1, :, :), ncols, nrows)), ...
>>>     transpose(reshape(pixelsData(2, :, :), ncols, nrows)), ...
>>>     transpose(reshape(pixelsData(3, :, :), ncols, nrows)));
>>> figure; imshow(labeledImg)
Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.labelImageTrackMasks(this, trackToLabelArray, frameNumber, varargin)

LABELIMAGETRACKMASKS Generates a color image where all cell tracks found on that frame are labeled with the segmentation mask. The mask are overlayed onto the raw (Brightfield) image. The transparency of the mask (maskOverlayAlpha) and the brightness of the image (imageTransparency) can be optionally controlled. Also a the labels can be colored with custom colors from a color map of the appropriate size.

Parameters
  • this (object) – ImageProcessing instance

  • trackToLabelArray (array 1xK) – Array of track numbers which should be labeled with their segmentation mask on an image.

  • frameNumber (int 1x1) – Image frame number

  • varargin (str varchar) –

    • maskOverlayAlpha (float 0-1): Sets the transparency of the mask in the range[0,1].

    • imageBrightness (float 0-1): Sets the brightness of the image in the range [0,1].

    • customColorMap (array, Kx3): Applies a custom colormap of the size [K,3], with K = max(track_index) number

Returns

labeledImg – RGB image with all tracks of interest are labeled with their masks..

Return type

array NxM

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.mergeBudPriorDivision(this)

MERGEBUDPRIORDIVISION Merges the bud mask with the mother mask prior cell division if exists (i.e. with CellX segmentation it does).

Parameters

this (object) – ImageProcessing instance

Returns

void – Corrected masks are saved directly to disk.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.normalizeImage(~, imageMatrix)

NORMALIZEIMAGE Normalizes image between 0 and 1.

Input:

ignoredArg (object): ImageProcessing instance imageMatrix (array NxM): Image matrix to be normalized.

Returns

imageMatrixNorm – Normalized image matrix.

Return type

array NxM

Authors

Sotiris Dimopoulos - initial implementation in CellX

Authors

Andreas P. Cuny - adapation for TracX

+TracX.@ImageProcessing.overlayMaskOnImage(this, image, mask, varargin)

OVERLAYMASKONIMAGE Overlays a mask file on an image where as the transparency of the overlay is set trough the optional maskOverlayAlpha argument.

Parameters
  • this (object) – ImageProcessing instance

  • image (array NxM) – Image matrix

  • mask (array) – the specified channel with the in alpha specified transparency.

  • varargin (str varchar) –

    • maskOverlayAlpha (float 0-1): Sets the transparency of the mask in the range[0,1].

    • imageBrightness (float 0-1): Sets the brightness of the image in the range [0,1].

    • customColorMap (array, Kx3): Applies a custom colormap of the size [K,3], with K = max(track_index) number

Returns

Image with mask overlayed onto image with user defined transparency.

Return type

labeledImg double NxM

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageProcessing.relabelMaskIndices(~, mask, newLabelArray, oldLabelArray)

RELABELMASKINDICES Relabels indices on a 2D mask [NxM].

Parameters
  • ignoredArg (object) – ImageProcessing instance

  • mask (uint16 NxM) – Matrix with numerical labels

  • newLabelArray (int 1xN) – Array containing the new numerical labels to replace the old ones with.

  • oldLabelArray (int 1xN) – Array containing all the numerical labels of mask.

Returns

Matrix with labels replaced.

Return type

maskRelabeled double NxM

Authors

Andreas P. Cuny - initial implementation

ImageVisualization

class +TracX.@ImageVisualization.ImageVisualization(data, configuration, imageProcessing, lineage)

IMAGEVISUALIZATION Class handles all the image visualization aspects of TracX. i.e. control images displayed to the user.

Authors

Andreas P. Cuny - initial implementation

ImageVisualization(data, configuration, imageProcessing, lineage)

Constructor of an ImageVisualization object. Class handles all the image visualization aspects of TracX. i.e. control images displayed to the user.

Parameters
  • data (obj) – TrackerData instance

  • configuration (obj) – TrackerConfiguration instance

  • imageProcessing (obj) – ImageProcessing instance

  • lineage (obj) – Lineage instance

Returns

ImageVisualization instance

Return type

obj (obj)

Authors

Andreas P. Cuny - initial implementation

configuration = None

+TracX.@TrackerConfiguration instance implementing configuration methods.

data = None

+TracX.@TrackerData instance stores all segmentation, quantification and lineage data.

imageProcessing = None

+TracX.@ImageProcessing instance implementing image processing methods.

lineage = None

+TracX.@Lineage instance implementing lineage methods.

+TracX.@ImageVisualization.plotAnnotatedControlImageFrame(this, frameNumber, varargin)

PLOTANNOTATEDCONTROLIMAGEFRAME Displays a control image where all data found on an image frame for a given property are overlayed onto a (Brightfield) image at their cell position. Default plotted property is ‘track_index’ and the image cropped to the segmented window.

Parameters
  • this (obj) – ImageVisualization object

  • frameNumber (int) – Image frame number.

  • varargin (str varchar) –

    • fieldName (str): Property to be displayed on the image. Defaults to ‘track_index’ can be any propery of +TracX.SegmentationData.

    • highlightFieldNameVal (int): Property value that should be highlighted.

    • fontSize (str): Font size of property to be displayed.

    • removeContainedTracks (bool): Flag, if contained tracks within tracks should be removed. Defaults to true.

    • figure (object): Figure handle of existing figure to plot result in.

Returns

Image is visualized in figure.

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageVisualization.plotDifferenceAlphaShapeVsReducedAlphaShape(this, cellIdxArray)

PLOTDIFFERENCEALPHASHAPEVSREDUCEDALPHASHAPE Displays a control image for the differences in alpha shapes vs reduced alpha shapes.

Parameters
  • this (obj) – ImageVisualization instance.

  • cellIdxArray (array) – Array of cell indices to plot.

Returns

Image is visualized in figure.

Return type

void (-)

Authors

Tomas Kuendig - initial implementation

+TracX.@ImageVisualization.plotFPVsDeltaDistPlot(~, xFPDistAssigned, xFPDistAssignedToCompare, yDeltaDistAssigned, yDeltaDistToCompare, fpDistThreshold, lowerQuantile, varargin)

PLOTFPVSDELTADISTPLOT Displays a scatter plot figure with fingerprint distance vs. delta distance plotted. Additional histograms show the distributions of the main cathegory along the respective axes.

Parameters
  • ignoredArg (object) – ImageVisualization instance

  • xFPDistAssigned (array 1xk) – Fingerprint distance of all assignments

  • xFPDistAssignedToCompare (array 1xj) – Fingerprint distances of neighbouring cells for each assigned cell.

  • yDeltaDistAssigned (array 1xk) – Delta distance of all assignments to the minimal FPdist of all possible assignments for each cell.

  • yDeltaDistToCompare (array 1xj) – Delta distance of all assignments to their comparator (i.e. its direct neighbours or all other cells)

  • fpDistThreshold (fluat 1x1) – Fingerprint distance threshold.

  • lowerQuantile (float 1x1) – Lower quantile [0,1] used for fpDistThreshold determination.

  • varargin (str varchar) –

    • lowXLim (float): Lower plot x limit.

    • upXLim (float): Upper plot x limit.

    • lowYLim (float): Lower plot y limit.

    • upYLim (float): Upper plot y limit.

    • plotThreshold (float): Flag; if threhsold should be plotted. Defaults to true.

    • plotTitle (float): Flag; if title should be plotted. Defaults to true.

    • markerFaceAlpha (float): The transparency of the scatter dots in the range [0,1]. Defaults to 0.2.

    • markerSize (float): The size of the scatter dots [>0]. Defaults to 32.

Returns

fh – Figure handle.

Return type

object 1xM

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageVisualization.plotFingerprintControlImageFrame(this, fontSize, rectHalfSideLength, frameNumber)

PLOTFINGERPRINTCONTROLIMAGEFRAME Displays a control image where all cell tracks found on an image frame are labeled with their track indicies overlayed onto a (Brightfield) image. Additionally the fingerprint windows are displayed.

Parameters
  • this (obj) – ImageVisualization object

  • fontSize (int) – Font size of track indicies labels.

  • rectHalfSideLength (int) – Half side length of rectangle around cell centroids (i.e. fingerprintWindowHalfSideLength)

  • frameNumber (int) – Image frame number.

Returns

Labeled image is visualized in figure.

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageVisualization.plotFingerprintEvalSummary(this, pathToResults)

PLOTFINGERPRINTEVALSUMMARY Plots fingerprint evaluation results as contour plots for varied parameters for resizing, freq bins and windowing. Additionally a plot visualizing the window on the real data is displayed.

Parameters
  • this (obj) – ImageVisualization object

  • pathToResults (str) – Full path to fingerprintEvaluation result file.

Returns

Displays figures.

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageVisualization.plotLineageTree(this, varargin)

PLOTLINEAGETREE Plot a lineage tree for one or multiple root cells (i.e cells on the first frame). The tree is plotted to the console by default. With ‘plotToFigure’ set to true plots the tree to a figure.

Parameters
  • this (obj) – ImageVisualization object

  • varargin (str varchar) –

    • rootIndicies (int): The lineage root; Any ‘track_index’ number.

    • divisionType (int): Cell division type. Set automatically but can be change.

    • plotToFigure (bool): Flag if lineage tree should be plotted to a figure. Defaults to false.

Returns

Prints the tree to the command window. Optionally the lineage tree is visualized in a figure.

Return type

figureHandles (object)

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageVisualization.plotPoleAgeControlImageFrame(this, fontSize, frameNumber)

PLOTPOLEAGECONTROLIMAGEFRAME Displays a control image with the cell poles for all cell tracks found on an image frame labeled with their pole age overlayed onto a (Brightfield) image.

Parameters
  • this (obj) – ImageVisualization object

  • fontSize (int) – Font size of track indicies labels.

  • frameNumber (int) – Image frame number.

Returns

Image is visualized in a figure.

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageVisualization.plotSummaryTracksAboveFPThreshold(this, varargin)

PLOTSUMMARYTRACKSABOVEFPTHRESHOLD Creates a summary plot track ids vs image frames with tracks and image frames above the fingerprint threshold marked. Gives an overview which linkages have to be inspected manually.

Parameters
  • this (obj) – ImageVisualization object

  • varargin (str varchar) –

    • threshold (str): CRF fraction threshold. Defaults to 0.

Returns

Image is visualized in a figure.

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageVisualization.plotTrackControlImageFrame(this, frameNumber, varargin)

PLOTTRACKCONTROLIMAGEFRAME Displays a control image where all cell tracks found on an image frame are labeled with their track indicies overlayed onto a (Brightfield) image.

Parameters
  • frameNumber (int) – Image frame number.

  • varargin (str varchar) –

    • fieldName (str): Property to be displayed on the image. Defaults to ‘track_index’ can be any propery of +TracX.SegmentationData.

    • highlightFieldNameVal (int): Pixel to unit conversion factor. I.e. for a 40X objective with 6.5 micron pixel size would result to 6.5/40.

    • fontSize (str): Font size of property to be displayed.

    • removeContainedTracks (bool): If contained tracks within tracks should be removed. Defaults to true.

    • isMarker (bool): If markers should be displayed. Defaults to false.

Returns

Image is visualized in a figure.

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@ImageVisualization.visualise3DCells(this, varargin)

VISUALISE3DCELLS Function to visualize 3D cells / type of data. Optional inputs alow for customization regarding track to display, colormap, image limits, if only reduced alpha shapes should be used, if an image sould be returned, if a movie should be generated, what the pixel per micron factor is and if the image should be rotated.

Parameters
  • ignoredArg (obj) – ImageVisualization object

  • varargin (str varchar) –

    • PropertyToVisualise (str): Property to be displayed on the image. Defaults to ‘track_index’ can be any propery of +TracX.SegmentationData.

    • Track (int): Track number which should be highlighed.

    • Frames (array): Image frames array

    • ColorMap (array kx3): Colormap to be used

    • DelayTime (float 1x1): Deleay time. Defaults to 0.3.

    • NameOnly (bool 1x1): Flag if name only. Defaults to false.

    • FileName (str 1x1): Filename of output file.

    • XLim (array, 1x2): Plot x limits.

    • YLim (array, 1x2): Plot y limits.

    • ZLim (array, 1x2): Plot z limits.

    • ReducedShapes (bool): Flag; if redunced alpha shapes should be used. Defaults to false.

    • ReturnImage (bool): Flag; if image should be returned. Defaults to false.

    • NumbersHidden (bool): Flag, if numbers should be shown. Defaults to false.

    • OutputType (str): Type of output. Defaults to ‘Movie’.

    • PixelsPerMicrometer (float): Pixels per micrometer. Defaults to 0.

    • Rotation (bool): Flag, if rotation should be applied. Defaults to 0.

    • Colorbar (bool): Flag, if colobar should be shown. Defaults to false.

Returns

Image is visualized in a figure.

Return type

returnValue (array)

Authors

Thomas Kuending - initial implementation

IO

class +TracX.@IO.IO(utils)

Bases: handle

IO class to deal with TracX input and output while reading or writing data to disk.

Authors

Andreas P. Cuny - initial implementation

IO(utils)

IO Constructor of an TracX.IO class to deal with TracX input and output while reading or writing data to disk.

Parameters

utils (obj) – UTILS instance.

Returns

Returns a IO object instance.

Return type

obj (obj)

Authors

Andreas P. Cuny - initial implementation

convertedImageFileNameArray = '{}'

Converted image file name array

rawImageFileNameArray = '{}'

Raw image file name array

utils = '[]'

+TracX.@Utils instance implementing utility methods

+TracX.@IO.convertChallengeFilesToParseable(~, path, setName)

CONVERTCHALLENGEFILESTOPARSEABLE Converts files from the tracker challenge into parseable format.

Parameters
  • ignoredArg (obj) – IO instance.

  • path (str) – Path to the images

  • setName (str) – Name of the dataset.

Returns

Converted set saved to disk directly.

Return type

void (-)

Authors

Thomas Kuendig - initial implementation

+TracX.@IO.convertImageFileNames(this, imageFilePath)

CONVERTIMAGEFILENAMES Converts a previously parsed list of raw image file names to a new format. Therby it copies the raw images to a ‘RawImages subfolder and keeps the newly renamed files in the imageFilePath.

Parameters
  • ignoredArg (obj) – IO instance.

  • imageFilePath (str) – Path to the images to be paresed

Returns

Directly acts on images on the filesystem.

Return type

void (-)

Note

Run Tracker.io.imageFileNameParser() first.

Authors

Andreas P. Cuny - initial implementation

+TracX.@IO.convertXLSToCSV(this, fullFileName, dataDelimiter)

CONVERTXLSTOCSV Convert a excel spreadsheet to csv table from a file.

Parameters
  • this (obj) – IO instance.

  • fullFileName (str) – Full path and name of file as string.

  • dataDelimiter (str) – Name or symbol of delimiter

Returns

Writes text file to disk

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@IO.destackTimepoints(this, inputFilePath, fileRegEx, nTimepoints, nPlanes, direction)

DESTACKTIMEPOINTS Destacks a 3D (multipage tiff) stack into single files per time point.

Parameters
  • this (obj) – IO instance.

  • inputFilePath (str) – Path to files.

  • fileRegEx (str) – File name identifier regular expression

  • nTimepoints (int) – Number of time points in stack

  • nPlanes (int) – Number of planes in stack

  • direction (int) – Direction to destack either planes (0) or timepoints (1).

Returns

Writes destacked files to disk directly.

Return type

void (-)

Authors

Thomas Kuendig - initial implementation

+TracX.@IO.filenameSorterForCellXinput(~, fileNameArray)

FILENAMESORTERFORCELLXINPUT Sorts CellX output file names and returns them as well as the number of time points and planes.

Parameters
  • this (obj) – IO instance.

  • fileNameArray (str, 1xK) – Array with filenames to be sorted.

  • dataDelimiter (str) – Name or symbol of delimiter

Returns

  • sortedFilenames ((array, 1xK)) – Array with sorted file names.

  • checkMatrix ((array, 3xK)) – Matrix sorted by frame with timepoints, plane and well position.

  • nTimePoints ((int, 1xK)) – Number of time points.

  • nPlanes ((int, 1xK)) – Number of z planes.

Authors

Thomas Kuendig - initial implementation

+TracX.@IO.imageFileNameParser(this, imageFilePath, imageFileType, varargin)

IMAGEFILENMAEPARSER Parses any image file name to convert them to the filename format which is used by Cellx as a standard: :obj: ChannelIdentifier_WellPositionWellPlane_Timepoint.FileType Using regular experssions part in an image name can be identified and converted to a default or custom value.

Parameters
  • ignoredArg (obj) – IO instance.

  • imageFilePath (str) – Path to the images to be paresed

  • imageFileType (str) – Image file type. Supported are [‘tif’, ‘TIF’, ‘TIFF’, ‘tiff’, ‘png’, … ‘PNG’, ‘JPG’, ‘jpg’]

  • varargin (str varchar) –

    • channelRE (str): Regular expression to identify the image channel.

    • positionRE (str): Regular expression to identify the well position.

    • planeRE (str): Regular expression to identify the image plane.

    • timeRE (bool): Regular expression to identify the image frame number.

    • customChannel (str): Custom name for the channel.

    • customPosition (str): Custom position name.

    • customZIndex (str): Custom image plane index.

    • channelNameDict (bool): Channel name dictionary.

Returns

IO object with the result filled into rawImageFileNameArray and convertedImageFileNameArray.

Return type

void (-)

Example:

>>> Tracker.io.imageFileNameParser( 'Path\to\folder', 'JPG', 'timeRE', '(?<=time)\d*', 'positionRE', '(?<=Position\()\d*')
Authors

Andreas P. Cuny - initial implementation

+TracX.@IO.maskInterface3D(this, frameNumber, segmentationFile, imageFile, resultPath, pxPerZInterval, fluoTags, fluoImagePaths)

MASKINTERFACE3D Interface to import 3D segmentation data from mask files into TracX internal data format.

Parameters
  • ignoredArg (obj) – IO instance.

  • frameNumber (int) – Image frame number

  • segmentationFile (str) – Name of segmentation file

  • imageFile (str) – Name of image file

  • resultPath (str) – Path to where output should be saved. Defaults to experiment folder.

  • pxPerZInterval (int) – Conversion factor pixel to z interval

  • fluoTags (str) – Fluorescent channel identifiers (optional).

  • fluoImagePaths (str) – Path to fluorescent images

Returns

Data written directly to disk.

Return type

void (-)

Authors

Thomas Kuendig - initial implementation

+TracX.@IO.orientationCompressor(~, vector3D)

ORIENTATIONCOMPRESSOR Compresses the orientation vector into a single number. Note: Vector should be already of unit length!

Parameters
  • ignoredArg (obj) – IO instance.

  • vector3D (array) – 3D vector

Returns

tag – Orientation incompressed format.

Return type

int

Authors

Thomas Kuendig - initial implementation

+TracX.@IO.readCellXParameters(~, file)

READCELLXPARAMETERS Reads a CellX parameter xml file and stores and returns them as struct. To be used for automatic project configuration such as i.e. image crop.

Parameters
  • ignoredArg (obj) – IO instance.

  • file (str) – Path to CellX parameter xml file

Returns

ret (:obj:`struct`)

Return type

CellX parameter as struct.

Authors

Andreas P. Cuny - initial implementation

+TracX.@IO.readFromXML(~, configuration, file)

READFROMXML Reads a TracX configuration xml file and stores the parameters in the ParameterConfiguration object.

Parameters
  • ignoredArg (obj) – IO instance.

  • configuration (obj) – TrackerConfiguration object.

  • file (str) – Path to parameter xml file

Returns

configuration (:obj:`obj`) – object directly and returns it parametrized.

Return type

Configuration. Acts on TrackerConfiguration

Authors

Andreas P. Cuny - initial implementation

+TracX.@IO.readImageToGrayScale(~, pathToFile, varargin)

READIMAGETOGRAYSCALE loads an image and converts it to gray scale if it has 3 channels (RGB). Gray conversion is performed as follows: img = (R+G+B)/3

Parameters
  • ignoredArg (obj) – IO instance.

  • pathToFile (str) – Path to image file.

  • varargin – [x, y, w-1, h-1] imageCropCoordinateArray used to crop theloaded image to this size.

Returns

image (:obj:`array`, NxM) – the size given by imageCropCoordinateArray

Return type

Image matrix, optionally cropped to

Authors

Sotiris Dimopoulos - initial implementation in CellX Andreas P. Cuny - Adaptation for TracX

+TracX.@IO.readImageToRGB(~, imageFilePath, varargin)

READIMAGETORGB loads an image as RGB matrix

Parameters
  • ignoredArg (obj) – IO instance.

  • imageFilePath (str) – Path to image file.

  • varargin – [x, y, w-1, h-1] imageCropCoordinateArray used to crop the loaded image to this size.

Returns

Image matrix, optionally cropped to the size specified by imageCropCoordinateArray.

Return type

image (array, NxM)

Authors

Andreas P. Cuny - initial implementation

+TracX.@IO.readSegmentationData(this, pathName, fileNameArray, varargin)

READSEGMENTATIONDATA Reads segmentation data. Currently it supports the CellX format where segmentation data is split into a file per image frame.

Parameters
  • this (obj) – IO instance.

  • pathName (str) – The path to where the data is stored.

  • fileNameArray (str) – Array of filename(s) of the data to import.

  • varargin (str varchar) –

    • maxNrOfFrames (str): Max number of files to import (if not full experimental data of a time series should be imported.

    • dataDelimiter (str): Data delimiter (‘,’, ‘comma’, ‘ ‘, ‘space’, ‘t’, ‘tab’, ‘;’, ‘semi’, ‘|’, ‘bar’).

Returns

  • data (struct) – Returns segmentation data as stuct, with fieldnames corresponding to column headers of raw data.

  • dataMatrix (array) – Data as matrix in a cell for each frame in fileNameArray

  • fieldNameArray (array) – Array of cell arrays with the column header names of the imported data for each frame.

Authors

Andreas P. Cuny - initial implementation

+TracX.@IO.readSegmentationMask(this, pathToFile)

READSEGMENTATIONMASK Loads an segmentation mask file stored in a .mat or .tif file. Each segment should consist of a positive integer value. A segment can span any number of pixel, at least one at max all.

Parameters
  • ignoredArg (obj) – IO instance.

  • pathToFile (str) – Path to mask file.

Returns

Segmentation mask matrix.

Return type

mask (array, NxM)

Authors

Andreas P. Cuny - initial implementation

+TracX.@IO.stackZPlanes(~, inputFilePath, fileRegEx, planeRegEx, convert)

STACKZPLANES Stacks single file z planes into one multipage tiff.

Parameters
  • ignoredArg (obj) – IO instance.

  • inputFilePath (str) – File path to images

  • fileRegEx (str) – File identifier regular expression

  • planeRegEx (str) – File z plane identifier regular expression

  • convert (bool) – Bool if stack should be converted.

Returns

uRemnants – Unique remnants.

Return type

str

Authors

Thomas Kuendig - initial implementation

+TracX.@IO.writeBudNeckCellSegmentationMaskImage(~, maskDilated, foundEdgesFilled, trackIndexArray, cellCenterXArray, cellCenterYArray, segmentationResultDir, frameNumber, imageCropCoordinateArray)

WRITEBUDNECKCELLSEGMENTATIONMASKIMAGE Detect bud neck marker from fluorescence images. A ROF denoising is first applied and then an edge detection to get an array of pixel that each bud covers.

Parameters
  • ignoredArg (obj) – IO instance.

  • maskDilated (array, NxM) – Segmentation mask. Dilated such that cells touch each others.

  • foundEdgesFilled (array, NxM) – Budneck segmentation mask.

  • trackIndexArray (array, 1xK) – Track index array

  • cellCenterXArray (array, 1xK) – Cell center x array

  • cellCenterYArray (array, 1xK) – Cell center y array

  • segmentationResultDir (str) – Path to segmentation results.

  • frameNumber (int) – Image frame number

  • imageCropCoordinateArray (array) – Image crop coordinates

Returns

Writes the output image directly to disk.

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@IO.writeToCSV(~, data, resultFilePath, resultFileName, dataDelimiter)

WRITETOCSV Writes tracker results to disk in csv format.

Parameters
  • ignoredArg (obj) – IO instance.

  • data (table) – Table of TrackerData instance..

  • resultFilePath (str) – Path to where tracker results should be saved.

  • resultFileName (str) – Name of result file

  • dataDelimiter (str) – Name or symbol of delimiter

Returns

Writes text file to disk

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@IO.writeToMAT(~, data, resultFilePath, resultFileName, varargin)

WRITETOMAT Writes tracker results to disk in mat format.

Parameters
  • ignoredArg (obj) – IO instance.

  • data (table) – Table of TrackerData.

  • resultFilePath (str) – Path to where tracker results should be saved.

  • resultFileName (str) – Name of result file

Returns

Writes text file to disk

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@IO.writeToPNG(~, image, fullPath)

WRITETOPNG Writes an image matrix as png file to disk.

Parameters
  • ignoredArg (obj) – IO instance.

  • image (array, NxM) – Image matrix

  • fullPath (str) – Path to where the image will be saved.

Returns

Writes image file to disk.

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@IO.writeToTIF(~, image, fullPath)

WRITETOTIF Writes an image matrix as tif file to disk.

Parameters
  • ignoredArg (obj) – IO instance.

  • image (array, NxM) – Image matrix

  • fullPath (str) – Path to where the image will be saved.

Returns

Writes image file to disk.

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@IO.writeToTXT(~, data, resultFilePath, resultFileName, dataDelimiter)

WRITETOTEXT Writes tracker results to disk in txt format.

Parameters
  • ignoredArg (obj) – IO instance.

  • data (table) – Table of TrackerData instance..

  • resultFilePath (str) – Path to where tracker results should be saved.

  • resultFileName (str) – Name of result file

  • dataDelimiter (str) – Name or symbol of delimiter

Returns

Writes text file to disk.

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@IO.writeToXLS(~, data, resultFilePath, resultFileName, varargin)

WRITETOXLS Writes tracker results to disk as excel spreadsheet.

Parameters
  • ignoredArg (obj) – IO instance.

  • data (table) – Table of TrackerData instance..

  • resultFilePath (str) – Path to where tracker results should be saved.

  • resultFileName (str) – Name of result file

  • varargin (str varchar) –

    • sheetName (str): Name of the excel sheet.

    • rangeStartCol (str): Range start column. Has to be capital characters i.e. A, B, C, AA.

    • rangeStartRow (int): Range start row. Has to be integers i.e. 1,2,3.

    • writeVariableNames (bool): Flag, if table variable names (header) should be written. Defaults to true.

Returns

Writes excel file to disk.

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@IO.writeToXML(~, configuration, file)

WRITETOXML Writes a TracX configuration xml file with all the parameters stored in the ParameterConfiguration and ProjectConfiguration object.

Parameters
  • ignoredArg (obj) – IO instance. instance

  • configuration (obj) – TrackerConfiguration object.

  • file (str) – Path to TracX configuration xml file and its name.

Returns

Writes to disk directly.

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@IO.writeTrackerDataToDisk(this, joinedTrackerDataTable, resultFilePath, resultFileName, varargin)

WRITETRACKERDATATODISK Writes tracker results to disk as text, csv or mat file format delimited by your choice. Default is as text file and tab delimited.

Parameters
  • this (object) – IO instance..

  • joinedTrackerDataTable (table) – Table with joined TrackerData

  • resultFilePath (str) – Path to where tracker results should be saved.

  • resultFileName (str) – Name of result file

  • varargin (str varchar) –

    • fileType (str): Save tracker results with specific file types (‘txt’, ‘csv’, ‘mat’).

    • dataDelimiter (str): Data delimiter (‘,’, ‘comma’, ‘ ‘, ‘space’, ‘t’, ‘tab’, ‘;’, ‘semi’, ‘|’, ‘bar’).

Returns

Writes data file to disk directly.

Return type

void (-)

Authors

Andreas P. Cuny - initial implementation

LAP

class +TracX.@LAP.LAP

LAP class to create cost matricies and solve linear assignment problem.

Authors

Andreas P. Cuny - initial implementation

LAP()

LAP Constructs a TemporaryTrackingData object to create cost matricies and solve linear assignment problem.

Returns

obj

Return type

object Returns a TemporaryTrackingData instance.

Authors

Andreas P. Cuny - initial implementation

+TracX.@LAP.computeAssignmentCostMatrix(this, oldFrame, newFrame, maxCellCenterDisplacement, maxMajorAxisRotation, individualFunctionPenalty, maxCellSizeDecrease, averageCellSizeGrowth, maxCellSizeIncrease, usedFunctionsForCostMatrix, meanCellDiameter, maxTrackFrameSkipping, displacementWeightingMode, is3DData)

COMPUTEASSIGNMENTCOSTMATRIX computes the individual assignement costs for spatial (position), size (area) and rotation (orientation) differences as well as frame skipping and returns the matrices for each cost individually (positionCost: frameSkippingCost) as well as the sum of all costs (totalCost).

Parameters
  • ignoredArg (object) – LAP instance.

  • oldFrame (object) – oldFrame TemporaryTrackingData instance

  • newFrame (object) – newFrame TemporaryTrackingData instance

  • maxCellCenterDisplacement (int, 1x1) – Maximal frame to frame segmentation centroid displacement

  • maxMajorAxisRotation (float 1x1) – Max allowed major axis rotation in degree.

  • individualFunctionPenalty (int 1x1) – Individual function penalty

  • maxCellSizeDecrease (float 1x1) – Maximal allowed frame to frame cell size decrease fraction.

  • averageCellSizeGrowth (float 1x1) – Average allowed frame to frame cell size growth fraction.

  • maxCellSizeIncrease (float 1x1) – Maximal allowed frame to frame cell size increase fraction.

  • usedFunctionsForCostMatrix (array 1x4) – Logical array to select which of the four penalty functions should be used to build the cost matrix.

  • meanCellDiameter (float 1x1) – Mean segmentation object diameter (cell diameter).

  • maxTrackFrameSkipping (int 1x1) – Max number of frames a cell is allowed to be missing from a track

  • displacementWeightingMode (bool) – For quadratic (default) or 1 for linear displacement cost calculation.

  • is3DData (bool) – Is data 3D. Defaults to 0 for 2D data.

Returns

  • totalCost (float IxJ) – Costmatrix with the sum of cost matricies positionCost to frameSkippingCost

  • positionCost (float IxJ) – Costmatrix for spatial position.

  • areaCost (float IxJ) – Costmatrix for size difference (area).

  • rotationCost (float IxJ) – Costmatrix for rotation difference (orientation).

  • frameSkippingCost (float IxJ) – Costmatrix for frame skipping (segmented object not present/detected on current image frame).

Authors

Markus Duerr - initial implementation in R (weight_age)

Authors

Urs Kuechler - translation to Matlab (weight_age)

Authors

Andreas P. Cuny - Re-implementation and new design for computation of individual cost functions with real physical meaning.

+TracX.@LAP.computeFFPCostMatrix(~, oldFrame, newFrame, individualFunctionPenalty, radius, dCRFM)

COMPUTEFFPCOSTMATRIX computes the individual assignement costs for an FFP based tracker based on spatial (position), differences and returns the matrices for each cost individually (positionCost: frameSkippingCost) as well as the sum of all costs (totalCost) to keep the existing structure.

Parameters
  • ignoredArg (object) – LAP instance.

  • oldFrame (object) – oldFrame TemporaryTrackingData instance.

  • newFrame (object) – newFrame TemporaryTrackingData instance.

  • individualFunctionPenalty (int 1x1) – Individual function penalty

  • radius (int 1x1) – Radius for neighbourhood

  • dCRFM (array NxM) – Cell region fingerprint distances.

Returns

  • totalCost (float IxJ) – Costmatrix with the sum of cost matricies

  • positionCost (float IxJ) – Costmatrix for dCRF

  • areaCost (float IxJ) – Costmatrix placeholder

  • rotationCost (float IxJ) – Costmatrix placeholder

  • frameSkippingCost (float IxJ) – Costmatrix placeholder

Authors

Andreas P. Cuny - Initial implementation

+TracX.@LAP.computeNeighbourhoodMotionCostMatrix(~, oldFrame, newFrame, displacementOfAssignedTracks, maxExpectedMovement, cellCloseNeighbours, individualFunctionPenalty, maxCellSizeDecrease, averageCellSizeGrowth, maxCellSizeIncrease)

COMPUTENEIGHBOURHOODMOTIONCOSTMATRIX Computes the individual assignement costs for spatial (position), size (area) differences and returns the matrices for each weighted cost component individually (weightedPositionCost, weightedAreaCost, weightedTotalCost). For computing the individual spatial differences, the individual neighbourhood is considered and the indivudial spatial differeces are compenstated by the minimal difference of its neighbourhood. For the area weight an averageCellSizeGrowth is assumed and the maximal cell size decrease and increase can be specified individually.

Parameters
  • ignoredArg (object) – LAP instance.

  • oldFrame (object) – oldFrame TemporaryTrackingData instance.

  • newFrame (object) – newFrame TemporaryTrackingData instance.

  • displacementOfAssignedTracks (array, Kx3) – Displacement of assigned tracks in x,y,z

  • maxExpectedMovement (float) – Maximum expected segmented centroid movement

  • cellCloseNeighbours (array) – Array of cell close neighbours

  • individualFunctionPenalty (int 1x1) – Individual function penalty

  • maxCellSizeDecrease (float 1x1) – Maximal allowed frame to frame cell size decrease as fraction.

  • averageCellSizeGrowth (float 1x1) – Average allowed frame to frame cell size growth as fraction.

  • maxCellSizeIncrease (float 1x1) – Maximal allowed frame to frame cell size increase as fraction.

Returns

  • weightedTotalCosts (float nxm) – Costmatrix with the sum of cost matrices weightedpositionCost to weightedAreaCost

  • weightedPositionCost (float nxm) – Weighted cost matrix for spatial differences (position).

  • weightedAreaCost (float nxm) – Weighted cost matrix for size differences (area).

Authors

Ricard Delgado-Gonzalo - initial description of neighbourhood preserved motion https://doi.org/10.1109/ISBI.2010.5490288

Authors

Cristian Vesari - Implementation of idea above in MATLAB http://dx.doi.org/10.1098/rsif.2016.0705

Authors

Andreas P. Cuny - Neighbourhood preserved motion implementation for TracX.

+TracX.@LAP.computeNewFrameAssignment(this, oldFrame, newFrame, maxCellCenterDisplacement, maxMajorAxisRotation, maxTrackFrameSkipping, individualFunctionPenalty, maxCellSizeDecrease, averageCellSizeGrowth, maxCellSizeIncrease, usedFunctionsForCostMatrix, fingerprintDistThreshold, meanCellDiameter, is3DData)

COMPUTENEWFRAMEASSIGNMENT Computes linear assignment and returns track indicies for the subsequent frame (‘newFrame’).

Parameters
  • this (object) – LAP instance.

  • oldFrame (object) – oldFrame TemporaryTrackingData instance.

  • newFrame (object) – newFrame TemporaryTrackingData instance.

  • maxCellCenterDisplacement (int, 1x1) – Maximal frame to frame segmentation centroid displacement

  • maxMajorAxisRotation (float 1x1) – Max allowed major axis rotation in degree.

  • maxTrackFrameSkipping (int 1x1) – Max number of frames a cell is allowed to be missing from a track

  • individualFunctionPenalty (int 1x1) – Individual function penalty

  • maxCellSizeDecrease (float 1x1) – Maximal allowed frame to frame cell size decrease in percent.

  • averageCellSizeGrowth (float 1x1) – Average allowed frame to frame cell size growth in percent.

  • maxCellSizeIncrease (float 1x1) – Maximal allowed frame to frame cell size increase in percent.

  • usedFunctionsForCostMatrix (array 1x4) – Logical array to select which of the four penalty functions should be used to build the cost matrix.

  • fingerprintDistThreshold (float 1x1) – CRF threshold

  • meanCellDiameter (float 1x1) – Mean segmentation object diameter (cell diameter).

  • is3DData (bool) – Is data 3D. Defaults to 0 for 2D data.

Returns

  • newTrackIndex (array) – New track indices array

  • totalCost (float IxJ) – Costmatrix with the sum of cost matricies positionCost to frameSkippingCost

  • positionCost (float IxJ) – Costmatrix for spatial position.

  • areaCost (float IxJ) – Costmatrix for size difference (area).

  • rotationCost (float IxJ) – Costmatrix for rotation difference (orientation).

  • frameSkippingCost (float IxJ) – Costmatrix for frame skipping (segmented object not present/detected on current image frame).

Authors

Andreas P. Cuny - initial implementation

+TracX.@LAP.computeOrientationDifference(~, a, b)

COMPUTEORIENTATIONDIFFERENCE Calculates the central angle between two orientation vectors

Parameters
  • ignoredArg (object) – LAP instance.

  • a (array) – Orientation vector a

  • b (array) – Orientation vector b

Returns

result – Resulting orientation difference

Return type

double

Authors

Thomas Kuendig - initial implementation

+TracX.@LAP.computeOrientationDifferenceMatrix(this, A, B)

COMPUTEORIENTATIONDIFFERENCEMATRIX Computes the orientation difference matrix.

Parameters
  • this (object) – LAP instance.

  • A (array) – Orientation matrix A

  • B (array) – Orientation matrix B

Returns

resultMatrix – Resulting matrix

Return type

double

Authors

Thomas Kuendig - initial implementation

+TracX.@LAP.fingperprintCostMatrixRefinement(~, newFrame, oldFrame, costMatrix, fingerprintDistThreshold)

FINGERPRINTCOSTMATRIXREFINEMENT Refines the cost matrix by setting costs for confirmed/trusted assignments (below fingerprint distance threshold) to 0 and detection of invalid costMatrix rows (all costs above max individual function penalty.

Parameters
  • ignoredArg (object) – LAP instance.

  • oldFrame (object) – oldFrame TemporaryTrackingData instance.

  • newFrame (object) – newFrame TemporaryTrackingData instance.

  • costMatrix (double, NxM) – Cost matrix for assignments between old- and newFrame.

  • fingerprintDistThreshold (float) – fingerprintDistThreshold

Returns

  • costMatrix (double NxM) – Refined cost matrix

  • excludeFromAssignmentIdx (array Nx1) – Logical indicies of rows to exclude from costMatrix.

Authors

Andreas P. Cuny - initial implementation

+TracX.@LAP.lapjv(~, costMat, varargin)

LAPJV Wrapper around the Jonker-Volgenant Algorithm for Linear Assignment Problem. Returns the optimal column indices, ROWSOL, assigned to row in solution, and the minimum COST based on the assignment problem represented by the COSTMAT, where the (i,j)th element represents the cost to assign the jth job to the ith worker.

Parameters
  • ignoredArg (object) – LAP instance.

  • costMat (array, IxJ) – [IxJ, Float] Cost matrix, where the (i,j)th element represents the cost to assign the jth job to the ith worker.

  • varargin (int, 1x1) – ‘resolution’ (Optional) input can be used to define data resolution to accelerate speed.

Returns

  • rowsol (array) – The optimal column indices

  • cost (array) – Minimum COST based on the assignment problem

  • v (array) – Dual variables, column reduction numbers.

  • u (array) – Dual variables, row reduction numbers.

  • costMat (array) – The reduced cost matrix.

Authors

Andreas P. Cuny - initial implementation

+TracX.@LAP.mammalianLineageCost(~, oldFrameData, newFrameData, daughterpairTracks, parentTracks, daughterpairTypes, parentTypes)

MAMMALIANLINEAGECOST Cost matrix function for mammalian lineage reconstruction in 2 & 3D.

Parameters
  • ignoredArg (object) – LAP instance.

  • oldFrameData (object) – oldFrame TemporaryTrackingData instance.

  • newFrameData (object) – newFrame TemporaryTrackingData instance.

  • daughterpairTracks (int, 1xK) – Array of daughterpair tracks

  • parentTracks (int, 1xJ) – Array of parent tracks

  • daughterpairTypes (int, 1x1) – Type of daughter pairs (I or II)

  • parentTypes (int, 1x1) – Type of parents (I or II)

Returns

cost – Cost matrix

Return type

array

Authors

Thomas Kuendig - initial implementation

+TracX.@LAP.orientationDecompressor(~, tag)

ORIENTATIONDECOMPRESSOR Decompresses the linearized orientation vector to its 3D format.

Parameters
  • ignoredArg (object) – LAP instance.

  • tag (array) – Compressed and linearized orientation 3D vector

Returns

vec – Decompressed orientation vector

Return type

array Kx3

Authors

Thomas Kuendig - initial implementation

+TracX.@LAP.solveLAP(this, costMatrix, varargin)

SOLVELAP Computes linear assignment and returns the assignments for the row and columns of the costMatrix (i.e. oldFrame and newFrame) and the linear assignement location indicies of the costMatrix directly.

Parameters
  • this (object) – LAP instance.

  • costMatrix (float, IxJ) – costMatrix with the total cost of all individual weighting functions.

  • varargin (float, IxJ) – (Optional) individual weighted costs matrix for i.e. position, area.

Returns

  • assignmentRowIdx (int Ix1) – Optimal row indicies

  • assignmentColIdx (int Ix1) – Optimal column indicies

  • assignmentLocIdx (int Ix1) – Linear indicies for optimal row and column indicies

  • assignmentCosts array IxJ – Costs of the final assignment

  • varargout int – An array for each varargin with the assignmentLocIdx applied of same size.

Authors

Andreas P. Cuny - initial implementation

Lineage

class +TracX.@Lineage.Lineage(data, config)

Bases: handle

LINEAGE Implements functionalities to reconstruct the cell lineage for asymmetrically and symetrically dividing cell types.

Authors

Andreas P. Cuny - initial implementation

Lineage(data, config)

LINEAGE Constructs a Lineage object to reconstruct the generalogy for asymmetric and symmetric dividing cells.

Returns

Returns a Lineage object instance.

Return type

obj (-)

Authors

Andreas P. Cuny - initial implementation

asymmetricalLineageReconstruction(this)

ASYMMETRICALLINEAGERECONSTRUCTION Runs the asymmetrical lineage reconstruction i.e for budding yeast.

Parameters

this (object) – Lineage instance

Return type

void (-)

cellCyclePhaseTable = None

Cell cycle phases

configuration = None

+TracX.@TrackerConfiguration TrackerConfiguration instance with the tracking parameters and project metadata.

data = None

+TracX.@TrackerData instance stores all segmentation, quantification and lineage data.

fingerprint = None

+TracX.@Fingerprint instance implementing fingerprinting methods.

io = None

+TracX.@IO instance implementing read/write methods.

lap = None

+TracX.@LAP instance implementing tracking methods.

lineageData = None

+TracX.@LineageData instance implementing temporary lineage data storage.

lineageTable = None

Lineage summary table.

mammalianLineageReconstruction(this)

MAMMALIANLINEAGERECONSTRUCTION Runs the symmetrical lineage reconstruction for mammalian cells with convex shapes.

Parameters

this (object) – Lineage instance

Return type

void (-)

motion = None

+TracX.@Motion instance implementing motion methods.

runLineageReconstruction(this, varargin)

RUNLINEAGERECONSTRUCTION Starts lineage reconstruction based on tracking results for symmetrically and asymmetrically dividing cells.

Parameters
  • this (object) – Lineage instance

  • varargin (str varchar) –

    • symmetricalDivision (bool): Flag, defining which lineage reconstruction approach to use. Defaults to is asymmetrical divison (0).

    • writeControlImages (bool): Flag, to save lineage control images segmentation are written out. Defaults to false.

    • nuclearMarkerChannel (int): Fluorescent channel number depicting a nuclear marker.

    • maxFrameEvalAfterBirth (int): Max number of frames after brith to consider a MD pair.

Return type

void (-)

setLineageTable(this)

SETLINEAGETABLE Sets the lineage summary table.

Parameters

this (object) – Lineage instance

Return type

void (-)

symmetricalLineageReconstruction(this)

SYMMETRICALLINEAGERECONSTRUCTION Runs the symmetrical lineage reconstruction (rod shaped cells).

Parameters

this (object) – Lineage instance

Return type

void (-)

tracks2Merge = None

Matrix with info about mother and buds to merge prior division

unresolvedTempLinAss = None

+TracX.@TemporaryLineageAssignment instance implementing temporary assignments methods.

utils = None

+TracX.@Utils instance implementing utility methods.

+TracX.@Lineage.detectBudNeckMarkerPixelArray(this, imageDir, fluoLineageFileName, imageCropCoordinateArray, segMaskDilated, divisionMarkerDenoising, divisionMarkerEdgeSensitivityThresh, divisionMarkerConvexAreaLowerThresh, divisionMarkerConvexAreaUpperThresh)

DETECTBUDNECKMARKERPIXELARRAY Detect bud neck marker from fluorescence images. A ROF denoising is first applied and then an edge detection to get an array of pixel covered by each bud.

Parameters
  • this (object) – Lineage instance

  • imageDir (str) – Path to image directory

  • fluoLineageFileName (str) – Fluorescence image file names for the given channel and frame.

  • imageCropCoordinateArray (array, 1x4) – Array with crop coordinates used during segmentation. Needed to map segmentation cell cennters to correct position within the raw images.

  • segMaskDilated (array, NxM) – Dilated cell segmentation mask where masks touch each others.

  • divisionMarkerDenoising (float) – divisionMarkerDenoising

  • divisionMarkerEdgeSensitivityThresh (float) – divisionMarkerEdgeSensitivityThresh

  • divisionMarkerConvexAreaLowerThresh (float) – divisionMarkerConvexAreaLowerThresh

  • divisionMarkerConvexAreaUpperThresh (float) – divisionMarkerConvexAreaUpperThresh

Returns

  • budPixelIndiciesArray array – Array of all pixels belonging to a bud.

  • foundEdgesFilled array NxM – Image after edge detection with filled holes

  • fluoImgDenoised array NxM – Denoised image

Authors

Andreas P. Cuny - initial implementation

+TracX.@Lineage.evaluateNewMammalianRoots(this, varargin)

EVALUATENEWMAMMALIANROOTS Determination of best lineage for given root cells for mammalian lineage reconstruction.

Parameters
  • this (object) – Lineage instance

  • varargin (str varchar) –

    • roots (array): Array of lineage roots.

Returns

Prints reslut to console.

Return type

void (-)

Authors

Thomas Kuendig - initial implementation

+TracX.@Lineage.generateLineageTreeObject(this, varargin)

GENERATELINEAGETREEObject Generates a lineage tree object for one or multiple root cells (i.e. cells on the first image frame).

Parameters
  • this (object) – Lineage instance

  • varargin (str varchar) –

    • rootIndicies (array): Array of lineage

      root track indices.

Returns

Array containing a lineage tree object for each rood index.

Return type

lineageTreeArray (array)

Note

The returned tree object can be visualized in a figure or as text in the console with i.e lineageTreeArray{1}.tostring.

Authors

Andreas P. Cuny - initial implementation

+TracX.@Lineage.getBkgCorrSig(~, x, y, track, minSigLength, qc)

GETBKGCURRSIG Returns a background corrected nuclear signal for G1 determination.

Parameters
  • ignoredArg (object) – Lineage instance

  • x (array) – Array of frame numbers of signal.

  • y (array) – Array with raw signal

  • track (int) – Current track index. track indices.

  • minSigLength (int) – Minimal length of signal to be considered.

  • qc (bool) – Flag, if quality control images should be written.

Returns

  • bkgCorrSig array – Array with background corrected signal.

  • validSigL array – Logical array for valid signal.

  • fh handle – Figure handle of quality control image

Authors

Andreas P. Cuny - initial implementation

+TracX.@Lineage.getCellCyclePhaseTable(this)

GETCELLCYCLEPHASETABLE Returns the full cell cycle phase table.

Parameters

this (object) – Lineage instance

Returns

Full cell cycle table with columns ‘track’, ‘parent’, ‘daughter’, ‘tree’ … ‘generation’, ‘age’, ‘pole1_age’, ‘pole2_age’, ‘g1_st’, ‘g1_e’, … ‘g1_dur’, ‘g2_st’, ‘g2_e’, ‘g2_dur’, ‘div’, ‘seg_st_track’, ‘seg_st_daughter’. Abbreviations st, start, e, end, dur, duration, div, division, seg_st, segmentation start.

Return type

t table

Authors

Andreas P. Cuny - initial implementation

+TracX.@Lineage.getDivisionFrames(this, toRootTrackRelatedCellArray)

GETDIVISIONFRAMES Returns an array of the division frames for an array of track indicies such as i.e. lineage root related tracks. It is assumed that the first element is allways the rote of the lineage tree.

Parameters
  • this (object) – Lineage instance

  • toRootTrackRelatedCellArray (int) – Array with to root related track indices.

Returns

Indices of joined non empty splitted track indices and joined track indices.

Return type

divisionFrameArray array

Authors

Andreas P. Cuny - initial implementation

+TracX.@Lineage.getLineProfileVerification(~, img, x, y, resizeFactor, divisionMarkerLineProfileLength, divisionMarkerLineProfilePeakLowerBound, divisionMarkerLineProfilePeakUpperBound)

GETLINEPROFILEVERIFICATION Computes a line profile between two centroids and returns true if a peak in the line profile above a given threshold is is found. Additionaly the retrived line profile is returned in its raw and resampled form.

Parameters
  • ignoredArg (object) – Lineage instance.

  • img (array, NxM) – Image matrix.

  • x (array, kx1) – Spatial coordinates of start and endpoint for line profile in x.

  • y (array, kx1) – Spatial coordinates of start and endpoint for line profile in y.

  • resizeFactor (int, 1x1) – Number used to resize the image matrix to increase processing speed. Attention: To high downscaleing can result in false positive line profiles since only a few pixel remain.

  • divisionMarkerLineProfileLength (int) – Max length to resample the profiles to.

  • divisionMarkerLineProfilePeakLowerBound (int) – Lower bound to accept a peak in the Line profile.

  • divisionMarkerLineProfilePeakUpperBound (int) – Upper bound to accept a peak in the Line profile.

Returns

  • validPair bool – Binarization of the result. 1 if at least one peak was detected. 0 if no peak was detected.

  • lineProfileResampled array Array of resampled line profile.

  • lineProfileRaw array Array of raw line profile – with applied resizing.

Authors

Andreas P. Cuny - initial implementation

+TracX.@Lineage.getLineageSummary(this)

GETLINEAGESUMMARY Returns a condensed version of the cell lineage as a table. Each row is a division event with the columns mother_start_frame, trackindex_mother, daughter_start_frame, trackindex_daughter, division_frame.

Parameters

this (object) – Lineage instance

Returns

Lineage summary as table.

Return type

summaryTable table

Authors

Andreas P. Cuny - initial implementation

+TracX.@Lineage.getNewickFormat(this, varargin)

GETNEWICKFORMAT Converts the LineageTreeObject/Summary to a phytree object or to the Newick format.

Parameters
  • this (obj) – Lineage object

  • varargin (str varchar) –

    • rootIndicies (int): The lineage root; Any ‘track_index’ number.

    • plotToFigure (bool): Flag if lineage tree should be plotted to a figure. Defaults to false.

Returns

  • B ((array, nx2)) – Numeric array of size [NUMBRANCHES X 2] in which every row represents a branch of the tree. It contains two pointers to the branch or leaf nodes, which are its children.

  • nwk ((str):) – NEWICK tree string format.

  • phyStruct ((stuct):) – Phytree struct.

  • figH ((object):) – Phytree figure handle.

  • Authors: – Andreas P. Cuny - initial implementation Eline Y. Bijman - initial implementation

+TracX.@Lineage.getRootTrackRelatedDaughterArray(~, trackIndexArray, trackParentArray, rootTrack)

GETROOTTRACKRELATEDDAUGHTERARRAY Finds all SegmentationData.track_index directly and indirectly related to a certain track_index of interest (e.g. root of a lineage).

Parameters
  • ignoredArg (object) – Lineage instance.

  • trackIndexArray (array, kx1) – Array with all track indicies track_index

  • trackParentArray (array, kx1) – Array with all track parents track_parent

  • rootTrack (int, 1x1) – The lineage tree root track

Returns

Array containing track_index numbers of to rootTrack related cells. (For all those track indicies the initial cell_parent track_index (rootTrack) can be added to track_lineage

Return type

rootTrackRelatedCellArray array

Authors

Andreas P. Cuny - initial implementation

+TracX.@Lineage.getRootTrackTreeObject(~, trackIndexArray, trackParentArray, rootTrack, rootTrackRelatedCellArray)

GETROOTTRACKTREEOBJECT Constructs a tree lineage tree object for a specified rootTrack (SegmentationData.track_index typically of the first image frame) and all its relatives.

Parameters
  • ignoredArg (object) – Lineage instance.

  • trackIndexArray (array, kx1) – Array with all track indicies track_index

  • trackParentArray (array, kx1) – Array with all track parents track_parent

  • rootTrack (int, 1x1) – The lineage tree root track

  • rootTrackRelatedCellArray (int, jx1) – Related track indices with parent parent == rootTrack

Returns

Lineage tree object for rootTrack and all its relatives. Can be visualized as cmd text output using lineageTree.tostring or graphically using lineageTree.plotBinaryTree( [], ‘Parent’, figureHandle ‘TextRotation’, 360).

Return type

lineageTree object

Authors

Andreas P. Cuny - initial implementation

+TracX.@Lineage.getTracks2Merge(this)

GETTRACKS2MERGE Returns a matrix with the mothers and buds to be merged prior division.

Parameters

this (object) – Lineage instance.

Returns

Array with the tracks to merge. Colums are frame_number, mother track_index daughter track_index, mother uuid, daughter uuid

Return type

tracks2Merge array

Authors

Andreas P. Cuny - initial implementation

+TracX.@Lineage.getTreeNodeDurations(this, lineageTree, firstFrame, lastFrame, imageFreq)

GETTREENODEDURATIONS Returns a tree object containing the cell cycle duration until cell division.

Parameters
  • this (object) – Lineage instance.

  • lineageTree (obj) – Lineage tree

  • firstFrame (int) – First frame of experiment

  • lastFrame (int) – Last frmae of experiment

  • imageFreq (float) – Image frequency [h].

Returns

  • durationTreeObj obj – Duration tree object.

  • phaseStartIdxNew array – Array with cell cycle phase start indices.

  • phaseEndIdxNew array – Array with cell cycle phase end indices.

Authors

Andreas P. Cuny - initial implementation

+TracX.@Lineage.recursiveTrackParentColoring(this, root, color, colormap, trackIndexArray, trackParentArray)

RECURSIVETRACKPARENTCOLORING Returns a colormap for recursive track parent coloring.

Parameters
  • this (object) – Lineage instance.

  • root (int) – Root track index.

  • color (array) – Color.

  • colormap (array) – Colormap

  • trackIndexArray (array) – Track index array.

  • trackParentArray (array) – Track parent array.

Returns

Colormap

Return type

colormap array kx3

Authors

Thomas Kuendig - initial implementation

+TracX.@Lineage.resolveCircAssignment(this)

RESOLVECIRCASSIGNMENT Aims to resove circular mother-daugher assignments where each track assignes each other as parent. The incorect assignment will be deleted.

Parameters

this (object) – Lineage instance.

Return type

void -

Authors

Andreas P. Cuny - initial implementation

+TracX.@Lineage.runMarkerTracking(this, varargin)

RUNMARKERTRACKING Runs the tracker algorithm for cell cycle marker channels. To track i.e a bud neck marker.

Parameters
  • this (object) – Lineage instance

  • varargin (str varchar) –

    • divisionMarkerMaxTrackFrameSkipping (int): Max frame skipping for segmented division marker.

    • divisionMarkerMaxObjCenterDisplacement (float): Max displacement for segmented division marker.

    • divisionMarkerMaxObjSizeIncrease (float): Max object size increase for segmented division marker.

    • divisionMarkerFingerprintHalfWindowSideLength (int): Fingerprint half window side length.

    • qc (str): Flag, if quality control images should be written. Defaults to false.

Return type

void -

Authors

Andreas P. Cuny - initial implementation

+TracX.@Lineage.setBirthToDivPhase(this)

SETBIRTHTODIVPHASE Sets the phase between birth and cell division, also known as G2 or S/G2/M phase in budding yeast.

Parameters

this (object) – Lineage instance

Return type

void -

Authors

Andreas P. Cuny - initial implementation

+TracX.@Lineage.setParentAndHasBud(this)

SETPARENTANDHASBUD Sets the track parent, the probability of the parent being correct and the parent score as well as during which frames the cell has a bud.

Parameters

this (object) – Lineage instance

Return type

void -

Authors

Andreas P. Cuny - initial implementation

+TracX.@Lineage.setParentMamDivCells(this, startFrame, endFrame, imageFrameNumberArray, joinTracks, printOutput)

SETPARENTMAMDIVCELLS Determines the relationship between daughter and mother cell of symmetricaly dividing cells.

Parameters
  • this (object) – Lineage instance

  • startFrame (int) – Number of the first frame of the project where to start the mother daughter assignment.

  • endFrame (int) – Number of the last frame of the project where to end the mother daughter assignment.

  • imageFrameNumberArray (object) – Array with all image frame numbers for current project. This function evaluates this array in the range startFrame to endFrame.

  • joinTracks (bool) – Flag to join tracks. Defaults to true.

  • printOutput (bool) – Flag, if output should be printed to console.

Returns

Indices of joined non empty splitted track indices and joined track indices.

Return type

stable array

Authors

Andreas P. Cuny - initial implementation

+TracX.@Lineage.setSignalInNucleus(this, channel, qc, varargin)

SETSIGNALINNUCLEUS Quantifies if a signal is in the nucleus when it is larger than the mean + 0.5 * mad.

Parameters
  • this (object) – Lineage instance

  • channel (int) – Number of the fluorescent channel to read.

  • qc (bool) – Flag if quality control images should be generated.

  • varargin (str varchar) –

    • minSignalLength (int): Minimal length of signal [frames]. Defaults to 2.

Returns

Binary array. 1 if signal is in nucleus, 0 otherwise.

Return type

sigInNuc array

Authors

Andreas P. Cuny - initial implementation

+TracX.@Lineage.setTrackAge(this)

SETTRACKAGE Sets the cell age for each track after lineage reconstruction.

Parameters

this (object) – Lineage instance

Return type

void -

Authors

Andreas P. Cuny - initial implementation

+TracX.@Lineage.setTrackGeneration(this)

SETTRACKGENERATION Sets the cell generation for each track after lineage reconstruction.

Parameters

this (object) – Lineage instance

Return type

void -

Authors

Andreas P. Cuny - initial implementation

+TracX.@Lineage.splitSurvivingParentTracks(this)

SPLITSURVIVINGPARENTTRACKS Splits surviving parent tracks during mammalian lineage reconstruction.

Parameters

this (object) – Tracker instance

Return type

void -

Authors

Thomas Kuendig - initial implementation

+TracX.@Lineage.validateTmpLinAss(this)

VALIDATETMPLINASS Validates temporary mother daughter (MD) assignments based on how often an overlapping assignment was found and with which budneck marker track. Assignments where a marker track is used for different MD pairs will be modified by keeping the one pair with the most detections. The others will get the second longest assignment or if there is none these will be deleted.

Parameters

this (object) – Tracker instance

Return type

void -

Authors

Andreas P. Cuny - initial implementation

LineageData

class +TracX.@LineageData.LineageData

Bases: handle

LINEAGEDATA Creates an object to store data generated during lineage reconstruction such as i.e. segmentation and quantification of bud neck marker Myo1 in S. cerevisiae.

Authors

Andreas P. Cuny - initial implementation

InitializeVeryOld(this, assignmentRowIdx, maxTrackFrameSkipping)

INITIALIZEVERYOLD Initailizes the VeryOld property of the Tracker with data from OldFrame.

Parameters
  • this (object) – LineageData instance

  • assignmentRowIdx (int) – Row index of track assignment.

  • maxTrackFrameSkipping (int) – Max tolerated frames a track is allowed to be missing.

Returns

LineageData instance.

Return type

this object

NewFrame = 'TracX.TemporaryTrackingData()'

NewFrame to keep obj frame properties for tracking

OldFrame = 'TracX.TemporaryTrackingData()'

OldFrame to keep obj frame properties for tracking

VeryOld = 'TracX.TemporaryTrackingData()'

VeryOld to keep obj frame properties for tracking

clearMarkerTracking(this)

CLEANMARKGERTRACKING Deletes all previous assignments made during marker trakcing (for cell cycle determination of asymmetrically dividing cells).

Parameters

this (object) – LineageData instance

Return type

void (-)

copyResultsToTrackerData(this, dataToSave, fieldName, emptyDataLocIdx, oldFrameLocIdx, frameNumber)

COPYRESULTSTOTRACKERDATA Copies results of the frame by frame tracking to the data store TracX.TrackerData.

Parameters
  • this (object) – LineageData instance

  • dataToSave (str) – Empty array (cell, nan) of the correct size to hold the data to save.

  • fieldName (str) – String with fieldname where to add new values.

  • emptyDataLocIdx (array) – Location indicies of empty data.

  • oldFrameLocIdx (array) – OldFrame location indicies for track_index.

  • frameNumber (int) – Frame number for which the fieldName data should be added.

Return type

void (-)

evaluateObjSigAroundTrustedFrames(this, trustedFrames, currDaughter, currMother)

EVALUATEOBJSIGAROUNDTRUSTEDFRAMES Evaluates the signal of the detected object around the trusted frames of mother daughter candidate pairs.

Parameters
  • this (object) – LineageData instance

  • trustedFrames (array, kx1) – Array of trusted frames.

  • currDaughter (int) – Track index of current daughter.

  • currMother (int) – Track index of current mother.

Returns

LineageData instance.

Return type

this object

getConditionalFieldArray(this, fieldName, fieldNameCond, Condition)

GETCONDITIONALFIELDARRAY Returns an array with all the data for a given fieldName (SegmentationData property) matching a given condition for the fieldNameCon (SegmentationData property).

Parameters
  • this (object) – LineageData instance

  • fieldName (str) – String with fieldname where to get values from.

  • fieldNameCond (str) – String with fieldname to match the condition

  • Condition (array) – : Array with condition to match the match with the fieldNameCond.

Returns

Array of selected data.

Return type

ret array

getFieldArrayForFrame(this, fieldName, frameNumber)

GETFIELDARRAYFORFRAME Returns an array with all the data for a given fieldName (LineageData property) for a given frameNumber (image frame).

Parameters
  • this (object) – LineageData instance

  • fieldName (str) – String with fieldname where to get values from.

  • frameNumber (int) – Frame number for which the fieldName data should be returned.

Returns

Array of selected data.

Return type

ret array

getNumberOfRowsFromFrame(this, frameNumber)

GETNUMBEROFROWSFORFRAME Returns the number of rows in the SegmentationData object for the selected frameNumber.

Parameters
  • this (object) – LineageData instance

  • frameNumber (int) – Frame number for which the data should be retrieved.

Returns

Number of rows in LineageData for frameNumber.

Return type

nRows (int)

getTrackIndexStorageIndicies(this)

GETTRACKINDEXSTORAGEINDICIES Returns indicies of track_index where to store them.

Parameters

this (object) – LineageData instance

Returns

  • oldFrameIdx (array) – OldFrame indicies for track_index.

  • emptyDataIdx (array) – Indicies of empty data.

initializeCellCloseNeighbours(this, neighbourRadius, nUniqueFrames)

INITIALIZECELLCLOSENEIGHBOURS Initializes the cell neighbourhood index matrix for all cells within neighbourRadius related fields of the LineageData object.

Parameters
  • this (object) – LineageData instance

  • neighbourRadius (int) – Distance in pixel to consider other cells to be a neighbouring cell.

  • nUniqueFrames (int) – Max number of frames to initialize neighbourhood.

Returns

LineageData instance.

Return type

this object

initializeNewFrame(this, frameNumber)

INITIALIZENEWFRAME Initailizes the NewFrame property of the Tracker with data from the Tracker.Data object for the current image frame (frameNumber).

Parameters
  • this (object) – LineageData instance

  • frameNumber (int) – Frame number of subsequent image frame.

Returns

Initializes the LineageData.NewFrame object and returns LineageData.

Return type

this object

initializeOldFrame(this)

INITIALIZEOLDFRAME Initailizes the OldFrame property for Lineage marker tracker with data from the LineageData object for the first image frame (frameNumber i.e. 1).

Parameters

this (object) – LineageData instance

Returns

LineageData instance.

Return type

this object

numberOfTracks = None

Max number of tracks

obj_area = None

Area of segmented object.

obj_center_x = None

X component of segmented object center.

obj_center_y = None

Y component of segmented object center.

obj_center_z = None

Z component of segmented object center.

obj_channel_id = None

Image channel id of segmented object.

obj_close_neighbour = None

Neighbourhood of each object

obj_dif_x = None

old to newFrame displacement in x.

obj_dif_y = None

old to newFrame displacement in y.

obj_dif_z = None

old to newFrame displacement in z.

obj_filtered_dif_x = None

Filtered old to newFrame displacement in x.

obj_filtered_dif_y = None

Filtered old to newFrame displacement in x.

obj_filtered_dif_z = None

Filtered old to newFrame displacement in x.

obj_fluoImgDenoised = None

Denoised image of obj_channel_id {obj1:obj_n, chl_1:chl_n}.

obj_fluo_mean = None

Mean denoised signal of segmented object.

obj_fluo_total = None

Total denoised signal of segmented object.

obj_frame = None

Image frame number of segmented object.

obj_index = None

Unique segmentation object label for each frame.

obj_major_axis = None

Major axis of segmented object.

obj_minor_axis = None

Minor axis of segmented object.

obj_orientation = None

Orientation of segmented object.

obj_parent_fluo_mean = None

Mean denoised signal of parent cell of segmented object (i.e. background).

obj_parent_fluo_total = None

Total denoised signal of parent cell of segmented object (i.e. background).

obj_parent_seg_mask_id = None

Cell segmentation mask id overlaping with object.

obj_parent_track_index = None

Trackindex of parent cell.

obj_parent_uuid = None

UUID of parent cell.

obj_perimeter = None

Perimeter of segmented object.

obj_pixelIdxList = None

Pixel indicies list of segmented object {obj1:obj_n, chl_1:chl_n}.

obj_track_age = None

Track age of each obj

obj_track_fingerprint_real = '{}'

Track fingerprint real

obj_track_index = None

Track index of obj

saveTrackingAssignmentsToTrackerData(this, frameNumber, dataToSave)

SAVETRACKINGASSIGNMENTSTOTRACKERDATA Update the temporary data (oldFrame) by joining newFrame and veryOld for the next frame track assignment iteration.

Parameters
  • this (object) – LineageData instance

  • frameNumber (int) – Frame number for which the data should be saved.

  • dataToSave (array) – New tracking assignment data to be saved.

Return type

void (-)

setFieldArrayForFrame(this, fieldName, frameNumber, fieldDataArray)

SETFIELDARRAYFORFRAME Sets data for a particular fieldname in the SegmentationData object of TrackerData.

Parameters
  • this (object) – LineageData instance

  • fieldName (str) – String with fieldname where to add new values.

  • frameNumber (int) – Frame number for which the fieldName data should be added.

  • fieldDataArray (array) – Data to add to fieldName.

Return type

void (-)

setObjParent(this, daughters, mothers, motherCandidates, frameOccurance)

SETOBJPARENT Sets the parent (cell) of the current segmented object (budneck marker signal).

Parameters
  • this (object) – LineageData instance

  • daughters (array) – Array of Track indices for the daughters.

  • mothers (array) – Array of Track indices for the mothers.

  • motherCandidates (array) – Array of Track indices for the mother candidates.

  • frameOccurance (array) – Array of frame numbers for mother daughter pairs.

Returns

LineageData instance.

Return type

this object

setUUID(this)

SETUUID Sets a unique id for each object in LineageData over the whole project to facilitate the selection of data. :param this: LineageData instance :type this: object

Returns

LineageData instance.

Return type

this object

track_fingerprint_real_distance = None

Track fingerprint read distance

updateTemporaryTrackingDataForNextFrameEvaluation(this, neighbourhoodSearchRadius)

UPDATETEMPORARYTRACKINGDATAFORNEXTFRAMEEVALUATION Update the temporary data (oldFrame) by joining newFrame and veryOld for the next frame track assignment iteration.

Parameters
  • this (object) – LineageData instance

  • neighbourRadius (int) – Distance in pixel to consider other cells to be a neighbouring cell.

Return type

void (-)

uuid = None

Primary key (unique identifier for each object).

+TracX.@LineageData.getCloseCellNeighbourIdx(~, xCoordinateArray, yCoordinateArray, neighbourhoodSearchRadius)

GETCLOSECELLNEIGHBOURIDX Returns a square logical matrix of size length(x) where as 1 corresponds to a neighbour within the neighbourhoodSearchRadius.

Parameters
  • ignoredArg (object) – LineageData instance

  • xCoordinateArray (array, kx1) – Array with x coordinates

  • yCoordinateArray (array, kx1) – Array with y coordinates

  • neighbourhoodSearchRadius (int) – Radius in pixel within an other point defined by the coordinate arrays x and y is considered to be a neighbour of (x_i,y_i). neighbourhoodSearchRadius

Returns

Square logical matrix selecting the neighbours within neighbourhoodSearchRadius.

Return type

closeNeighboursIdx array NxM

Authors

Andreas P. Cuny - initial implementation

+TracX.@LineageData.moveToVeryOld(this, selectedTrackArray, neighbourhoodSearchRadius)

MOVETOVERYOLD Moves temporary data stored in OldFrame to VeryOld.

Parameters
  • this (object) – LineageData instance

  • selectedTrackArray (array, kx1) – Array of selected track indicies to move.

  • neighbourhoodSearchRadius (int) – Radius in pixel within an other point defined by the coordinate arrays x and y is considered to be a neighbour of (x_i,y_i). neighbourhoodSearchRadius

Returns

Array of track idndicies to change.

Return type

trackIdxToChange array NxM

Authors

Andreas P. Cuny - initial implementation

Motion

class +TracX.@Motion.Motion

MOTION class to deal with cell motion and filter vectorns on consecutive images.

Authors

Andreas P. Cuny - initial implementation

Motion()

MOTION Constructs a Motion object to deal with cell motion and filter vectorns on consecutive images.

Returns

obj – Returns a Motion instance

Return type

object

Authors

Andreas P. Cuny - initial implementation

+TracX.@Motion.filterVectorField(~, X, Y, Z, dX, dY, dZ, radiusSupportX, radiusSupportY, radiusSupportZ)

FILTERVECTORFIELD Filters a vector field by calculating a Gaussian-weighted average of neighboring vector components at each position in the vector field.

The support of the Gaussian weighting kernel is defined as the radius of the 2D Gaussian from the center to the location where the support falls to a 1% of the central value.

Parameters
  • ignoredArg (object) – Motion instance

  • X (array, Nx1) – Array of X coordinates of the vector field.

  • Y (array, Nx1) – Array of Y coordinates of the vector field.

  • dX (array, Nx1) – Array of X components at each position in the vector field.

  • dY (array, Nx1) – Array of Y components at each position in the vector field.

  • radiusSupportX (int) – Radius of the Gaussian weighting function support in X direction

  • radiusSupportY (int) – Radius of the Gaussian weighting function support in Y direction

Returns

  • wdX (array Nx1) – Filtered components ate the X positions with calculated Gaussian weights

  • wdY (array Nx1) – Filtered components ate the Y positions with calculated Gaussian weights.

Authors

Aaron Ponti - initial implementation in Python

Authors

Andreas P. Cuny - Translation to Matlab

+TracX.@Motion.getInvalidVectors(~, x, y, z, dx, dy, dz, neighbourMatrix, meanCellDiameter, nStd)

GETINVALIDVECTORS Tries to find invalid vectors based on an exceptional long vector distance (due to miss assignment). Vector lengths above n times the standard deviation from the mean are identified as invalid.

Parameters
  • ignoredArg (int) – Motion instance

  • x (array, Nx1) – Array of X coordinates of the vectors.

  • y (array, Nx1) – Array of Y coordinates of the vectors.

  • dx (array, Nx1) – Array of dX coordinates of the vectors.

  • dy (array, Nx1) – Array of dY coordinates of the vectors.

  • neighbourMatrix (bool, NxN) – Logical matrix of neighbours of x and y.

  • meanCellDiameter (float, 1x1) – TracX.ParameterConfiguration.meanCellDiameter

  • nStd (int, 1x1) – : Nr of standard deviations to keep from the mean vector length of the vector field.

Returns

  • invalidVectorsIdx (array Nx1) – Logical indicies of invalid vector lengths.

  • vecLength (array Nx1) – Array of common vector lengths.

Authors

Andreas P. Cuny - initial implementation

+TracX.@Motion.interpolateVectorComponents(~, x, y, fdX, fdY, fdZ, Lia, neighbourLocIdxMatrix)

INTERPOLATEVECTORCOMPONENTS Averages vector components by its neighbourhood.

Parameters
  • ignoredArg (object) – Motion instance

  • x (array, Nx1) – Array of X coordinates of all cells.

  • y (array, Nx1) – Array of Y coordinates of all cells.

  • fdX (array, Nx1) – Array of Gaussian filtered X components at matching position (identical cells) in the vector field.

  • fdY (array, Nx1) – Array of Gaussian filtered Y components at matching position (identical cells) in the vector field.

  • Lia (array, Nx1) – Location indicies for dfX and dfY into X and Y.

  • neighbourLocIdxMatrix (array, Nx1) – Location indicies of X,Y neighbourhood

Returns

  • wdX (array Nx1) – Filtered components ate the X positions with averaged components.

  • wdY (array Nx1) – Filtered components ate the Y positions with averaged components.

Authors

Andreas P. Cuny - initial implementation

NonAssignedTracks

class +TracX.@NonAssignedTracks.NonAssignedTracks

Bases: handle

NONASSIGNEDTRACKS This class holds the minimal required information of the non assigned tracks after each round of tracking improvement evaluation.

Authors

Andreas P. Cuny - initial implementation

NonAssignedTracks()

NONASSIGNEDTRACKS Constructs a NonAssignedTracks object instance to keep teporary frame data during tracking.

Returns

obj – Returns NonAssignedTracks instance.

Return type

object

Authors

Andreas P. Cuny - initial implementation

addCell(this, data, varargin)

ADDCELL Adds a cell to TracX.NonAssignedTracks instance to keep teporary the data of non assigned tracks.

Parameters
  • this (object) – NonAssignedTracks instance.

  • data (array) – Data array in order of properties

  • varargin (array) – Optional input

Returns

Adds data to NonAssignedTracks directly.

Return type

void (-)

cell_area = '[]'

cell_area

cell_center_x = '[]'

cell_center_x

cell_center_y = '[]'

cell_center_y

cell_center_z = '[]'

cell_center_z

cell_filtered_dif_x = '[]'

cell_filtered_dif_x

cell_filtered_dif_y = '[]'

cell_filtered_dif_y

cell_filtered_dif_z = '[]'

cell_filtered_dif_z

cell_orientation = '[]'

cell_orientation

evaluateTrackAge(this)

EVALUTATETRACKAGE Evaluates track age and removes cell above maxTrackFrameSkipping threshold.

Parameters

this (object) – NonAssignedTracks instance.

Returns

Adds data to NonAssignedTracks directly.

Return type

void (-)

getCellStruct(this)

GETCELLSTRUCT Returns data as struct.

Parameters

this (object) – NonAssignedTracks instance.

Returns

Data from TracX.NonAssignedTracks as formated struct.

Return type

ret (struct)

increaseTrackAge(this)

INCREASETRACKAGE Increases track age by one.

Parameters

this (object) – NonAssignedTracks instance.

Returns

Acts on NonAssignedTracks directly

Return type

void (-)

maxTrackFrameSkipping = '[]'

ParameterConfigurationmaxTrackFrameSkipping

merge(~, structA, structB)

MERGE Merges two structs.

Parameters
  • ignoredArg (object) – NonAssignedTracks instance.

  • structA (struct) – Struct A

  • structB (struct) – Struct B

Returns

Merged data

Return type

merged (struct)

removeCell(this, track_index)

REMOVECELL Removes a cell from TracX.NonAssignedTracks instance.

Parameters
  • this (object) – NonAssignedTracks instance.

  • track_index (array) – Track indices of data to be removed

Returns

Removes data from NonAssignedTracks directly.

Return type

void (-)

setMaxTrackFrameSkipping(this, maxTrackFrameSkipping)

SETMAXTRACKFRAMESKIPPING Sets the max track frame skipping threshold.

Parameters
  • this (object) – NonAssignedTracks instance.

  • maxTrackFrameSkipping (int) – Max track frame skipping threshold

Returns

Acts on NonAssignedTracks directly

Return type

void (-)

track_age = '[]'

track_age

track_assignment_fraction = '[]'

track_assignment_fraction

track_fingerprint_real = '[]'

track_fingerprint_real

track_fingerprint_real_distance = '[]'

track_fingerprint_real_distance

track_index = '[]'

track_index

ProjectConfiguration

class +TracX.@ProjectConfiguration.ProjectConfiguration

Bases: handle

PROJECTCONFIGURATION This class creates an object containing all information required for a tracking an experiment such as path to image files, segmentation results and where to save tracking results for the Tracker. It tries to identify the number and type of image channels as well as well positions from the image filenames directly. The convention used is the following: ChannelID_WellPosition_ImageFrameNumber.FileType. Where as the ChannelID defines the different image modalities such as BrightField, Fluorescence channels such as e.g. GFP, YFP, PC (phase contrast) etc. WellPosition is 000000 if only one position was imaged or if a multi well experiment was performet it is based on well plate derived format in decimal system e.g. 030200 (e.g. C2; C = ‘03’ and 2 = ‘02’ and no z level = ‘00’). ImageFrameNumber is the number describing the image frame in a long term experiment. FileType is the file type used. Default is tiff. (YouScope naming convenction).

Authors

Andreas P. Cuny - initial implementation

ProjectConfiguration()

PROJECTCONFIGURATION Constructs an empty ProjectConfiguration object.

Returns

ProjectConfiguration instance

Return type

this (object)

addFluoImage(this, fluoImgFile)

ADDFLUOIMAGE Adds the fluo image identifier.

Parameters
  • this (object) – ProjectConfiguration instance.

  • fluoImgFile (str) – Fluorescence image file name.

Return type

void (-)

addFluoImageTag(this, fluoImgFile, tag)

ADDFLUOIMAGETAG Adds the fluorescence channel tags / identifiers to the array.

Parameters
  • this (object) – ProjectConfiguration instance.

  • fluoImgFile (str) – Fluorescence image file name.

  • tag (str) – Fluorescence image file name channel identifier.

Return type

void (-)

cellDivisionType = '-1'

Cell division type

checkProjectConfiguration(this)

CHECKPROJECTCONFIGURATION Checks if all values in the ProjectConfiguration object are defined.

Parameters

this (object) – ProjectConfiguration instance.

Return type

void (-)

controlPrefix = "'control'"

Prefix for segmentation control files.

createProjectConfiguration(this, projectName, imageDir, segmentationResultDir, fileIdentifierFingerprintImages, fileIdentifierWellPositionFingerprint, fileIdentifierCellLineage, imageCropCoordinateArray, varargin)

CREATEPROJECTCONFIGURATION creates a ProjectConfiguration object for a given TracX project

Parameters
  • this (object) – ProjectConfiguration instance.

  • projectName (str) – Name of project/experiment.

  • imageDir (str) – Image directory to be used in the current project.

  • segmentationResultDir (str) – Directory containing the segmentation results for the current project.

  • fileIdentifierFingerprintImages (str) – File name identifier for raw Brightfield images.

  • fileIdentifierWellPositionFingerprint (str) – File name identifier specifing the well position (of a multi well experiment).

  • fileIdentifierCellLineage (str) – File name identifier of the fluorescent channel images to be used to reconstruct the cell lineage (i.e. bud neck marker)

  • imageCropCoordinateArray (array, 1x4) – Array with crop coordinates used during segmentation.

  • varargin (str varchar) –

    • nFramesToImport (int): Number of frames to import.

    • setCellDivisionType (str): Type of cell division.

Note

The images used for fingerprinting (image filenames) can be specified explicitly (full path) and do not need to reside within the segmentation results dir.

Returns

ProjectConfiguration instance with all the information needed for tracking.

Return type

this (object)

ensureResultsDirExists(this)

ENSURERESULTSDIREXISTS Tests if project result dir exists. If not it creates the directory.

Parameters

this (object) – ProjectConfiguration instance.

Return type

void (-)

fluoFileArray = '{}'

Array of all fluorescent image file names

fluoImageIdentifier = '{}'

Identifiers for fluorescence images (e.g. gfp, yfp).

fluoLineageFileArray = '{}'

Array of all fluorescent image file names needed to reconstruct the cell lineage

fontSize = '14'

Default fontsize for plotting.

getControlImageFormat(this)

GETCONTROLIMAGEFORMAT Returns the image file format of the segmentation control images.

Parameters

this (object) – ProjectConfiguration instance.

Returns

Retunrs the image format.

Return type

fmt (str)

getFluoID(this, fluoIdx)

GETFLUOID Returns the fluorescence channel identifier at the given index.

Parameters
  • this (object) – ProjectConfiguration instance

  • idx (int) – Index of fluorescence channel in this experiment.

Returns

Name of fluorescence channel at fluoIdx position.

Return type

fluoID (str)

getFluoImage(this, idx)

GETFLUOIMAGE Returns the folorescence image at the given index.

Parameters
  • this (object) – ProjectConfiguration instance.

  • idx (int) – Index of a fuorescence image in the fluoFileArray array.

Returns

Returns the fluorescence image name at idx.

Return type

iFluoImage (str)

getNumberOfFluoImages(this)

GETNUMBEROFFLUOIMAGES Returns the number of fluorescence channels.

Parameters

this (object) – ProjectConfiguration instance

Returns

Number of fluorescence channels in thisexperiment.

Return type

nfluoImageIdentifier (int)

imageBitDepth = '[]'

Image bit depth

imageCropCoordinateArray = '[]'

Array with crop coordinates used during segmentation. Needed to map segmentation cell centers to correct position within the raw images (for CellX segmentation data).

imageCropCoordinatePriorReversionArray = '[]'

Array with crop coordinates used during segmentation as given previous to reversion mapping to raw data size.

imageDepth = '[]'

Image number of Z planes

imageDir = None

Image directory to be used in the current project.

imageFileArray = '{}'

Array of all image file names

imageFileFormat = "'tif'"

Default imageFileFormat for image and mask import / export.

imageFingerprintFileArray = '{}'

Array of (ideally) out-of-focus Brigthfield image file names to be used to compute unique fingerprints. In fact any channel can be used.

imageFrameNumberArray = '{}'

All image frame numbers of the experiment identifying each existing timepoint.

imageHeight = '[]'

Image height

imageMaxSampleValue = '[]'

Image max sample value

imageMinSampleValue = '[]'

Image min sample value

imagePositionArray = '{}'

All experiment positions (based on well plate derived format in decimal system e.g. 0302 (C = ‘03’ and 2 = ‘02’) C2.

imagePrefixArray = '{}'

All image prefixes of the experiment.

imageWidth = '[]'

Image width

maskPrefix = "'mask'"

Prefix for segmentation mask files.

nFramesToImport = '[]'

Number of frames to import. If for e.g. not all files should be tracked.

projectName = None

Name of ccurrent project (i.e. experiment name).

segmentationControlFileArray = '{}'

Array of all segmentation control image file names

segmentationResultDir = None

Directory containing the segmentation results for the current project. Images in imageDir have to be segmented with e.g. CellX prior to tracking.

segmentationResultFileArray = '{}'

Array of all segmentation result text file names

segmentationResultMaskFileArray = '{}'

Array of all segmentation result mask file names

segmentationResultMatFileArray = '{}'

Array of all segmentation result mat file names

setCellDivisionType(this, cellDivisionType)

SETCELLDIVISIONTYPE Sets the cell division type for the given TracX project. Symmetrical division is denoted as 0 where as asymmetrical division with 1.

Parameters
Return type

void (-)

setControlPrefix(this, controlPrefix)

SETCONTROLPREFIX Sets control output filename prefix

Parameters
  • this (object) – ProjectConfiguration instance.

  • controlPrefix (str) – Control file name prefix.

Return type

void (-)

setFingerprintImageNames(this, fileIdentFingerprintImages, fileIdentWellPosFingerPrint)

SETFINGERPRINTIMAGENAMES Sets the image file names used for the fingerprint computation.

Parameters
  • this (object) – ProjectConfiguration instance.

  • fileIdentFingerprintImages (str) – File name identifier of images to be used for fingerprint computation

  • fileIdentWellPosFingerPrint (str) – File name identifier of images to be used for fingerprint computation specifing the position

Return type

void (-)

setFluoFileArray(this, array)

SETFLUOFILEARRAY Sets the fluorescence image array.

Parameters
  • this (object) – ProjectConfiguration instance.

  • array (str) – Array of fluorescence image file names.

Return type

void (-)

setFluoImageIdentifier(this, tag)

SETFLUOIMAGEIDENTIFIER Sets the fluorescence channel tags / identifiers to the array.

Parameters
  • this (object) – ProjectConfiguration instance.

  • tag (str) – Fluorescence image file name channel identifier.

Return type

void (-)

setFluoLineageFileArray(this, fileIdentifierCellLineage, fileIdentWellPos)

SETFLUOLINEAGEFILEARRAY Sets the fluorescence image files used for mother-daughter relationship detection.

Parameters
  • this (object) – ProjectConfiguration instance.

  • fileIdentifierCellLineage (str) – File name prefix/ identifier cell lineage.

  • fileIdentWellPos (str) – File name prefix/ identifier position.

Return type

void (-)

setFontSize(this, fontSize)

SETFONTSIZE Sets label font size

Parameters
Return type

void (-)

setImageBitDepth(this, val)

SETIMAGEBITDEPTH Sets the image bit depth.

Parameters
Return type

void (-)

setImageCropCoordinateArray(this, crop)

SETIMAGECROPCOORDINATEARRAY Sets the segmentation image crop coordinates in case not the entire image frame was segmented.

Parameters
  • this (object) – ProjectConfiguration instance.

  • crop (array, 1x4) – Segmentation crop array [x, y, width, height].

Return type

void (-)

setImageCropCoordinatePriorReversionArray(this, crop)

SETIMAGECROPCOORDINATEPRIORREVERSIONARRAY Sets the segmentation image crop coordinates in case not the entire image frame was segmented and the reversion was applied to map them back to the raw data size.

Parameters
  • this (object) – ProjectConfiguration instance.

  • crop (array, 1x4) – Segmentation crop array [x, y, width, height].

Return type

void (-)

setImageDepth(this, val)

SETIMAGEDEPHT Sets the image depth (number of z planes).

Parameters
Return type

void (-)

setImageDir(this, path)

SETIMAGEDIR Sets the directory to all the images of the TracX project.

Parameters
Return type

void (-)

setImageFileArray(this, varargin)

SETIMAGEFILEARRAY Sets all the image names

Parameters
  • this (object) – ProjectConfiguration instance.

  • varargin (array) – Optional array with image filenames.

Return type

void (-)

setImageFileFormat(this, imageFileFormat)

SETIMAGEFILEFORMAT Sets the image file format.

Parameters
  • this (object) – ProjectConfiguration instance.

  • imageFileFormat (str) – Image file format. Defaults to ‘tif’

Return type

void (-)

setImageFingerprintFileArray(this, fileNames)

SETIMAGEFINGERPRINTFILEARRAY Sets all the image names to be used for fingerprint computation.

Parameters
Return type

void (-)

setImageFrameNumberArray(this, frameArray)

SETIMAGEFRAMENUMBERARRAY Sets all the image frame numbers. According to the file name convention: ChannelID_WellPosition_ImageFrameNumber.FileType

Parameters
Return type

void (-)

setImageHeight(this, val)

SETIMAGEHEIGHT Sets the image height.

Parameters
Return type

void (-)

setImageIdentifiers(this)

SETIMAGEIDENTIFIERS Sets all the image identifiers. The convention is ChannelID_WellPosition_ImageFrameNumber.FileType.

Parameters

this (object) – ProjectConfiguration instance

setImageMaxSampleValue(this, val)

SETIMAGEMAXSAMPLEVALUE Sets the image max sample value.

Parameters
Return type

void (-)

setImageMinSampleValue(this, val)

SETIMAGEMINSAMPLEVALUE Sets the image min sample value.

Parameters
Return type

void (-)

setImagePositionArray(this, pos)

SETIMAGEPOSITIONARRAY Sets the image position array of multi well experiments.

Parameters
Return type

void (-)

setImagePrefixArray(this, prefixArray)

SETIMAGEPREFIXARRAY Sets all the image prefixes. According to the file name convention: ChannelID_WellPosition_ImageFrameNumber.FileType

Parameters
Return type

void (-)

setImageProperties(this)

SETIMAGEPROPERTIES Sets the image properties such as bit depth, image height and width and min/max sample value.

Parameters

this (object) – ProjectConfiguration instance.

Return type

void (-)

setImageWidth(this, val)

SETIMAGEWIDTH Sets the image width.

Parameters
Return type

void (-)

setMaskPrefix(this, maskPrefix)

SETMASKPREFIX Sets mask output filename prefix

Parameters
Return type

void (-)

setMatFileNames(this)

SETMATFILEMANES Sets all the mat file names.

Parameters

this (object) – ProjectConfiguration instance.

Return type

void (-)

setNFramesToImport(this, nFrames)

SETNFRAMESTOIMPORT Sets max nr of image frames to import.

Parameters
  • this (object) – ProjectConfiguration instance.

  • nFrames (int) – Max image frame number to import.

Return type

void (-)

setProjectName(this, projectName)

SETPROJECTNAME Sets the directory to all the images of the TracX project.

Parameters
  • this (object) – ProjectConfiguration instance.

  • projectName (str) – Name of project/experiment.

Return type

void (-)

setSegmentationControlFileArray(this, varargin)

SETSEGMENTATIONCONTROLFILEARRAY Sets all the segmentation control files.

Parameters
  • this (object) – ProjectConfiguration instance.

  • varargin (array,) – Array with control filenames.

Return type

void (-)

setSegmentationFiles(this)

SETSEGMENTATIONFILES Sets all the segmentation file names in .txt format (based on CellX segmentation software output)

Parameters

this (object) – ProjectConfiguration instance.

Return type

void (-)

setSegmentationResultDir(this, path)

SETSEGMENTATIONRESULTDIR Sets the directory to all the segmentation results of the TracX project.

Parameters
Return type

void (-)

setSegmentationResultFileArray(this, fileNames)

SETSEGMENTATIONRESULTFILEARRAY Sets all the text file names of the segmentation results.

Parameters
Return type

void (-)

setSegmentationResultMaskFileArray(this, varargin)

SETSEGMENTATIONRESULTMASKFILEARRAY Sets all the segmentation mask file names.

Parameters
Return type

void (-)

setSegmentationResultMatFileArray(this, fileNames)

SETSEGMENTATIONRESULTMATFILEARRAY Sets all the mat file names of the segmentation results.

Parameters
Return type

void (-)

setTrackerEndFrame(this, f)

SETTRACKERENDFRAME Sets the end frame of the current tracking project.

Parameters
Return type

void (-)

setTrackerPrefix(this, trackerPrefix)

SETTRACKERPREFIX Sets tracker output filename prefix

Parameters
  • this (object) – ProjectConfiguration instance.

  • trackerPrefix (str) – Tracker output file name prefix.

Return type

void (-)

setTrackerResultMaskFileArray(this, varargin)

SETTRACKERRESULTMASKFILEARRAY Sets all the tracker mask file names.

Parameters
  • this (object) – ProjectConfiguration instance.

  • varargin (array,) – Array with tracker mask filenames.

Return type

void (-)

setTrackerResultsDirectory(this, path)

SETTRACKERRESULTSDIRECTORY Sets the tracker results directory.

Parameters
Return type

void (-)

setTrackerStartFrame(this, f)

SETTRACKERSTARTFRAME Sets the end frame of the current tracking project.

Parameters
Return type

void (-)

trackerEndFrame = '[]'

End frame number where the tracker should terminate.

trackerPrefix = "'tracked'"

Prefix for tracking outputs.

trackerResultMaskFileArray = '{}'

Array of all tracking result mask file names (relabeled segmentation masks [i.e cell_index -> track_index]).

trackerResultsDir = '[]'

The directory where the tracking results should be saved.

trackerStartFrame = '[]'

Starting frame number of where the tracker should start.

ParameterConfiguration

class +TracX.@ParameterConfiguration.ParameterConfiguration

Bases: handle, matlab.mixin.CustomDisplay

PARAMETERCONFIGURATION This class creates an object containing all the parameters for the Tracker. The class can create and read a Tracer parameter XML file to automize the tracking process.

Authors

Andreas P. Cuny - initial implementation

active3DFingerprint = '0'

> is 3D fingerprint used or closest z stack method > optional param

averageCellSizeGrowth = '0.03'

> Fractional cell size growth > (Tracker core) > > Average fractional growth of an identical segmented object between > two subsequent image frames (i.e. cell area or nuclear area) > general param

cellThumbSideLength = '100'

> Thumbnail side length around the center of a segmented object > (i.e a cell) [px] > (Tracker output generation) > > Used for example to cut out all cells contained in a single track > from all image frames for visualization; > optional param

checkParameterConfiguration(this)

CHECKPARAMETERCONFIGURATION Checks if all values in the ParameterConfiguration object are defined.

Parameters

this (object) – ParameterConfiguration instance

Return type

void -

data3D = '0'

> is data 2D (0) or 3D (1)? > optional param

debugLevel = '1'

> Parameter defining the debug level [0,1,2] > (Tracker core) > > Parameter defining the debug level. Level 0 shows no output. > level 1 shows general information (info mode) level 2 shows > additional debug info (debug mode). > advanced param

divisionMarkerAverageObjSizeGrowth = '0.03'

> Fractional marker size growth > (Lineage reconstruction) > > Average fractionalgrowth of an identical segmented object between > two subsequent image frames (i.e. cell area or nuclear area) > optional param

divisionMarkerConvexAreaLowerThresh = '5'

> Convex area lower threshold for division marker segmentation. > (Lineage reconstruction) > > Convex area lower threshold used for division marker segmentation > selection to exclude segmentation artefacts. Only segmented > marker object larger than this treshold are used for the mother > daughter assignment. > optional param

divisionMarkerConvexAreaUpperThresh = '100'

> Convex area upper threshold for division marker segmentation. > (Lineage reconstruction) > > Convex area upper threshold used for division marker segmentation > selection to exclude segmentation artefacts. Only segmented > marker object smaller than this treshold are used for the mother > daughter assignment. > optional param

divisionMarkerDenoising = '25'

> ROF denoising parameter theta for division marker. > (Lineage reconstruction) > > ROF de-noising parameter theta used for de-noising fluorescent > images. > optional param

divisionMarkerEdgeSensitivityThresh = '0.3'

> Edge sensitivity threshold for division marker segmentation > [0-1] > (Lineage reconstruction) > > Edge sensitivity threshold for division marker segmentation > optional param

divisionMarkerFingerprintHalfWindowSideLength = '25'

> Half window side length of a square around the centroid > coordinates of a segmented object to be used to for fingerprint > computation [px] > (Lineage reconstruction) > > optional param

divisionMarkerFingerprintMaxConsideredFrequencies = '8'

> Number of DCT frequencies to include for fingerprint computation > (Lineage reconstruction) > > Number of DCT frequencies to include for fingerprint computation; > optional param

divisionMarkerFingerprintResizeFactor = '32'

> Resize factor for fingerprint calculation > (Lineage reconstruction) > > Resize factor applied to image matrix before fingerprint > calculation; > optional param

divisionMarkerIndividualFunctionPenalty = '500'

> Individual function penalty > (Lineage reconstruction) > > Individual penalty maximum for each cost function (e.g. for > position, area, rotation, frame skipping); > optional param

divisionMarkerLineProfileLength = '100'

> Line profile length. > (Lineage reconstruction) > > Maximum length the line profile between two cell centers are > resampled to. Used to be able to compare the profiles. > optional param

divisionMarkerLineProfilePeakLowerBound = '10'

> Line profile peak lower bound. > (Lineage reconstruction) > > Lower bound where a peak on line profile between two cell > centers is still accepted. Used as threshold. > optional param

divisionMarkerLineProfilePeakUpperBound = '90'

> Line profile peak upper bound. > (Lineage reconstruction) > > Upper bound where a peak on line profile between two cell > centers is still accepted. Used as threshold. > optional param

divisionMarkerMaxExpectedMovement = '75'

> Max expected (linear) movement [px] > (Lineage reconstruction) > > Max expected (linear) movement of one or multiple segmented > objects as i.e colony jump in pixel (depends on pixel > size and magnification). By default it is 2.5 > times the average cell diameter but depends on the actual > largest movement. > optional param

divisionMarkerMaxMajorAxisRotation = '0'

> Major axis rotation [degrees] > (Lineage reconstruction) > > Max allowed major axis rotation (for round objects such as > S.cerevisiae cells the penalty is not telling and should be set > to 0. The paramater might be important for S.pombe (rod shaped) > where the majoraxis is clearly defined); > optional param

divisionMarkerMaxObjCenterDisplacement = '15'

> Max displacement allowed [px] > (Lineage reconstruction) > > Max displacement of segmented objects in pixel (depends on pixel > size and magnification) allowed in any direction for subsequent > image frames. > optional param

divisionMarkerMaxObjSizeDecrease = '0.75'

> Max allowed fractional marker size decrease > (Lineage reconstruction) > > Penalty for maximum fractional segmented object size decrease for > subsequent image frames; > optional param

divisionMarkerMaxObjSizeIncrease = '2.5'

> Max allowed fractional marker size increase > (Lineage reconstruction) > > Penalty for maximum fractional segmented object size increase for > subsequent image frames; > optional param

divisionMarkerMaxTrackFrameSkipping = '2'

> Max number of frames where a segmented object is allowed to be > missing from a track (miss segmentation, out of focus, etc) > [image frames] > (Lineage reconstruction) > > The number of frames where a segmented object is not present; > optional param

divisionMarkerMeanObjDiameter = '30'

> Mean cell diameter of all segmented objects in > the experiment [px]. > (Lineage reconstruction) > > Mean cell diameter of all segmented objects of all image frames > of the whole experiment; > optional param

divisionMarkerMeanObjDiameterScalingFactor = '2.5'

> Mean cell diameter scaling factor. > (Lineage reconstruction) > > Mean cell diameter scaling factor to scale the max allowed linear > motion of cells in respect to the mean cell diameter. > optional param

divisionMarkerNeighbourhoodSearchRadius = '40'

> Radius around a centroid cooridnates of a segmented object used > to detect the neighbouring cells [px] > (Lineage reconstruction) > > All centroid cooridnates of segmented objects within the > neighbourhoodSearchRadius are counted as neigbours of a selected > segmented object; > optional param

divisionMarkerRadiusVectorFilterX = '100'

> Radius equals the first standard deviation of a 2D gaussion > distribution around a cell center in X [px]. > (Lineage reconstruction) > > The radius is used calculate the neighbourhood weighted cell > center displacement in X. The larger the radius, the more more > neighbours are used for weighting the vector component; > optional param

divisionMarkerRadiusVectorFilterY = '100'

> Radius equals the first standard deviation of a 2D gaussion > distribution around a cell center in Y [px]. > (Lineage reconstruction) > > The radius is used calculate the neighbourhood weighted cell > center displacement in Y. The larger the radius, the more more > neighbours are used for weighting the vector component; > optional param

divisionMarkerRadiusVectorFilterZ = '100'

> Radius equals the first standard deviation of a 2D gaussion > distribution around a cell center in Z [px]. > (Lineage reconstruction) > > The radius is used calculate the neighbourhood weighted cell > center displacement in Z. The larger the radius, the more more > neighbours are used for weighting the vector component; > optional param

divisionMarkerUsedFunctionsForCostMatrix = '[1,1,0,1]'

> Logical array to select which of the four cost functions > should be used to build the final cost matrix. [boolean] > (Lineage reconstruction) > > Array specifying which cost functions to consider to build > final cost matrix; > optional param

fingerprintDistThreshold = '0'

> Fingerprint distance threshhold [a.u.] > (Tracker core) > > Fingerprint distance threshold below which two fingerprints are > considered to be identical. A fingerprint is computed by a > window around the center of a segmented object on an image > frame. Assignments between two objects with a fingerprint > distance above this threshold are deleted; > general param

fingerprintHalfWindowSideLength = '25'

> Half window side length of a square around the centroid > coordinates of a segmented object to be used to for fingerprint > computation [px]. > (Tracker core) > > general param

fingerprintMaxConsideredFrequencies = '8'

> Number of DCT frequencies to include for fingerprint computation > (Tracker core) > > Number of DCT frequencies to include for fingerprint computation; > advanced param

fingerprintResizeFactor = '32'

> Resize factor for fingerprint calculation > (Tracker core) > > Resize factor applied to image matrix before fingerprint > calculation; > general param

individualFunctionPenalty = '500'

> Individual function penalty > (Tracker core) > > Individual penalty maximum for each cost function (e.g. for > position, area, rotation, frame skipping); > general param

major = '1'

Current latest version major of TracX.

maskOverlayAlpha = '0.4'

> Trasparency (alpha) level for segmentation mask overlay on raw > images [0-1] > (Tracker output generation) > > Transparency (alpha) level for segmentation mask overlay on raw > images for visualization; > optional param

maxCellCenterDisplacement = '15'

> Max displacement allowed [px] > (Tracker core) > > Max displacement of segmented objects in pixel (depends on pixel > size and magnification) allowed in any direction for subsequent > image frames. > general param

maxCellSizeDecrease = '0.75'

> Max allowed fractional cell size decrease > (Tracker core) > > Penalty for maximum fractional segmented object size decrease for > subsequent image frames; > general param

maxCellSizeIncrease = '2.5'

> Max allowed fractional cell size increase > (Tracker core) > > Penalty for maximum fractional segmented object size increase for > subsequent image frames; > general param

maxExpectedMovement = '75'

> Max expected (linear) movement [px] > (Tracker core) > > Max expected (linear) movement of one or multiple segmented > objects as i.e colony jump in pixel (depends on pixel > size and magnification). By default it is 2.5 > times the average cell diameter but depends on the actual > largest movement.

maxMajorAxisRotation = '0'

> Major axis rotation [degrees] > (Tracker core) > > Max allowed major axis rotation (for round objects such as > S.cerevisiae cells the penalty is not telling and should be set > to 0. The paramater might be important for S.pombe (rod shaped) > where the majoraxis is clearly defined); > general param

maxTrackFrameSkipping = '2'

> Max number of frames where a segmented object is allowed to be > missing from a track (miss segmentation, out of focus, etc) > [image frames] > (Tracker core) > > The number of frames where a segmented object is not present; > general param

meanCellDiameter = '30'

> Mean cell diameter of all segmented objects in > the experiment [px]. > (Tracker core) > > Mean cell diameter of all segmented objects of all image frames > of the whole experiment; > general param

meanCellDiameterScalingFactor = '2.5'

> Mean cell diameter scaling factor. > (Tracker core) > > Mean cell diameter scaling factor to scale the max allowed linear > motion of cells in respect to the mean cell diameter. > general param

minor = '0'

Current latest version minor of TracX.

neighbourhoodSearchRadius = '40'

> Radius around a centroid cooridnates of a segmented object used > to detect the neighbouring cells [px] > (Tracker core, Lineage reconstruction) > > All centroid cooridnates of segmented objects within the > neighbourhoodSearchRadius are counted as neigbours of a selected > segmented object; > general param

patch = '0'

Current latest version patch of TracX.

pixelsPerZPlaneInterval = '1'

> The number of pixels that one Z-stack interval is equal to > (Tracker core) > > Number of pixels per Z-stack interval / step. > optional param

radiusVectorFilterX = '100'

> Radius equals the first standard deviation of a 2D gaussion > distribution around a cell center in X [px]. > (Tracker core) > > The radius is used calculate the neighbourhood weighted cell > center displacement in X. The larger the radius, the more more > neighbours are used for weighting the vector component; > general param

radiusVectorFilterY = '100'

> Radius equals the first standard deviation of a 2D gaussion > distribution around a cell center in Y [px]. > (Tracker core) > > The radius is used calculate the neighbourhood weighted cell > center displacement in Y. The larger the radius, the more more > neighbours are used for weighting the vector component; > general param

radiusVectorFilterZ = '100'

> Radius equals the first standard deviation of a 2D gaussion > distribution around a cell center in Z [px]. > (Tracker core) > > The radius is used calculate the neighbourhood weighted cell > center displacement in Z. The larger the radius, the more more > neighbours are used for weighting the vector component; > general param

setActive3DFingerprint(this, value)

SETACTIVE3DFINGERPRINT Sets value if 3D fingerprint should be activated.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (bool) – Value if 3D fingerprint should be activated.

Return type

void (-)

setAverageCellSizeGrowth(this, value)

SETAVERAGECELLSIZEGROWTH Sets value for max allowed fractional cell size growth (of the segmented object).

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float) – Sets value for max allowed fractional cell size growth (of the segmented object).

Return type

void (-)

setCellThumbSideLength(this, value)

SETCELLTHUMBSIDELENGTH Sets value for the side length of the image crop around the cell center for single cell trace generation [px].

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (int) – Value for the side length of the image crop around the cell center for single cell trace generation [px].

Return type

void (-)

setData3D(this, value)

SETDATA3D Sets value if data is three dimensional.

Parameters
Return type

void (-)

setDebugLevel(this, value)

SETDEBUGLEVEL Sets value for the debug level.

Parameters
Return type

void (-)

setDivisionMarkerAverageObjSizeGrowth(this, value)

SETDIVISIONMARKERAVERAGEOBJSIZEGROWTH Sets value for the divisison marker max object size growth.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float) – Value for the divisison marker average object size growth.

Return type

void (-)

setDivisionMarkerConvexAreaLowerThresh(this, value)

SETDIVISIONMARKERCONVEXAREALOWERTHRESH Sets value for the convex area lower thrshold for division marker segmentation.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float) – Value for the convex area lower threshold for division marker segmentation

Return type

void (-)

setDivisionMarkerConvexAreaUpperThresh(this, value)

SETDIVISIONMARKERCONVEXAREAUPPERTHRESH Sets value for the convex area upper thrshold for division marker segmentation.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float) – Value for the convex area upper threshold for division marker segmentation

Return type

void (-)

setDivisionMarkerDenoising(this, value)

SETDIVISIONMARKERCONVEXAREAUPPERTHRESH Sets value for the ROF denoising parameter theta for division marker.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float) – Value for the ROF denoising parameter theta for division marker.

Return type

void (-)

setDivisionMarkerEdgeSensitivityThresh(this, value)

SETDIVISIONMARKEREDGESENSITIVITYTHRESH Sets value for the edge sensitivity threshold for division marker segmentation [0-1]

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float, 0-1) – Value for the edge sensitivity threshold for division marker segmentation

Return type

void (-)

setDivisionMarkerFingerprintHalfWindowSideLength(this, value)

SETDIVISIONMARKERFINGERPRINTHALFWINDOWSIDELENGTH Sets value for the divisison half window side length.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (int) – Value for the divisison marker fingerprint half window side length.

Return type

void (-)

setDivisionMarkerFingerprintMaxConsideredFrequencies(this, value)

SETDIVISIONMARKERFINGERPRINTMAXCONSIDEREDFREQUENCIES Sets value for the divisison marker fingerprint max considered frequencies.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (int) – Value for the divisison marker fingerprint max considered frequencies.

Return type

void (-)

setDivisionMarkerFingerprintResizeFactor(this, value)

SETDIVISIONMARKERFINGERPRINTRESIZEFACTOR Sets value for the divisison marker fingerprint resize factor.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (int) – Value for the divisison marker fingerprint resize factor.

Return type

void (-)

setDivisionMarkerIndividualFunctionPenalty(this, value)

SETDIVISIONMARKERINDIVIDUALFUNCTIONPENALTY Sets value for the divisison marker individual function penalty.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (int) – Value for the divisison marker individual function penalty.

Return type

void (-)

setDivisionMarkerLineProfileLength(this, value)

SETDIVISIONMARKERLINEPROFILEPEAKUPPERBOUND Sets value for the line profile length for line profile comparison for different cell pairs.

Parameters
Return type

void (-)

setDivisionMarkerLineProfilePeakLowerBound(this, value)

SETDIVISIONMARKERLINEPROFILEPEAKLOWERBOUND Sets value for the line profile peak lower bound for thresholding the detecatble peak region.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (int) – Value for the line profile peak lower bound

Return type

void (-)

setDivisionMarkerLineProfilePeakUpperBound(this, value)

SETDIVISIONMARKERLINEPROFILEPEAKUPPERBOUND Sets value for the line profile peak upper bound for thresholding the detecatble peak region.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (int) – Value for the line profile peak upper bound

Return type

void (-)

setDivisionMarkerMaxExpectedMovement(this, value)

SETDIVISIONMARKERMAXEXPECTEDMOVEMENT Sets value for the divisison marker max object moviement.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float) – Value for the divisison marker max object moviement.

Return type

void (-)

setDivisionMarkerMaxMajorAxisRotation(this, value)

SETDIVISIONMARKERMAXMAJORAXISROTATION Sets value for the divisison marker max major axis rotation.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float) – Value for the divisison marker max major axis rotation.

Return type

void (-)

setDivisionMarkerMaxObjCenterDisplacement(this, value)

SETDIVISIONMARKERMAXOBJCENTERDISPLACEMENT Sets value for the divisison marker max object center displacement.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float) – Value for the divisison marker max object center displacement.

Return type

void (-)

setDivisionMarkerMaxObjSizeDecrease(this, value)

SETDIVISIONMARKERMAXOBJSIZEDECREASE Sets value for the divisison marker max object size decrease.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float) – Value for the divisison marker max object size decrease.

Return type

void (-)

setDivisionMarkerMaxObjSizeIncrease(this, value)

SETDIVISIONMARKERMAXOBJSIZEINCREASE Sets value for the divisison marker max object size increase.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float) – Value for the divisison marker max object size increase.

Return type

void (-)

setDivisionMarkerMaxTrackFrameSkipping(this, value)

SETDIVISIONMARKERMAXTRACKFRAMESKIPPING Sets value for the divisison marker max track frame skipping.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (int) – Value for the divisison marker max track frame skipping.

Return type

void (-)

setDivisionMarkerMeanObjDiameter(this, value)

SETDIVISIONMARKERMEANOBJDIAMETER Sets value for the divisison marker mean object diameter.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float) – Value for the divisison marker mean object diameter

Return type

void (-)

setDivisionMarkerMeanObjDiameterScalingFactor(this, value)

SETDIVISIONMARKERMEANOBJDIAMETERSCALINGFACTOR Sets value for the divisison marker mean object scaling factor.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float) – Value for the divisison marker mean object scaling factor

Return type

void (-)

setDivisionMarkerNeighbourhoodSearchRadius(this, value)

SETDIVISIONMARKERNEIGHBOURHOODSEARCHRADIUS Sets value for the divisison marker neighbourhood search radius.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (int) – Value for the divisison marker neighbourhood search radius.

Return type

void (-)

setDivisionMarkerRadiusVectorFilterX(this, value)

SETDIVISIONMARKERRADIUSVECTORFILTERX Sets value for the divisison marker radius vector filter x.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (int) – Value for the divisison marker radius vector filter x.

Return type

void (-)

setDivisionMarkerRadiusVectorFilterY(this, value)

SETDIVISIONMARKERRADIUSVECTORFILTERY Sets value for the divisison marker radius vector filter y.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (int) – Value for the divisison marker radius vector filter y.

Return type

void (-)

setDivisionMarkerRadiusVectorFilterZ(this, value)

SETDIVISIONMARKERRADIUSVECTORFILTERZ Sets value for the divisison marker radius vector filter z.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (int) – Value for the divisison marker radius vector filter z.

Return type

void (-)

setDivisionMarkerUsedFunctionsForCostMatrix(this, value)

SETDIVISIONMARKERUSEDFUNCTIONSFORCOSTMATRIX Sets value for the divisison marker used functions for cost matrix.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (int) – Value for the divisison marker used functions for cost matrix.

Return type

void (-)

setFingerprintDistThreshold(this, value)

SETFINGERPRINTDISTTHRESHOLD Sets value for the fingerprint distance threshold.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float) – Value for the fingerprint distance threshold.

Return type

void (-)

setFingerprintHalfWindowSideLength(this, value)

SETFINGERPRINTHALFWINDOWSIDELENGTH Sets value for the half window side length of a square around the centroid coordinates of a segmented cell to be used to for fingerprint computation [px].

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (int) – Value for the half window side length of the cell center.

Return type

void (-)

setFingerprintMaxConsideredFrequencies(this, value)

SETFINGERPRINTMAXCONSIDEREDFREQUENCIES Sets value for the maximal DCT frequency to be used to calculate the fingerprint.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (int) – Value for the maximal DCT frequency to be used to calculate the fingerprint.

Return type

void (-)

setFingerprintResizeFactor(this, value)

SETFINGERPRINTRESIZEFACTOR Sets value for the image resizing for fingerprint calculation Default is 32.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (int) – Value for the image resizing for fingerprint calculation Default is 32.

Return type

void (-)

setIndividualFunctionPenalty(this, value)

SETINDIVIDUALFUNCTIONPENALTY Sets value for all individaul function penalty

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (int) – Sets value for all individaul function penalty

Return type

void (-)

setMaskOverlayAlpha(this, value)

SETMASKOVERLAYALPHA Sets value for the transparency (alpha) level of the segmentation mask overlay onto the raw images [0-1].

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float, 0-1) – Value for the transparency (alpha) level of the segmentation mask overlay onto the raw images.

Return type

void (-)

setMaxCellCenterDisplacement(this, value)

SETMAXEXPECTEDMOVEMENT Sets value for max allowed segmentation object centroid displacement [pixel].

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float) – Sets value for max allowed segmentation object centroid displacement [pixel].

Return type

void (-)

setMaxCellSizeDecrease(this, value)

SETMAXCELLSIZEDECREASE Sets value for max allowed fractional cell size decrease due to segmenation variation (e.g. miss segmentation, focus drift of the segmented object).

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float) – Sets value for max allowed fractional cell size decrease due to segmenation variation.

Return type

void (-)

setMaxCellSizeIncrease(this, value)

SETMAXCELLSIZEINCREASE Sets value for max allowed fractional cell size increase due to segmenation variation (e.g. miss segmentation, focus drift of the segmented object).

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float) – Sets value for max allowed fractional cell size increase due to segmenation variation.

Return type

void (-)

setMaxExpectedMovement(this, value)

SETMAXEXPECTEDMOVEMENT Sets value for max expected movement of a / multiple segmentation object(s) [pixel].

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float) – Sets value for max expected movement of a / multiple segmentation object(s) [pixel].

Return type

void (-)

setMaxMajorAxisRotation(this, value)

SETMAXMAJORAXISROTATION Sets value for majoraxis rotation penalty [degrees].

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float) – Sets value for majoraxis rotation penalty [degrees].

Return type

void (-)

setMaxTrackFrameSkipping(this, value)

SETMAXTRACKFRAMESKIPPING Sets value for max allowed frame skip.

Parameters
Return type

void (-)

setMeanCellDiameter(this, value)

SETMEANCELLDIAMETER Sets value for the mean segmentation object (cell) diameter of the experiment in pixel [px].

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float) – Value for mean segmentation object (cell) diameter of the experiment in pixel [px].

Return type

void (-)

setMeanCellDiameterScalingFactor(this, value)

SETFINGERPRINTHALFWINDOWSIDELENGTH Sets the mean cell diameter scaling factor.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float) – Value for mean cell diameter scaling factor.

Return type

void (-)

setNeighbourhoodSearchRadius(this, value)

SETNEIGHBOURHOODSEARCHRADIUS Sets value for the neigbourhood half window side length [px].

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (int) – Value for the neigbourhood half window side length [px].

Return type

void (-)

setPixelsPerZPlaneInterval(this, value)

SETPIXELSPERZPLANEINTERVAL Sets value for pixels per Z plane interval / step.

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (float) – Value for pixels per Z plane interval / step.

Return type

void (-)

setRadiusVectorFilterX(this, value)

SETRADIUSVECTORFILTERX Sets value for the radius of the vector filter in x [px].

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (int) – Value for the radius of the vector filter in x [px].

Return type

void (-)

setRadiusVectorFilterY(this, value)

SETRADIUSVECTORFILTERY Sets value for the radius of the vector filter in z [px].

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (int) – Value for the radius of the vector filter in y [px].

Return type

void (-)

setRadiusVectorFilterZ(this, value)

SETRADIUSVECTORFILTERZ Sets value for the radius of the vector filter in z [px].

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (int) – Value for the radius of the vector filter in z [px].

Return type

void (-)

setUsedFunctionsForCostMatrix(this, value)

SETUSEDFUNCTIONSFORCOSTMATRIX Sets value for the selection of which of the four cost functions should be used to build the final cost matrix. 1x4 array [boolean]

Parameters
  • this (object) – ParameterConfiguration instance.

  • value (array, 1x4) – Sets value for the selection of which of the four cost functions should be used.

Return type

void (-)

usedFunctionsForCostMatrix = '[1,1,0,0]'

> Logical array to select which of the four cost functions > should be used to build the final cost matrix. [boolean] > (Tracker core) > > Array specifying which cost functions to consider to build > final cost matrix; > general param

QuantificationData

class +TracX.@QuantificationData.QuantificationData

Bases: handle, dynamicprops

QUANTIFICATIONDATA This class contains all the quantification data of the configured Tracker project for a single experiment (i.e. one well position of a multi well experiment.) The QuantificationData is mapped to the SegmentationData via a primary key stored in the uuid property.

Authors

Andreas P. Cuny - initial implementation

QuantificationData()

QUANTIFICATIONDATA constructs an empty object of type QuantificationData. This object acts as datastorage for fluorescence quantification data for a TracX Project.

Returns

obj – Returns a QuantificationData instance.

Return type

object

Authors

Andreas P. Cuny - initial implementation

fluo_background_mean = None

Mean background fluorescence [a.u.]

fluo_background_std = None

Standard deviation of background fluorescence [a.u.]

fluo_bright_euler = None

Euler number of brightest pixel fluorescence [a.u.]

fluo_bright_q25 = None

Quantile 25 brightest pixel fluorescence [a.u.]

fluo_bright_q50 = None

Quantile 50 brightest pixel fluorescence [a.u.]

fluo_bright_q75 = None

Quantile 75 brightest pixel fluorescence [a.u.]

fluo_bright_total = None

Brightest pixel of whole cell fluorescence [a.u.]

fluo_cell_q25 = None

Quantile 25 of cell fluorescence [a.u.]

fluo_cell_q50 = None

Quantile 50 of cell fluorescence [a.u.]

fluo_cell_q75 = None

Quantile 75 of cell fluorescence [a.u.]

fluo_cell_total = None

Total cell fluorescence [a.u.]

fluo_id = None

Id of fluorescence channel [int].

fluo_mem_q25 = None

Quantile 25 of cell fluorescence [a.u.]

fluo_mem_q50 = None

Quantile 50 of cell fluorescence [a.u.]

fluo_mem_q75 = None

Quantile 75 cell membrane fluorescence [a.u.]

fluo_mem_total = None

Total cell membrane fluorescence [a.u.]

fluo_name = None

Fluorescence channel name [string]

fluo_nuc_q25 = None

Quantile 25 of cell nucleus fluorescence [a.u.]

fluo_nuc_q50 = None

Quantile 50 of cell nucleus fluorescence [a.u.]

fluo_nuc_q75 = None

Quantile 75 of cell nucleus fluorescence [a.u.]

fluo_nuc_total = None

Total cell nucleus fluorescence [a.u.]

setUUID(this, value)

SETUUID Sets a unique id for each segmented cell per image frame such that the QuantificationData is mapped to the SegmentationData object via a primary key stored in the uuid property.

Parameters
uuid = None

Primary key

SegmentationData

class +TracX.@SegmentationData.SegmentationData

Bases: dynamicprops

SegmentationData Creates an object to store imported cell segmentation data. It is structured based on the CellX output, however other segmentation software outputs can be stored as well once converted.

Authors

Andreas P. Cuny - initial implementation

SegmentationData()

SEGMENTATIONDATA Constructs an empty SegmentationData object to save segmentation data as well as tracking results. for a TracX project.

Returns

SegmentationData instance.

Return type

obj (object)

Authors

Andreas P. Cuny - initial implementation

cell_area = None

Area of segmented cell.

cell_center_x = None

X component of segmented cell center.

cell_center_y = None

Y component of segmented cell center

cell_center_z = None

Z component of segmented cell center

cell_close_neighbour = None

Array of closest cell neighbours of segmented cell.

cell_dif_x = None

X component difference between two subsequent frames of segmented cell.

cell_dif_y = None

Y component difference between two subsequent frames of segmented cell.

cell_dif_z = None

Z component difference between two subsequent frames of segmented cell.

cell_eccentricity = None

Eccentricity of segmented cell.

cell_filtered_dif_x = None

Filtered X component difference between two subsequent frames of segmented cell.

cell_filtered_dif_y = None

Filtered Y component difference between two subsequent frames of segmented cell.

cell_filtered_dif_z = None

Filtered Z component difference between two subsequent frames of segmented cell.

cell_fractionOfGoodMembranePixels = None

Fraction of good membrane pixel of segmented cell.

cell_frame = None

Image frame number of segmented cell.

cell_index = None

Unique segmentation cell index for each frame.

cell_majoraxis = None

Major axis of segmented cell.

cell_mask_boundary_points = None

Point on Outline of Segmentation mask for mesh

cell_mem_area = None

Membrane area of segmented cell.

cell_mem_volume = None

Membrane volume of segmented cell..

cell_minoraxis = None

Minor axis of segmented cell.

cell_nuc_area = None

Nucleus area of segmented cell.

cell_nuc_radius = None

Nucleus radius of segmented cell

cell_orientation = None

Orientation of segmented cell.

cell_perimeter = None

Perimeter of segmented cell.

cell_pole1_age = None

Cell pole 1 age (optionally, for rod shaped object lineage reconstruction)

cell_pole1_x = None

Cell pole 1 x component (optionally, for rod shaped object lineage reconstruction)

cell_pole1_y = None

Cell pole 1 y component (optionally, for rod shaped object lineage reconstruction)

cell_pole2_age = None

Cell pole 2 age (optionally, for rod shaped object lineage reconstruction)

cell_pole2_x = None

Cell pole 2 x component (optionally, for rod shaped object lineage reconstruction)

cell_pole2_y = None

Cell pole 2 y component (optionally, for rod shaped object lineage reconstruction)

cell_timepoint = None

Cell timpoint (3D data)

cell_volume = None

Volume of segmented cell.

cell_zplane = None

Cell zplane (3D data)

initNewEntry(this, uuid, cell_frame, cell_index, cell_center_x, cell_center_y, cell_majoraxis, cell_minoraxis, cell_orientation, cell_area, cell_volume, cell_perimeter, cell_eccentricity, cell_fractionOfGoodMembranePixels, cell_mem_area, cell_mem_volume, cell_nuc_radius, cell_nuc_area, cell_close_neighbour, cell_dif_x, cell_dif_y, cell_filtered_dif_x, cell_filtered_dif_y, cell_pole1_x, cell_pole1_y, cell_pole2_x, cell_pole2_y, cell_pole1_age, cell_pole2_age, track_index, track_index_qc, track_fingerprint_real, track_fingerprint_real_distance, track_age, track_parent, track_parent_frame, track_parent_prob, track_parent_score, track_generation, track_lineage_tree, track_cell_cycle_phase, track_assignment_fraction, track_total_assignment_cost, track_position_assignment_cost, track_area_assignment_cost, track_rotation_assignment_cost, track_frame_skipping_cost, track_start_frame, track_end_frame, track_index_corrected, track_contained_in_track, track_has_bud, track_budneck_total)

INITNEWENTRY Adds new segmentation data to the object. Empty parameters should be a NaN array of the same size as the other parameter data arrays.

Parameters
  • this (object) – SegmentationData instance

  • uuid (int) – Primary key

  • cell_frame (int) – Image frame number

  • cell_index (int) – Unique segmentation cell index for each frame

  • cell_center_x (int) – X coordinate of segmented object

  • cell_center_y (int) – Y coordinate of segmented object

  • cell_majoraxis (float) – Major axis

  • cell_minoraxis (float) – Minor axis

  • cell_orientation (float) – Orienation

  • cell_area (float) – Area

  • cell_volume (float) – Volume

  • cell_perimeter (float) – Perimeter

  • cell_eccentricity (float) – Eccentricity

  • cell_fractionOfGoodMembranePixels (float) – Fraction of good membrane pixels

  • cell_mem_area (float) – Membrane area

  • cell_mem_volume (float) – Membrane volume

  • cell_nuc_radius (float) – Nucleus radius

  • cell_nuc_area (float) – Nucleus area

  • cell_close_neighbour (array) – Array of closest cell neighbours

  • cell_dif_x (float) – Frame to frame difference of X coordinate

  • cell_dif_y (float) – Frame to frame difference of Y coordinate

  • cell_filtered_dif_x (float) – Filtered frame to frame difference difference of X coordinate

  • cell_filtered_dif_y (float) – Filtered frame to frame difference difference of Y coordinate

  • cell_pole1_x (float) – Cell pole1 x coordinate (rod shaped objects);

  • cell_pole1_y (float) – Cell pole1 y coordinate (rod shaped objects);

  • cell_pole2_x (float) – Cell pole2 x coordinate (rod shaped objects);

  • cell_pole2_y (float) – Cell pole2 y coordinate (rod shaped objects);

  • cell_pole1_age (int) – Cell pole1 age (rod shaped objects);

  • cell_pole2_age (int) – Cell pole2 age (rod shaped objects);

  • track_index (int) – Unique track index

  • track_index_qc (int) – Unique qc verified track index

  • track_fingerprint_real (array) – Track fingerprint real

  • track_fingerprint_real_distance (float) – Track fingerprint real distance

  • track_age (int) – Track age

  • track_parent (ont) – Track parent

  • track_parent_frame (int) – Track parent frame

  • track_parent_prob (float) – Track parent assignemt probability

  • track_parent_score (float) – Track parent assignemt score

  • track_generation (int) – Track generation

  • track_lineage_tree (int) – Track lineage

  • track_assigmnent_fraction (float) – Assignment fraction

  • track_total_assignment_cost (float) – Track total assignment costs

  • track_position_assignment_cost (float) – Track positional costs

  • track_area_assignment_cost (float) – Track area costs

  • track_rotation_assignment_cost (float) – Track orientation costs

  • track_frame_skipping_cost (float) – Track frame skipping costs

  • track_start_frame (int) – Track start frame

  • track_end_frame (int) – Track end frame

  • track_index_corrected (int) – Track index corrected

  • track_contained_in_track (int) – Track contained in other track

  • track_has_bud (int) – Track has bud indicates if a track is budding in a certain cell_frame

  • track_budneck_total (float) – Total budneck signal

Returns

SegmentationData instance. updated with new data

Return type

this void (object)

setUUID(this, value)

SETUUID Sets a unique id for each segmented cell per image frame such that the +TracX.QuantificationData is mapped to the +TracX.SegmentationData object via a primary key stored in the uuid property.

Parameters
  • this (object) – SegmentationData instance.

  • value (int) – Sets value for uuid.

track_age = None

Track age of segmented cell.

track_area_assignment_cost = None

Track area assignment costs of segmented cell determined by penalty function.

track_assignment_fraction = None

Track assignment fraction if there is a better alternative assignment.

track_budneck_total = None

Budneck total fluo signal for the given track

track_cell_cycle_phase = None

Track cell cycle phase

track_contained_in_track = None

Track cointained in other track of segmented cell.

track_end_frame = None

Track end frame number of segmented cell.

track_fingerprint_real = None

Track real frequency based fingerprint of segmented cell.

track_fingerprint_real_distance = None

Track fingerprint distance of segmented cell based on track_fingerprint_real.

track_frame_skipping_cost = None

Track frame skipping assignment costs of segmented cell determined by penalty function.

track_generation = None

Track generation of segmented cell.

track_has_bud = None

Track has bud indicates whether a track in a certain frame is budding

track_index = None

Track index of segmented cell.

track_index_corrected = None

Track index corrected of segmented cell.

track_index_qc = None

Track index of segmented cell after qc verification

track_lineage_tree = None

Track lineage of segmented cell.

track_parent = None

Track parent of segmented cell.

track_parent_frame = None

Track parent frame of segmented cell.

track_parent_prob = None

Track parent probabliity of parent assignment.

track_parent_score = None

Track parent score of parent assignment.

track_position_assignment_cost = None

Track positional assignment costs of segmented cell.

track_rotation_assignment_cost = None

Track rotation assignment costs of segmented cell determined by penalty function.

track_start_frame = None

Track start frame number of segmented cell determined by penalty function.

track_total_assignment_cost = None

Track total assignment costs of segmented cell.

uuid = None

Primary key

TemporaryData

class +TracX.@TemporaryData.TemporaryData

TEMPORARYDATA acts as temprorary data container for TemporaryTrackingData.

Authors

Andreas P. Cuny - initial implementation

NewFrame = None

TemporaryTrackingData object holding the subsequent image frame data.

OldFrame = None

TemporaryTrackingData object holding the current image frame data.

TemporaryData()

TEMPORARYDATA Constructs a TemporaryData object instance to keep teporary frame data during tracking.

Returns

obj – Returns TemporaryData instance.

Return type

object

Authors

Andreas P. Cuny - initial implementation

VeryOld = None

TemporaryTrackingData object holding the previous image frame data of non assigned tracks.

initializeOldFrame(this)

INITIALIZEOLDFRAME Initailizes the OldFrame property of the Tracker with data from the TemporaryData object for the first image frame (frameNumber == 1).

Parameters

this (object) – TemporaryData instance

Returns

this – Initializes the TemporaryData.OldFrame property and returns the TemporaryData instance parametrized.

Return type

object

TemporaryLineageAssignment

class +TracX.@TemporaryLineageAssignment.TemporaryLineageAssignment

Bases: handle, matlab.mixin.Copyable

TEMPORARYLINEAGEASSIGNMENT Stores temporary mother daughter lineage assignments until final decision is made which cells to assign.

Authors

Andreas P. Cuny - initial implementation

TemporaryLineageAssignment()

TEMPORARYLINEAGETEMPASSIGNMENT Object constructor.

Returns

TemporaryLineageAssignment instance

Return type

obj object

Authors

Andreas P. Cuny - initial implementation

daughterCell = '[]'

DaughterCell property stores daughter cells’ track indicies.

daughterCellStartFrame = None

Start frame of daughter cell segmentation (can be error prone due to missing segmentation)

deleteEntry(this, delIdx)

DELETEENTRY Deletes a mother daughter (MD) pair entry form TemporaryLineageAssignment

Parameters
Return type

void (-)

deleteRow(this, daughterArray)

DELETEROW Deletes the row of assigned mother - daughter pairs.

Parameters
  • this (object) – TemporaryLineageAssignment instance

  • daughterArray (array kx1) – With daughter track_index to remove from object after sucessfull assignment.

Return type

void (-)

determineMotherCell(this)

DETERMINEMOTHERCELL Determines the mother cells from the mother cell canditates based on most frequence occurence.

Parameters

this (object) – TemporaryLineageAssignment instance

Return type

void (-)

frameOfMDPair = None

Frame on which a mother daughter pair was found

getWeightedScore(this, p, occ)

GETWEIGHTEDSCORE Computes a weighted score for mother daughter candidate pairs based on a probablity and MD pair occurance.

Parameters
  • this (object) – TemporaryLineageAssignment instance

  • p (array kx1) – Probability of MD (mother daughter pair) assignments.

  • occ (array, kx1) – MD pair detection occurance.

Returns

Weighted score for MD assignments.

Return type

score (float)

hasBudNeckSignal = None

Binary bud neck signal quantification

isManualCorr = None

isManualCorr indicates if assignment has been manually corrected

lineProfile = None

Line profile between daughter cell and mother candidate cell centroid

markerChannelID = '{}'

Image channel of cell division marker segmentation.

markerID = '{}'

ID of cell division marker segmentation.

markerTrack = None

Track index of marker corresponding to MD pair.

markerTrackEndFrame = None

Track index of marker corresponding to MD pair end frame (can be error prone due to low SNR / not detectable signal)

markerTrackStartFrame = None

Track index of marker corresponding to MD pair start frame

maxFrameEvalAfterBirth = '20'

Number of frames for how long mother-dauther pairs should be evaluated if this assignment is correct after daughter cell birth.

motherAssignmentProb = '[]'

Assignment probability

motherAssignmentScore = '[]'

Assignment score

motherCell = None

MotherCell property stores the detected mother cells (track indicies).

motherCellCandidates = '{}'

MotherCellCandidates stores track indicies that are considered to be potenial mother cells.

motherCellCandidatesStartFrame = '{}'

MotherCellCandidatesStart frame stores frame number where the mother cell was segmented for the first time.

motherSigInNucCandidates = '{}'

MotherSigInNucCandidates (G1 phase) 1 if in nuc 0 otherwise for candidates.

reconstructionIsFinished = None

Flag if reconstruction has been finished sucessfully

replaceOrAddNew(this, data2Modify)

REPLACEORADDNEW Replaces or adds new data to TemporaryLineageAssignment

Parameters
  • this (object) – TemporaryLineageAssignment instance

  • data2Modify (array) – Array with data to be modified. The collumns correspond to daughter, new mother, old mother, division frame.

Return type

void (-)

setMarker(this, markerID, channelID, Daughter)

SETMARKER Sets the cell division event marker segmentation index as well as the image channel the marker was recorded with.

Parameters
  • this (object) – TemporaryLineageAssignment instance

  • markerID (int) – Cell division segmentation label index.

  • channelID (int) – Cell division image channel index.

Return type

void (-)

setMarkerTracks(this, lineageData)

SETMARKERTRACKS Assigns the marker track id of the bud neck marker to a mother daughter (MD) canditate pair.

Parameters
Return type

void (-)

setMotherDaughterPair(this, daughterArray, motherArray, frameNumber, budNeckSig, lineProfileRe, daughterFrameArray, motherFrameArray)

SETMOTHERDAUGHTERPAIR Sets a mother - daughter pair in the TemporaryLineageAssignment object.

Parameters
  • this (object) – TemporaryLineageAssignment instance

  • daughterArray (array kx1) – With daughter track_index to add to the object for evaluation.

  • motherArray (array kx1) – With mother track_index to add to the object for evaluation

  • frameNumber (int) – Image frame number

  • budNeckSig (bool) – Flag if budneck signal was detected 1, 0 otherwise.

  • lineProfileRe (array 1x100) – Resampled line profile between mother daugher centroid

Return type

void (-)

setSigInNuc(this, sigInNuc, daughter)

SETSIGINNUC Sets a flag if a signal in the nucleus of a mother cell has been detected (for cell cycle determination).

Parameters
  • this (object) – TemporaryLineageAssignment instance

  • sigInNuc (int) – Flag if signal in nucleus has been detected.

  • daughter (int) – Daughter track index.

Return type

void (-)

TemporaryTrackingData

class +TracX.@TemporaryTrackingData.TemporaryTrackingData

Bases: handle

TEMPORARYTRACKINGDATA Creates an object of minimal required information needed for frame to frame tracking.

Authors

Andreas P. Cuny - initial implementation

TemporaryTrackingData()

TEMPORARYTRACKINGDATA constructs an object of type TracX.TemporaryTrackingData. This object acts as a temporary data storage for relevant data needed during the frame to frame tracking process for a TracX Project.

Returns

TemporaryTrackingData instance.

Return type

this (object)

Authors

Andreas P. Cuny - initial implementation

addData(this, track_index, track_index_qc, track_age, cell_index, cell_center_x, cell_center_y, cell_center_z, cell_dif_x, cell_dif_y, cell_dif_z, cell_filtered_dif_x, cell_filtered_dif_y, cell_filtered_dif_z, cell_orientation, cell_area, cell_close_neighbour, cell_del, track_fingerprint_real, track_fingerprint_real_distance, track_assignment_fraction, track_fingerprint_age)

ADDDATA Adds data to TracX.TemporaryTrackingData object.

Parameters
  • this (object) – TemporaryTrackingData instance.

  • track_index (int, kx1) – Unique track index arrau

  • track_index_qc (int, kx1) – Unique qc verified track index array

  • track_age (int, kx1) – Track age arrau

  • cell_index (int, kx1) – Unique segmentation cell index for each frame array

  • cell_center_x (double, kx1) – X coordinate array

  • cell_center_y (double, kx1) – Y coordinate array

  • cell_center_z (double, kx1) – Z coordinate array

  • cell_dif_x (double, kx1) – Frame to frame difference of X coordinates array

  • cell_dif_y (double, kx1) – Frame to frame difference of Y coordinates array

  • cell_dif_z (double, kx1) – Frame to frame difference of Z coordinates array

  • cell_filtered_dif_x (double, kx1) – Filtered frame to frame differences of X coordinates array

  • cell_filtered_dif_y (double, kx1) – Filtered frame to frame differences of Y coordinates array

  • cell_filtered_dif_z (double, kx1) – Filtered frame to frame differences of Z coordinates array

  • cell_orientation (double, kx1) – Orienation

  • cell_area (double, kx1) – Area

  • cell_close_neighbour (bool, kxk) – Matrix of closest cell neighbours

  • cell_del (int, kx1) – Cell deletion

  • track_fingerprint_real (double, kx1) – Track fingerprint real

  • track_fingerprint_real_distance (double, kx1) – Track fingerprint real distance

  • track_assignment_fraction (double, kx1) – Fraction of neighbouring cell with lower track_fingerprint_real_distance

  • track_fingerprint_age (int, kx1) – Track fingerprint age

Returns

Returns TracX.TemporaryTrackingData

Return type

this (object)

cell_area = None

Area of segmented cell.

cell_center_x = None

X component of segmented cell.

cell_center_y = None

Y component of segmented cell.

cell_center_z = None

Z component of segmented cell.

cell_close_neighbour = None

Array of closest cell neighbours of segmented cell.

cell_del = None

Deletion of segmented cell.

cell_dif_x = None

X component frame to frame difference of segmented cell.

cell_dif_y = None

Y component frame to frame difference of segmented cell.

cell_dif_z = None

Z component frame to frame difference of segmented cell.

cell_filtered_dif_x = None

Filtered x component frame to frame difference of segmented cell.

cell_filtered_dif_y = None

Filtered y component frame to frame difference of segmented cell.

cell_filtered_dif_z = None

Filtered z component frame to frame difference of segmented cell.

cell_index = None

Segmentation cell index of segmented cell.

cell_orientation = None

Orientation of segmented cell.

recalculateMotionCorrNeighbourhood(this, neighbourhoodSearchRadius)

RECALCULATEMOTIONCORRNEIGHBOURHOOD Recalculates the motion. corrected segmentation neighbourhood.

Parameters
Return type

void (-)

track_age = None

Track age segmented cell.

track_assignment_fraction = None

Fraction of neighbouring cell with lower track_fingerprint_real_distance

track_fingerprint_age = None

Track fingerprint age

track_fingerprint_real = None

Track real frequency based fingerprint of segmented cell.

track_fingerprint_real_distance = None

Track fingerprint distance of segmented cell based on track_fingerprint_real.

track_index = None

Track index of segmented cell.

track_index_qc = None

Track index qc validated of segmented cell.

Tracker

class +TracX.@Tracker.Tracker

Bases: handle

TRACKER Tracker main TracX object

Authors

Andreas P. Cuny - initial implementation

Tracker()

TRACKER Tracker Constructs an empty Tracker object object to save segmentation data as well as tracking results. for a TracX project.

Returns

objTracker instance.

Return type

(obj)

Authors

Andreas P. Cuny - initial implementation

configuration = None

+TracX.@TrackerConfiguration instance with the tracking parameters and project metadata.

copyResultsToTrackerData(this, dataToSave, fieldName, emptyDataLocIdx, oldFrameLocIdx, frameNumber)

COPYRESULTSTOTRACKERDATA Copies results of the frame by frame tracking to the data store Tracker.TrackerData.

Parameters
  • this (obj) – Tracker instance.

  • dataToSave (array) – Array with data to be saved to TrackerData

  • fieldName (str) – Fieldname name

  • emptyDataLocIdx (array) – Location indicies of empty data.

  • oldFrameLocIdx (array) – OldFrame location indicies for track_index.

  • frameNumber (int) – Frame number

Returns

voidTracker instance

Return type

(-)

createNewTrackingProject(this, projectName, imageDir, segmentationResultDir, fileIdentifierFingerprintImages, fileIdentifierWellPositionFingerprint, fileIdentifierCellLineage, imageCropCoordinateArray, nrOfFramesToImport, cellDivisionType)

CREATENEWTRACKINGPROJECT Creates a new TracX project. Sets file paths, and load segmentation data.

Parameters
  • this (obj) – Tracker instance

  • projectName (str) – Name of the tracking project.

  • imageDir (str) – Image directory to be used in the current project.

  • segmentationResultDir (str) – the segmentation results for the current project

  • fileIdentifierFingerprintImages (str) – File name identifier for raw Brightfield images.

  • fileIdentifierWellPositionFingerprint (str) – File name identifier specifing the well position (of a multi well experiment).

  • fileIdentifierCellLineage (str) – of the fluorescent channel images to be used to reconstruct the cell lineage (i.e. bud neck marker)

  • imageCropCoordinateArray (array, 1x4) – Array with crop coordinates used during segmentation.

  • nrOfFramesToImport (int) – Number of frames to track.

  • cellDivisionType (str) – Cell division type

Returns

thisTracker instance with new project initialized.

Return type

(obj)

data = None

+TracX.@TrackData instance which stores all segmentation, quantification and lineage data.

evaluation = None

+TracX.@TrackerEvaluation instance implementing tracker performance evaluation methods

fingerprint = None

+TracX.@Fingerprint instance implementing cell fingerprinting methods.

getTrackIndexStorageIndicies(this)

GETTRACKINDEXSTORAGEINDICIES Returns indicies of track_index where to store them.

Parameters

this (obj) – Tracker instance

Returns

  • oldFrameLocIdx (array) – Array with location indices in the oldFrame.

  • emptyDataLocIdx (array) – Array with location indices for empty data.

imageProcessing = None

+TracX.@ImageProcessing instance implementing image processing methods.

imageVisualization = None

+TracX.@ImageVisualization instance implementing image visualization methods.

importAlphaShapes(this)

IMPORTALPHASHAPES Imports the alpha shapes form the project directory.

Parameters

this (obj) – Tracker instance.

Returns

voidTracker instance

Return type

(-)

importData(this)

IMPORTDATA Imports segmentation and eventual quantification data using the settigs set in the configuration.ProjectConfiguration object.

Parameters

this (obj) – Tracker instance

Returns

void – Imports data into the Tracker instance

Return type

(-)

improveInitialTracking(this, frameNumber)

IMPROVEINITIALTRACKING Improves the initial tracking by correcting for motion and by using the CRF as proofreading.

Parameters
  • this (obj) – Tracker instance

  • frameNumber (int) – Image frame number.

Returns

newTrackIndex – Array with new, potentially corrected tracking indices.

Return type

(array)

initializeTrackerCore(this)

INITIALIZETRACKERCORE Initailizes Tracker core.

Parameters

this (obj) – Tracker instance

Returns

voidTracker instance

Return type

(-)

io = None

+TracX.@IO instance implementing read/write methods.

isAllInstalled = '0'

Flag, if all TracX dependencies and toolboxes are installed. Defaults to false.

isCorrectMotion = '1'

Flag, if motion should be corrected for (1). Defaults to true.

isFFPEval = '0'

Flag, to evaluate FFP for manuscript. Defaults to false

isFullCosts = '1'

Flag if full costs should be used during tracking (1) or if a minimalized tracker based on dCRF should be run. Defaults to true.

isReady = '0'

Flag, if TracX is ready to be used. Defaults to false.

lap = None

+TracX.@LAP instance implementing linear assignment methods.

lineage = None

+TracX.@Lineage instance implementing lineage reconstruction methods

loadTrackingProject(this, filePath, fileName)

LOADTRACKINGPROJECT load a TracX project. Load from xml file the meta data and parameters used during tracking.

Parameters
  • this (obj) – Tracker instance

  • filePath (str) – File path for loading the TracX project

  • fileName (str) – Filename of Tracking project to load.

Returns

void – Loads the project.

Return type

(-)

motion = None

+TracX.@Motion instance implementing cell motion methods.

moveToVeryOld(this, selectedTrackArray)

MOVETOVERYOLD Moves temporary data stored in OldFrame to VeryOld.

Parameters
  • this (obj) – Tracker instance

  • selectedTrackArray (int) – Array with track indices to be moved to veryOld.

Returns

  • this (obj) – Tracker instance

  • trackIdxToChange (array) – Array with tracking indices to move.

runTracker(this, varargin)

RUNTRACKER Runs the tracker.

Parameters
  • this (obj) – Tracker instance

  • varargin (str varchar) –

    • flag (array, 1x2): Flag if full cost (tracker) should be used (1) or not (0) as well if motion should be corrected (1) or not (0). Defaults to [1,1].

Returns

voidTracker instance

Return type

(-)

saveTrackingProject(this, varargin)

SAVETRACKINGPROJECT Save a TracX project. Includes the meta data and parameters used during tracking.

Parameters
  • this (obj) – Tracker instance

  • varargin (str varchar) –

    • filePath (str): File path for saving the TracX project.

    • fileName (str): Filename for the Tracking project.

Returns

void – Saves project to disk directly.

Return type

(-)

utils = None

+TracX.@Utils instance implementing utility methods.

version = None

Current TracX version

+TracX.@Tracker.correctMDMisassignment(this, trackIndexDaughter, newMotherTrackIndex, oldMotherTrackIndex, divisionFrameNumber)

CORRECTMDMISASSIGNMENT Allows to manually correct a mother daughter assignment for a given lineage. A given daughter track index will be replaced with a new mother track index. The arrays need to have the same size. Lineage roots or on the first frame should have the value 0 instead of a track index.

Parameters
  • this (object) – Tracker instance.

  • trackIndexDaughter (array) – Array of daughter track indices.

  • newMotherTrackIndex (array) – Array of mother track indices.

  • oldMotherTrackIndex (array) – Array of old mother track indices.

  • divisionFrameNumber (array) – Frame number of division frame.

Return type

void -

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.correctTrackMisassignment(this, frameArray, oldTrackIndexArray, newTrackIndexArray)

CORRECTTRACKMISASSIGNMENT Allows to manually correct a cell to track assignment on specific frames. A given track index will be replaced with a new track index. The arrays need to have the same size.

Parameters
  • this (obj) – Tracker instance.

  • frameArray (array) – Array of image frames.

  • oldTrackIndexArray (array) – Array of old track indices to be replaced.

  • newTrackIndexArray (array) – Array of new track indices to relpace the old ones with.

Returns

void – Acts on Tracker instance directly

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.deleteByFeature(this, feature, threshold, varargin)

DELETEBYFEATURE Deletes segmentation objects exceeding a threshold for a feature.

Parameters
  • this (obj) – Tracker object

  • feature (str) – Any segmentation feature to use to threshold the data before tracking. SegmentationData

  • threshold (float) – Threshold. Feature values below the threshold are selected.

  • varargin (str varchar) –

Returns

void – Acts on Tracker object directly and deletes selected data below threshold.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.deleteByROI(this, roi, varargin)

DELETEBYROI Deletes segmentation objects outside a region of interest (ROI).

Parameters
  • this (obj) – Tracker object

  • roi (array) – Region of interest defined by polygon vertices to keep data for tracking.

  • varargin (str varchar) –

Returns

void – Acts on Tracker object directly and deletes selected data outside ROI.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.deleteSegArtefacts(this, varargin)

DELSEGARTEFACTS Deletes potential segmentation artefacts (segmented objects which are no cells based the autofluorescence.

Parameters
  • this (obj) – Tracker object

  • varargin (str varchar) –

    • channel (int): Channel number fluo_id of the fluorescent channel to use for segmentation artefact detection. Defaults to 1.

    • stdFactor (float): Factor standard deviation. Defaults to 2.

    • neighbourhoodSearchRadius (int): Neighbourhood radius. Defaults to neighbourhoodSearchRadius

Returns

void – Acts on Tracker object directly and deletes selected data below threshold.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.deleteSegObjAtBorder(this, borderOffset)

DELETESEGOBJATBORDER Delete segmentation objects at the image border within the border offset.

Parameters
  • this (obj) – Tracker object

  • borderOffset (int) – Offset from image border in pixel to exclude from tracking.

Returns

void – Acts on Tracker object directly and deletes selected data from the image border up to the border offset.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.exportCellCycleResults(this, resultFilePath, resultFileName, varargin)

EXPORTCELLCYCLERESULTS Exports the cell cycle results to disk as text, csv or mat file format delimited by your choice. Default is as text file and tab delimited.

Parameters
  • this (obj) – Tracker object

  • resultFilePath (str) – Path to where to save the results. Defaults to segmentationResultDir

  • resultFileName (str) – Results file name. Defaults to ProjectName_CellCycleResults_Timestamp

  • varargin (str varchar) –

    • fileType (str): File type. Defaults to txt. Valid options are ‘txt’, ‘csv’, ‘mat’.

    • dataDelimiter (str): Data delimiter. Defaults to tab. Valid options are ‘,’, ‘comma’, ‘ ‘, ‘space’, ‘t’, ‘tab’, ‘;’, ‘semi’, ‘|’, ‘bar’.

Returns

void – Writes text file to disk

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.exportFinalTrackingMasks(this)

EXPORTFINALTRACKINGMASKS Exports tracked masks for cells that divide asymmetrically after lineage reconstruction to merge the individual buds with their respective mother mask prior cell division.

Parameters

this (obj) – Tracker object

Returns

void – Writes mask files to disk

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.exportTrackingResults(this, joinedTrackerDataTable, resultFilePath, resultFileName, varargin)

EXPORTTRACKINGRESULTS Exports results to disk as text, csv or mat file format delimited by your choice. Default is as text file and tab delimited.

Parameters
  • this (obj) – Tracker object

  • joinedTrackerDataTable (table) – Table of tracking results.

  • resultFilePath (str) – Path to where to save the results. Defaults to segmentationResultDir

  • resultFileName (str) – Results file name. Defaults to ProjectName_CellCycleResults_Timestamp

  • varargin (str varchar) –

    • fileType (str): File type. Defaults to txt. Valid options are ‘txt’, ‘csv’, ‘mat’.

    • dataDelimiter (str): Data delimiter. Defaults to tab. Valid options are ‘,’, ‘comma’, ‘ ‘, ‘space’, ‘t’, ‘tab’, ‘;’, ‘semi’, ‘|’, ‘bar’.

Returns

void – Writes text file to disk

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.generateScriptFromTracker(this, varargin)

GENERATESCRIPTFROMTRACKER Generates a Matlab (.m) script file based on the tracker project configuration made with the GUI.

Parameters
  • this (obj) – Tracker object

  • varargin (str varchar) –

    • fileName (str): File name. Defaults to TracX_project_ProjectName.m.

Returns

void – Writes text file to disk

Return type

(-)

Authors

Thomas Kuendig - initial implementation

+TracX.@Tracker.prepareDataFromSegmentationMask(this, imagePath, segmentationPath, segmentationFileNameRegex, imageFileNameRegex, varargin)

PREPAREDATAFROMSEGMENTATIONMASK Allows tracking with segmentation results from any software given a un- or labeled segmentation mask per image frame. The mask is then converted into the CellX format which is used internaly for structuring the data during tracking.

Parameters
  • this (obj) – Tracker instance.

  • imagePath (str) – Path to the experiment raw images. imageDir

  • segmentationPath (str) – Path to segmentation results. segmentationResultDir

  • segmentationFileNameRegex (str) – Regex for the mask filename identifier i.e. Mask_*.

  • imageFileNameRegex (str) – Regex for the image filename identifier i.e. BF_*.

  • varargin (str varchar) –

    • pxPerPlane (int): Pixel per image plane. Defaults to 0.

    • fluoTags (int): Identifier for potential fluorescent images to quantify i.e. {‘XFP’}

    • flatFieldFileNames (int): Names of potential flat fields.

    • customRegEx (str): Custom regex to identify the segmetnation masks.

Returns

void – Writes results to disk directly.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.revertSegmentationImageCrop(this)

REVERTSEGMENTATIONIMAGECROP Reverts a potentially applied image crop during segmentation to map the segmentation objects’ centroid coordintates to the raw image.

Parameters

this (obj) – Tracker object

Returns

void – Acts on Tracker object directly.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.runLineageReconstruction(this, varargin)

RUNLINEAGERECONSTRUCTION Starts lineage reconstruction based on tracking results for symmetrically and asymmetrically dividing cells. Wrapper for lineage instance.

Parameters
  • this (object) – Tracker instance

  • varargin (str varchar) –

    • symmetricalDivision (str): Flag if lineage reconstruction should be run for symmetrical division. Defaults to false.

    • writeControlImages (bool): Flag if control images should be written. Deftaults to false.

    • nuclearMarkerChannel (int): Channel that depicts a nuclear marker (such as i.e. Whi5)

Returns

Acts on:class:Tracker directly

Return type

void -

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.runReQuantification(this, fluoTags, varargin)

RUNREQUANTIFICATION Runs the re segmentation and quantification of merged tracking masks for buds and mothers prior division. It first runs the CellXMaskInterface to resegment and quanfity the merged labels. Then in loads the data and updates it for the mothers and deletes the bud entries prior division (now merged with mothers) to make sure there is no data duplication.

Parameters
  • this (object) – Tracker instance.

  • fluoTags (array) – Array with fluoTags names. Fluorescent images file identifier.

  • varargin (str varchar) –

    • fileIdentifierSegmentationImages (str): File identifier for segmentation images.

Returns

Runs re quantification and writes results to disk directly.

Return type

void -

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.saveCurrentTrackerState(this, varargin)

SAVECURRENTTRACKERSTATE Saves the current state of the tracker to disk.

Parameters
  • this (obj) – Tracker object

  • varargin (str varchar) –

    • resultFilePath (str): Path to where to save the tracker stat. Defaults to segmentationResultDir

    • resultFileName (str): Results file name. Defaults to Timestamp_TracX_State_Project_ProjectName

Returns

void – Saves the tracker object stat to disk.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.saveTrackerCellCycleResultsAsTable(this, varargin)

SAVETRACKERCELLCYCLERESULTSASTABLE Saves the cell cycle results to disk as text, csv or mat file format delimited by your choice. Default is as text file and tab delimited.

Parameters
  • this (obj) – Tracker object

  • varargin (str varchar) –

    • resultFilePath (str): Path to where to save the results. Defaults to segmentationResultDir

    • resultFileName (str): Results file name. Defaults to ProjectName_CellCycleResults_Timestamp

    • fileType (str): File type. Defaults to txt. Valid options are ‘txt’, ‘csv’, ‘mat’.

    • dataDelimiter (str): Data delimiter. Defaults to tab. Valid options are ‘,’, ‘comma’, ‘ ‘, ‘space’, ‘t’, ‘tab’, ‘;’, ‘semi’, ‘|’, ‘bar’.

Returns

void – Saves cell cycle results as table to disk.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.saveTrackerControlImageFrame(this, frameNumber, varargin)

SAVETRACKERCONTROLIMAGES Saves a tracking control images with each tracked cell labeled with its track index for a given image frame.

Parameters
  • this (obj) – Tracker object

  • frameNumber (int) – Image frame to test.

  • varargin (str varchar) –

    • fieldName (str): Property to be displayed on the image. Defaults to ‘track_index’ can be any propery of SegmentationData.

    • highlightFieldNameVal (int): Pixel to unit conversion factor. I.e. for a 40X objective with 6.5 micron pixel size would result to 6.5/40.

    • fontSize (str): Font size of property to be displayed.

    • removeContainedTracks (bool): If contained tracks within tracks should be removed. Defaults to true.

    • isMarker (bool): If markers should be displayed. Defaults to false.

Returns

void – Saves images to disk.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.saveTrackerControlMaskImageFrame(this, frameNumber, varargin)

SAVETRACKERCONTROLMASKIMAGEFRAME Saves a tracker control image for a particular frame where the labeled tracker mask are overlayed onto the raw image. Optionaly the label color can be set using a cmap.

Parameters
  • this (obj) – Tracker object

  • frameNumber (int) – Image frame to test.

  • varargin (str varchar) –

    • useTrackIndices (bool): If track indices should be used. Defaults to true. Othewise cell indices are used.

    • customCMap (array kx3): Use custom colormat to color the cell segmentation masks. Otherwise auto generates one.

Returns

void – Saves masks to disk.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.saveTrackerMarkerControlImages(this)

SAVEMARKERCONTROLIMAGES Saves marker tracking control images to disk.

Parameters

this (obj) – Tracker object

Returns

void – Saves images to disk.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.saveTrackerMaskFrame(this, frameNumber)

SAVETRACKERMASKFRAME Saves a labeled mask file. It is a matrix where the elements correspond to a segmented cell are labeled with their track indices.

Parameters
  • this (obj) – Tracker object

  • frameNumber (int) – Image frame to test.

Returns

void – Saves masks to disk.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.saveTrackerProjectControlImages(this, varargin)

SAVETRACKERPROJECTCONTROLIMAGES Saves control images for the current experiment for all tracked image frames.

Parameters
  • this (obj) – Tracker object

  • varargin (str varchar) –

    • isParallel (bool): Flag if should be run in parallel. Defaults to false.

    • maxWorkers (int): Number of workers to us when running in parallel. Defaults to 4. Limited by CPU.

Returns

void – Saves images to disk.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.saveTrackerResultsAsTable(this, varargin)

SAVETRACKERRESULTSASTABLE Save the tracking results along with the segmentation data in one table to a file.

Parameters
  • this (obj) – Tracker object

  • varargin (str varchar) –

    • resultFilePath (str): Path to where to save the results. Defaults to segmentationResultDir

    • resultFileName (str): Results file name. Defaults to ProjectName_TrackingResults_Timestamp

    • fileType (str): File type. Defaults to txt. Valid options are ‘txt’, ‘csv’, ‘mat’.

    • dataDelimiter (str): Data delimiter. Defaults to tab. Valid options are ‘,’, ‘comma’, ‘ ‘, ‘space’, ‘t’, ‘tab’, ‘;’, ‘semi’, ‘|’, ‘bar’.

Returns

void – Saves data as table to disk.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.setupDependencies(this)

SETUPDEPENDENCIES Checks the presence of the external dependencies. If some are missing they are automatically downloaded. Required for manual installation (zip download) of tracx in the absence of git.

Parameters

this (obj) – Tracker object

Returns

status – Status, 1 successful 0 otherwise.

Return type

(int)

Authors
  • Andreas P. Cuny - Initial implementation

+TracX.@Tracker.testBudNeckSegmentation(this, frameNumber, varargin)

TESTBUDNECKSEGMENTATION Tests the parameter for budneck segmentation and displays a control image to optimize the parameters if needed.

Parameters
Returns

void – Displays the detected segmentation artifacts in an image.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.testFeatureDataRemoval(this, frameNumber, feature, threshold)

TESTFEATUREDATAREMOVAL Tests the data removal for cells above a feature (SegmentationData) value threshold.

Parameters
  • this (obj) – Tracker object

  • frameNumber (int) – Image frame to test.

  • feature (str) – Any segmentation feature to use to threshold the data before tracking. SegmentationData

  • threshold (float) – Threshold. Feature values below the threshold are selected.

Returns

void – Displays the detected segmentation artifacts in an image.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.testImageBorderDataRemoval(this, frameNumber, borderOffset)

TESTIMAGEBORDERDATAREMOVAL Tests the data removal for cells touching the image border within borderOffset distance.

Parameters
  • this (obj) – Tracker object

  • frameNumber (int) – Image frame to test.

  • borderOffset (int) – Offset from image border in pixel to exclude from tracking.

Returns

void – Displays the detected segmentation artifacts in an image.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.testMarkerTrackingParameters(this, testRange, varargin)

TESTTRACKINGPARAMETERS Tests the marker tracking parameters as defined in defined in ParameterConfiguration and displays the results for the given range.

Parameters
Returns

void – Displays the marker tracking results in an interactive movie player.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.testROIDataRemoval(this, frameNumber)

TESTROIDATAREMOVAL Tests the data removal for cells outside a ROI.

Parameters
  • this (obj) – Tracker object

  • frameNumber (int) – Image frame number.

Returns

roi – Returns the region of interest polygon vertices.

Return type

(array)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.testSegmentationArtefactRemoval(this, frame, channel, stdFactor, varargin)

TESTSEGMENTATIONARTEFACTREMOVAL Test of potential segmentation artefacts removal using the cell autofluorescence. Outcome is visualized as image and detected cell indices printed to the console. Assumption is that false positive segmentations have no autofluorecence or comparable to the cell surounding. Useage Tracker.data.getPotSegArtefacts(fluoChannelId, stdFactor) fluoChannelId: Id number of the fluo channel as found in unique(fluo_id) or its corresponding name unique(fluo_name) stdFactor: factor by which the std of the fluo background is multiplied to define a threshold below a cell intensity would be classified as artefact

Parameters
  • this (obj) – Tracker object

  • frame (int) – Image frame to test.

  • channel (int) – Channel number fluo_id of the fluorescent channel to use for segmentation artefact detection. Defaults to 1.

  • stdFactor (float) – Factor standard deviation. Defaults to 2.

  • varargin (str varchar) –

    • figure (object): Figure handle. Defaults [];

Returns

void – Displays the detected segmentation artifacts in an image.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Tracker.testTrackingParameters(this, testRange, varargin)

TESTTRACKINGPARAMETERS Tests the current set of tracker parameters as defined in ParameterConfiguration.

Parameters
  • this (obj) – Tracker object

  • testRange (array, 1x2) – Image frame test range to test Tracking [fromFrame, toFrame].

  • varargin (str varchar) –

    • mode (array 1x2): Allows to test the dCRF tracker instead of the full tracker as well as with or without motion correction i.e [1,0].

Returns

void – Displays the tracking results in an interactive movie player.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

TrackerConfiguration

class +TracX.@TrackerConfiguration.TrackerConfiguration

Bases: handle

TRACKERCONFIGRURATION Creates an object to store and manipulate metadata used and defining a Tracker project. The metadata itself is stored in +TracX.@ParameterConfiguration and +TracX.@ProjectConfiguration.

Authors

Andreas P. Cuny - initial implementation

ParameterConfiguration = None

+TracX.@ParameterConfiguration instance stores all the parameters needed for tracking.

ProjectConfiguration = None

+TracX.@ProjectConfiguration instance stores all information needed for a tracking project.

TrackerConfiguration()

TrackerConfiguration Constructs a TrackerConfiguration object to manipulate and store tracking +TracX.@ParameterConfiguration and +TracX.@ProjectConfiguration data.

Parameters

-

Returns

Returns a TrackerConfiguration instance. object instance with initialized +TracX.@ParameterConfiguration (default values) and +TracX.@ProjectConfiguration (empty) objects

Return type

this object

Authors

Andreas P. Cuny - initial implementation

exportTrackerConfiguration(this, file)

EXPORTTRACKERCONFIGURATION Writes a TracX configuration xml file with all the parameters stored in the ParameterConfiguration and ProjectConfiguration object.

Parameters
  • this (object) – TrackerConfiguration instance.

  • file (str) – Path to TracX configuration xml file and its name.

Returns

Writes to disk directly.

Return type

void (-)

importTrackerConfiguration(this, file)

IMPORTTRACKERCONFIGURATION Reads a TracX configuration xml file and stores the parameters in the ParameterConfiguration object.

Parameters
Returns

this – Acts on TrackerConfiguration object directly and returns TracX configured.

Return type

object

io = None

+TracX.@IO instance implementing read/write methods

TrackerData

class +TracX.@TrackerData.TrackerData

Bases: handle

TRACKERDATA Creates an object to store and manipulate data used in a Tracker project. The Data itself is stored in the objects SegmentationData and QuantificationData.

Authors

Andreas P. Cuny - initial implementation

NewFrame = None

+TracX.@TemporaryTrackingData instance holding the subsequent image frame data.

NewFrameEval = None

+TracX.@TemporaryTrackingData instance holding the current image frame data for evaluation.

OldFrame = None

+TracX.@TemporaryTrackingData instance holding the current image frame data.

OldFrameEval = None

+TracX.@TemporaryTrackingData instance holding the previous image frame data for evaluation.

QuantificationData = None

+TracX.@QuantificationData stores fluorescence quantification data

SegmentationData = None

Data

TmpLinAss = None

+TracX.@TemporaryLineageAssignment instance object holding data of lineage assignments.

TrackerData()

TrackerData Constructs a TrackerData object to manipulate and store segmentation and tracking data.

Return type

void -

VeryOld = None

+TracX.@TemporaryTrackingData instance holding the previous image frame data of non assigned tracks.

VeryOldEval = None

+TracX.@TemporaryTrackingData instance object holding the of non assigned tracks after evaluation.

cellDivisionMarkerData = None

Stores optional additional cell division marker segmentation and signal quantifiaction.

getConditionalFieldArray(this, fieldName, fieldNameCond, condition, varargin)

GETCONDITIONALFIELDARRAY Returns an array with all the data for a given fieldName (+TracX.@SegmentationData property) matching a given condition for the fieldNameCon (+TracX.@SegmentationData property).

Parameters
  • this (object) – TrackerData instance.

  • fieldName (str) – String with fieldname where to get values from.

  • fieldNameCond (str) – String with fieldname to match the condition.

  • condition (array) – Array with condition to match the match with the fieldNameCond.

Returns

Array of selected data.

Return type

ret array

getFieldArray(this, fieldName, varargin)

GETFIELDARRAY Returns an array with all the data for any fieldName (+TracX.@SegmentationData property) for all frameNumbers (image frames).

Parameters
  • this (object) – TrackerData instance.

  • fieldName (str) – String with fieldname where to get values from.

  • varargin (str varchar) –

    • fluoID (int): Fluo channel ID for which the fieldName data should be returned.

Returns

Array of selected data.

Return type

array array

getFieldArrayForFrame(this, fieldName, frameNumber, varargin)

GETFIELDARRAYFORFRAME Returns an array with all the data for a given fieldName (+TracX.@SegmentationData property) for a given frameNumber (image frame).

Parameters
  • this (object) – TrackerData instance.

  • fieldName (str) – String with fieldname where to get values from.

  • frameNumber (int) – Frame number for which the fieldName data should be returned.

  • varargin (str varchar) –

    • fluoID (int): Fluo channel ID for which the fieldName data should be returned.

Returns

Array of selected data.

Return type

ret array

getFieldArrayForSubsetOnFrame(this, fieldName, frame, subset, varargin)

GETFIELDARRAYFORSUBSETONFRAME Returns an array with the data for a given fieldName (+TracX.@SegmentationData property) for a given frameNumber (image frame) and datasubset.

Parameters
  • this (object) – TrackerData instance.

  • fieldName (str) – String with fieldname where to get values from.

  • subset (array) – Logical array to subset selected data.

  • varargin (str varchar) –

    • fluoID (int): Fluo channel ID for which the fieldName data should be returned.

Returns

Array of selected data.

Return type

array array

getFieldArrayForTrackIndex(this, fieldName, trackIndex, varargin)

GETFIELDARRAYFORTRACKINDEX Returns the data array for a track and given fieldname of the +TracX.@SegmentationData object.

Parameters
Returns

Array of data for a given track and fieldName.

Return type

array array

getNumberOfRowsFromFrame(this, frameNumber)

GETNUMBEROFROWSFORFRAME Returns the number of rows in the SegmentationData object for the selected frameNumber.

Parameters
  • this (object) – TrackerData instance.

  • frameNumber (int) – Image frame number.

Returns

Number of rows in +TracX.@SegmentationData for frameNumber.

Return type

nRows int

getTemporaryDataStruct(this, fieldNameArray, imageFrame)

GETTEMPORARYDATASTRUCT Returns a struct of a subset of +TracX.@SegmentationData based on field names and a given frame number.

Parameters
  • this (object) – TrackerData instance.

  • fieldNameArray (array) – Cell array with valid fieldnames for +TracX.@SegmentationData that should be returned.

  • imageFrame (int) – Image frame for which data should be returned.

Returns

Data struct for given imageFrame number and all field names in fieldNameArray.

Return type

dataStruct array

importData(this, pathName, fileNameArray, maxNrOfFrames)

IMPORTDATA Imports segmentation data from single files.

Parameters
  • this (object) – TrackerData instance.

  • pathName (array) – The path to where the data is stored.

  • fileNameArray (int) – Cell array with the filename(s) of the data to import.

  • maxNrOfFrames (int) – Max number of files to import (if not whole experimental data of a long time series should be imported.

Returns

TrackerData instance with imported data.

Return type

this object

io = None

+TracX.@IO instance implementing read/write methods

joinedTrackerData = 'struct()'

> JoinedTrackerData is a struct holding tracking results along with +TracX.@SegmentationData and +TracX.@QuantificationData

joinedTrackerDataTable = '[]'

> JoinedTrackerData is a table holding tracking results along with +TracX.@SegmentationData and +TracX.@QuantificationData for export to disk.

numberOfTracks = '[]'

Highest used track index number

setFieldArray(this, fieldName, fieldDataArray)

SETFIELDARRAY Sets data for a particular fieldname in the SegmentationData object of TrackerData.

Parameters
  • this (object) – TrackerData instance.

  • fieldName (str) – String for the fieldName to set new data.

  • fieldDataArray (array) – Data array to add to fieldName.

Returns

Sets data to TrackerData

Return type

void -

setFieldArrayForFrame(this, fieldName, frameNumber, fieldDataArray)

SETFIELDARRAYFORFRAME Sets data for a particular fieldname in the SegmentationData object of TrackerData.

Parameters
  • this (object) – TrackerData instance.

  • fieldName (str) – String for the fieldName to set new data.

  • frameNumber (int) – Frame number for which one wants to set the fieldName data.

  • fieldDataArray (array) – Data array to add to fieldName.

Returns

Sets data to TrackerData

Return type

void -

setFieldnameValueForTrack(this, fieldName, trackIndex, value)

SETFIELDNAMEVALUEFORTRACK Sets data for a particular fieldname and track in the SegmentationData object of TrackerData.

Parameters
  • this (object) – TrackerData instance.

  • fieldName (str) – String for the fieldName to set new data.

  • trackIndex (int) – Track index of the data to be set.

  • value (float) – Data value to add to fieldName for all trackIndex occurances.

Returns

Sets data to TrackerData

Return type

void -

setFieldnameValueForTrackSubset(this, fieldName, trackIndex, frameArray, value)

SETFIELDNAMEVALUEFORTRACKSUBSET Sets data for a particular fieldname and track for a given frame subset in the SegmentationData object of TrackerData.

Parameters
  • this (object) – TrackerData instance.

  • fieldName (str) – String for the fieldName to set new data.

  • trackIndex (int) – Track index of the data to be set.

  • frameArray (int) – Frame array of the data to be set.

  • value (float) – Data value to add to fieldName for all trackIndex occurances.

Returns

Sets data to TrackerData

Return type

void -

setFieldnameValuesForTracksOnFrame(this, fieldName, frameNumber, trackIndexArray, fieldDataArray)

SETFIELDARRAYFORTRACKSONFRAME Sets data for a particular fieldname, frame and selected track.

Parameters
  • this (object) – TrackerData instance.

  • fieldName (str) – String for the fieldName to set new data.

  • frameNumber (int) – Frame number for which one wants to set the fieldName data.

  • trackIndexArray (array) – Array of track indicies for which one wants to set new data into the fieldName data array.

  • fieldDataArray (array) – Data array for the trackIndexArray for the given fieldName on the given frame.

Returns

Sets data to TrackerData

Return type

void -

utils = None

+TracX.@Utils instance implementing utility methods

+TracX.@TrackerData.assignMammalianTrackparent(this, newFrameData, assignment, parentCandidateArray, parentCandidateType, daughterPairs, frame, printOutput)

ASSIGNMAMMALIANTRACKPARENT Assignes the track parent for symmetrical cell division of convex shapes such as for mammalian cells.

Parameters
  • this (object) – TrackerData instance.

  • newFrameData (object) – newFrame data

  • assignment (object) – Assignment result

  • parentCandidateArray (array) – Array with parent candidates

  • parentCandidateType (int) – Type of parents (0 or 1).

  • daughterPairs (array) – Array with daughter pairs

  • frame (int) – Image frame to be evaluated

  • printOutput (bool) – Flag, if text output should be displayed in the console.

Returns

  • newFrameData object – Parent set for daughter pair.

  • splits object – Array with potential splits for continous track.

Authors

Thomas Kuendig - initial implementation

+TracX.@TrackerData.decompressOrientationData(this)

DECOMPRESSORIENTATIONDATA Decompresses the orientation vector into from a single number.

Parameters

this (object) – TrackerData instance.

Return type

void -

Authors

Thomas Kuendig - initial implementation

+TracX.@TrackerData.delByFeature(this, feature, threshold, neighbourhoodSearchRadius)

DELBYFEATURE Delete cell segmentations exceeding the feature threshold value from tracking.

Parameters
  • this (obj) – TrackerData instance.

  • feature (str) – Any segmentation feature to use to threshold the data before tracking. SegmentationData

  • threshold (float) – Threshold. Feature values below the threshold are selected.

  • neighbourhoodSearchRadius (int) – Neighbourhood radius. Defaults to neighbourhoodSearchRadius

Returns

void – Acts on TrackerData object directly and deletes selected data below threshold.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.delByROI(this, roi, neighbourhoodSearchRadius)

DELETEBYROI Deletes segmentation objects outside a region of interest (ROI).

Parameters
  • this (obj) – TrackerData instance.

  • roi (array) – Region of interest defined by polygon vertices to keep data for tracking.

  • neighbourhoodSearchRadius (int) – Neighbourhood radius. Defaults to neighbourhoodSearchRadius

Returns

void – Acts on TrackerData object directly and deletes selected data outside ROI.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.delSegArtefacts(this, neighbourhoodSearchRadius, varargin)

DELSEGARTEFACTS Deletes potential segmentation artefacts (segmented objects which are no cells based the autofluorescence.

Parameters
  • this (obj) – TrackerData instance.

  • neighbourhoodSearchRadius (int) – Neighbourhood radius. Defaults to neighbourhoodSearchRadius

  • varargin (str varchar) –

    • channel (int): Channel number fluo_id of the fluorescent channel to use for segmentation artefact detection. Defaults to 1.

    • stdFactor (float): Factor standard deviation. Defaults to 2.

Returns

void – Acts on TrackerData object directly and deletes selected data.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.deleteData(this, dataIDToDelete, neighbourhoodSearchRadius)

DELETEDATA Deletes data elements (segmented objects). I.e cells as they are outside of a ROI, to close to the image border or should be excluded due togating.

Parameters
  • this (obj) – TrackerData instance.

  • dataIDToDelete (array, 1xk) – Array with uuids of cells to be deleted.

  • neighbourhoodSearchRadius (int) – Neighbourhood radius. Defaults to neighbourhoodSearchRadius

Returns

void – Acts on TrackerData object directly and deletes selected data.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.fillTrackHoles(this, imageFrameNumberArray, fingerprintHalfWindowSideLength, fingerprintMaxConsideredFrequencies, imageDir, imageFingerprintFileArray, imageCropCoordinateArray, neighbourhoodSearchRadius)

FILLTRACKHOLES is supposed to create a virtual segmentation object for image frames where a certain track index is missing but the image frame before and after still contain the object (cell). This holes (in time) exist when a cell was not segmented (detected) on a particular image frame but does exist.

Parameters
Returns

void – Acts on TrackerData.

Return type

(-)

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.getCloseCellNeighbourIdx(xCoordinateArray, yCoordinateArray, neighbourhoodSearchRadius, varargin)

GETCLOSECELLNEIGHBOURIDX Returns a square logical matrix of size length(x) where as 1 corresponds to a neighbour within the neighbourhoodSearchRadius.

Parameters
  • ignoredArg (obj) – TrackerData instance.

  • xCoordinateArray (array, kx1) – Array with x coordinates

  • yCoordinateArray (array, kx1) – Array with y coordinates

  • neighbourhoodSearchRadius – [Int] Radius in pixel within an other point defined by the coordinate arrays x and y is considered to be a neighbour of (x_i,y_i). neighbourhoodSearchRadius

Returns

closeNeighboursIdx – Square logical matrix selecting the neighbours within neighbourhoodSearchRadius.

Return type

array kxk

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.getCommonTrackDataSubset(~, oldFrame, newFrame, varargin)

GETCOMMONTRACKDATASUBSET Subsets oldFrame and newFrame data struct for common track indicies and returns the position for both frames sorted.

Parameters
  • ignoredArg (obj) – TrackerData instance.

  • oldFrame (obj) – Old frame instance

  • newFrame (obj) – New frame instance

  • varargin (str varchar) –

    • newTrackIndex (array): Newly assigned track indicies for newFrame

Returns

  • oldFrameSubset (array kx2) – Data subset for only x and y position of the oldFrame.

  • newFrameSubset (array kx2) – Data subset for only x and y position of the newFrame.

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.getConsecutiveCloseCellNeighbourIdx(xO, xOF, yO, yOF, trO, xN, yN, trN, neighbourhoodSearchRadius)

GETCONSECUTIVECLOSECELLNEIGHBOURIDX Returns the neighbourhood indices for consecutive image frames. It returns the joined neighbourhood for segmentation objects existing on both image frames, for segmentation objects only on the first and second frame respectively. The shape of the matrix is first times second frame in the order of the track index of the segmentation objects on the respective frames.

Parameters
  • xO (array, 1xN) – Array with x coordinates from oldFrame.

  • xOF (array, 1xN) – Array with filtered x coordinates from oldFrame.

  • yO (array, 1xN) – Array with y coordinates from oldFrame.

  • yOF (array, 1xN) – Array with filtered y coordinates from oldFrame.

  • trO (array, 1xN) – Array with track indices from oldFrame.

  • xN (array, 1xN) – Array with x coordinates from newFrame.

  • yN (array, 1xN) – Array with y coordinates from newFrame.

  • trN (array, 1xN) – Array with track indices from newFrame.

  • neighbourhoodSearchRadius (int) – neighbourhoodSearchRadius

Returns

  • joinedNeighbours array – Array with joined neighbourhood between old and new frame.

  • joinedNeighboursWMotion array – Array with joined neighbourhood including motion between old and new frame.

  • oldNeighbours array – Array with neighbourhood of oldFrame.

  • newNeighbours array – Array with neighbourhood of newFrame.

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.getFieldArrayColorMap(this, varargin)

GETFIELDARRAYCOLORMAP Returns a colormap for the properties/ field arrays. Special colormaps are returned for ‘track_index’, ‘track_parent’. If currTrack is given, all other tracks will be colored in grey.

Parameters
  • this (obj) – TrackerData instance.

  • varargin (str varchar) –

    • property (str): Property of SegmentationData for which colormap shold be returned. Defaults to track_index.

    • currTrack (int): Current track index if single track should be highlighted. Defaults to 0.

Returns

colormap – Returns the colormap

Return type

(array) kx3

Authors
  • Thomas Kuendig - initial implementation in GUI

  • Andreas P. Cuny - implementation in TracX core.

+TracX.@TrackerData.getFieldArrayForTrackIndexForFrame(this, fieldName, frameNumber, selectedTrackArray, varargin)

GETFIELARRAYFORTRACKINDEXFORFRAME Returns an array with values for a particular fieldname, frame and selected track.

Parameters
  • this (object) – TrackerData instance.

  • fieldName (str) – Fieldname where to get values from.

  • frameNumber (str) – Frame number for which one wants to get the fieldname values.

  • selectedTrackArray (array, kx1) – Array of track indicies for which one wants to get the values for the fieldname.

  • varargin (str varchar) –

    • fluoID (str): Fluorescent channel id fluo_id.

Returns

selectedFieldnameValueArray – Returns the value array for the selected track indicies for the given fieldName on the given frame.

Return type

array

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.getMaskBasedDPairs(~, maskParentFrame, maskDaughterFrame, parentCandidate)

GETMASKBASEDDPAIRS Based on tracked segmentation masks the most likely daughter pair track indices for a parent candidate will be returned. Otherwise -1. Based onthe candidates with the highest intersection over the union score.

Parameters
  • this (object) – TrackerData instance.

  • maskParentFrame (double) – Parent segmentation masks frame.

  • maskDaughterFrame (double) – Daughter segmentation masks frame.

  • parentCanditate (int) – Parent candidate track index.

Returns

candPairID – Array of the daughter candidates.

Return type

array

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.getMotionCorrNeighbours(this, frameNumber, neighbourhoodSearchRadius)

GETMOTIONCORRNEIGHBOURS Computes the eucledian distance among consecutive image frames correcting for potential motion. Returns the neighbourhood below the neighbourhoodSearchRadius as locial matrix as well as the actual distances

Parameters
Returns

  • distLocM array – Eucledian distance among segmented objects on consecutive image frames below distance threshold

  • distM array – Eucledian distance among segmented objects on consecutive image frames

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.getPotSegArtefacts(this, varargin)

GETPOTSEGARTEFACTS Determines potential segmentation artefacts based on a fluorescent channel and returns the uuid, track and cell indices to delete.

Parameters
  • this (object) – TrackerData instance.

  • varargin (str varchar) –

    • channel (int): Channel number fluo_id of the fluorescent channel to use. Defaults to 1.

    • stdFactor (float): Factor standard deviation. Defaults to 2.

Returns

  • uuidToDel array – Array of uuids of segmentation objects to delete.

  • trToDelFrame array – Array of frames of segmentation objects to delete.

  • ciToDel array – Array of cell indices of segmentation objects to delete.

  • segArtefactsL array – Array of positive segmentation artefacts.

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.getSortIdxForTrackIndices(this, varargin)

GETSORTIDXFORTRACKINDICES Returns an array of indices to sort track_index on each frame in ascending (default) or descending order.

Parameters
  • this (object) – TrackerData instance.

  • varargin (str varchar) –

    • direction (str): Sorting direction. Defaults to ascending ‘a’. Otherwise ‘d’.

Returns

Sorting indices for ordering arrays.

Return type

sortIdx array

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.getStartEndFrameOfTrack(~, cellFrameArray, trackIndexArray)

GETSTARTENDFRAMEOFTRACK Determines for each cell track with a track index its first and last occuring image frame.

Parameters
  • ignoredArg (object) – TrackerData instance.

  • cellFrameArray (array, kx1) – Array of image frame numbers for each segmentet cell. cell_frame

  • trackIndexArray (array, kx1) – Array of track indicies. track_index

  • trackFingerprintDistanceArray (array) – Array of track fingerprint distances for trackIndexArray

  • trackAssignmentFractionArray (array) – Array of track assignment fractions for trackIndexArray

  • fingerprintDistThreshold (float) – Fingerprint distance threshold defined by fingerprintDistThreshold

Returns

  • startFrameArray array kx1 – Array with frame number where track i first occured.

  • endFrameArray array kx1 – Array with frame number where track i last occured.

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.getTrackAssignmentReconsiderationArray(~, trackIndexArray, trackFingerprintDistanceArray, trackAssignmentFractionArray, fingerprintDistThreshold)

GETTRACKASSIGNMENTRECONSIDERATIONARRAY Returns an array with track indicies where the track assignment has to be re-considered as the fingerprint distance is above the threshold given.

Parameters
  • ignoredArg (object) – TrackerData instance.

  • trackIndexArray (array) – Array of track indicies. track_index

  • trackFingerprintDistanceArray (array) – Array of track fingerprint distances for trackIndexArray

  • trackAssignmentFractionArray (array) – Array of track assignment fractions for trackIndexArray

  • fingerprintDistThreshold (float) – Fingerprint distance threshold defined by fingerprintDistThreshold

Returns

Array with track indicies to reconsider the assignment.

Return type

trackAssignmentReconsiderationArray array kx1

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.getUUIDOutsideROI(this, imgSize, roi)

GETUUIDOUTSIDEROI Returns data uuids for cells on an image outside a region of interest (roi). Roi can be either an offset value from the image border or an impoly object.

Parameters
  • this (object) – TrackerData instance.

  • imgSize (array, 1x2) – Size of image.

  • roi (array) – Image border offset or a impoly object

Returns

  • uuidsOutsideMask array kx1 – Array with data uuids outside of the roi masked image region.

  • outsideMaskIdx array kx1 – Indices array for data outside of the roi masked image region.

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.importAlphaShapes(this, resultDir)

IMPORTALPHASHAPES Function to import alpha shapes from cells*.mat files from the segmentation results directory.

Parameters
Returns

Acts on TrackerData instance.

Return type

void -

Authors

Thomas Kuendig - initial implementation

+TracX.@TrackerData.importAlphaShapesForFrame(~, frame, resultDir, reducedShapes)

IMPORTALPHASHAPESFORFRAME Function to import alpha shapes from cells*.mat files for a specific frame.

Parameters
  • ignoredArg (object) – TrackerData instance.

  • frame (int) – Frame number

  • resultDir (array) – Segmentation results folder segmentationResultDir

  • reducedShapes (bool) – Flag if reduced alpha shapes should be loaded.

Returns

Imported alphashape for current frame.

Return type

current_alphashapes array

Authors

Thomas Kuendig - initial implementation

+TracX.@TrackerData.insertMergedData(this, data, tracks2Merge)

INSERTMERGEDDATA Inserts the data after merging the masks of the bud with its assigned mother until detected division and re segmentation and quantification into TrackerData.

Parameters
  • this (object) – TrackerData instance.

  • data (array) – Data array

  • tracks2Merge (array) – Array of track indices to be merged.

Return type

void -

Note

We only want to update relevant segmentation fields that changed but all quantification fields except uuid (key into SegmentationData), fluo_id and fluo_name as they stay the same. ‘cell_index’ has no interpretation anymore as it refers to the initial segmentation masks. the ‘final_track_mask’ use the track_index as id. Other fields such as cell_diff_x, fingerpint, costs are outdated and could could only be updated by rerunning the full tracker + lineage_reconstruction from the ‘final_track_mask’ which would be largely redundanant and unnecessary costly.

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.insertNewData(this, absentFrameArray, trackArray, fingerprintHalfWindowSideLength, fingerprintMaxConsideredFrequencies, imageDir, imageFingerprintFileArray, imageCropCoordinateArray, neighbourhoodSearchRadius)

INSERTNEWDATA Inserts a virtual object into SegmentationData for a certain track in a certain image frame. Due to miss- or missing segmentation on some frames the existing data is wrong or missing and should not be used for tracking. But that a cell trace continues to exist on all image frames a virtual ‘cell’ with properties from the last existing valid occurance wil be added.

Parameters
Return type

void -

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.joinTrackerDataAsTable(this)

JOINTRACKERDATAASTABLE column binds the fields of SegmentationData and QuantificationData in wide format.

Parameters

this (object) – TrackerData instance.

Return type

void -

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.mapCrop2RawCoordinates(this, imageCropCoordinateArray)

MAPCROP2RAWCOORDINATES Maps ProjectConfiguration.imageCropCoordinateArray coordinates to original raw image coordinates.

Parameters
Return type

void -

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.reshapeDataToTrackerTableFormat(this, rawData, currentFrameFieldNameArray)

RESHAPEDATATOTRACKERTABLEFORMAT Reshapes the imput data table i.e. CellX results table into the correct width. CellX adds the quantification of multiple fluorophores as additional columns to the data table which makes it hard to deal with this kind of data of various colum length. Therefore we reshape the data into a thight colum format specifing potential multiple fluorophores as additional row identified by a id (fluo.id) and the name as string in (fluo.name).

Parameters
  • this (object) – TrackerData instance.

  • rawData (array) – Imported raw data from segmentation software i.e CellX in single text file per image frame format.

  • currentFrameFieldNameArray (array) – Array with field name of cellXImportedRawData (i.e. cell_frame, cell_area).

Returns

Returns TrackerData

Return type

void -

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.setCellPoleCoordinates(this)

SETCELLPOLECOORDINATES Calculates the two cell poles coordinates (x,y) from cell major axis and cell orientation given the cell center coordinate array for rod shaped segmentation objects.

Parameters

this (object) – TrackerData instance.

Returns

Calculated field cell_poles with coordinates for cell poles of symetrically dividing cells saved to TrackerData.

Return type

void -

Authors

Andreas P. Cuny - initial implementation

+TracX.@TrackerData.setParentSymDivCells(this, startFrame, endFrame, imageFrameNumberArray, segmentationResultDir, trackerResultMaskFileArray)

SETPARENTSYMDIVCELLS Determines the relationship between daughter and mother cell of symmetricaly dividing cells.

Parameters
  • this (object) – TrackerData instance.

  • startFrame (int) – Number of the first frame of the project where to start the mother daughter assignment.

  • endFrame (int) – Number of the last frame of the project where to end the mother daughter assignment.

  • imageFrameNumberArray (array) – Array with all image frame numbers for current project. This function evaluates this array in the range startFrame to endFrame.

  • segmentationResultDir (str) – Path to segmentation results.

  • trackerResultMaskFileArray (array) – Array with tracker result mask filenames.

Returns

Saves track_parent and cell_pole_age information into SegmentationData directly.

Return type

void -

Authors

Andreas P. Cuny - initial implementation

Utils

class +TracX.@Utils.Utils

UTILS Defines general utility functions used for TracX.

Authors

Andreas P. Cuny - initial implementation

Utils()

UTILS Constructor of TracX.Utils class.

Returns

obj – Returns a Utils instance.

Return type

object

Authors

Andreas P. Cuny - initial implementation

+TracX.@Utils.checkToolboxStatus(this)

CHECKTOOLBOXSTATUS Checks if all required Matlab toolboxes are installed. Returns 1 if all installed, 0 otherwise.

Parameters

this (obj) – Tracker object

Returns

status – Returns 1 if all installed, 0 otherwise.

Return type

(array Nx3)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Utils.downloadFile(this, url, fileName)

DOWNLOADFILE Downloads a file and returns the path.

Parameters
  • this (obj) – Tracker object

  • url (str) – URL to the file to be downloaded

  • fileName (str) – Name of the downloaded file.

Returns

dest – Returns the file url/location on the system.

Return type

(str)

Authors
  • Andreas P. Cuny - Initial implementation

+TracX.@Utils.getBWLabelColor(colorMap)

GETBWLABELCOLOR Returns either a black or white colormap that should be well readable on an given input colorMap.

Parameters

colorMap (array Nx3) – Colormap

Returns

color – BW colormap

Return type

(array Nx3)

Authors

Thomas Kuendig - initial implementation

+TracX.@Utils.getColorMap(intendedSize, varargin)

GETCOLORMAP Returns a colormap of a user defined size with well distingushable colors.

Parameters
  • intendedSize (int, 1x1) – Size of final colormap

  • varargin (array, Nx3) – [Optional] customColorMap which will be resized to intended size (color pattern will be repeated until final size is reached).

Returns

cmap – Color map with user defined size based on colors defined in colorScheme1 (repetitions).

Return type

(array Nx3)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Utils.getCommonLogical(logicalA, logicalB)

GETCOMMONLOGICAL Get common logical of the subset of the logical array A and a logical array B of the size of the subset of logical A.

Parameters
  • logicalA (array, Nx1) – Logical array A.

  • logicalB (array, Mx1) – Logical array B.

Returns

  • logicalA (array Nx1) – Logical array including logicalB but of size logicalA.

  • logicalAOnlyB (array Nx1) – Logical array of size logicalA but only containing logicalB.

Authors

Andreas P. Cuny - initial implementation

+TracX.@Utils.getMaxNumCompThreads()

GETMAXNUMCOMPTHREADS Returns the maximal number of compute threads.

Parameters

ignoredArg (obj) – +TracX.@Utils

Returns

ret – Color map with user defined size based on colors defined in colorScheme1 (repetitions).

Return type

(int)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Utils.getRecursiveTrackParentColoring(this, root, color, colormap, trackIndex, trackParent)

GETRECURSIVETRACKPARENTCOLORING Modifies an existing colormap such that track parents are colored at a distance to the input color proportional to the length of the track.

Parameters
  • this (object) – Utils instance.

  • root (int) – Root track index

  • color (int) – Color

  • colormap (int, Nx3) – Color map

  • trackIndex (array, Nx1) – Track index array

  • trackParent (array, Nx1) – Track parent array

Returns

colormap – Color map

Return type

array Nx3

Authors

Thomas Kuending - initial implementation

+TracX.@Utils.getSegAreaBoundingBox(xc, yc, offset)

GETSEGAREABOUNDINGBOX Returns the bounding box of an image area that has been segmented to focus/zoom on this particular area for image visualization purpose.

Parameters
  • xc (array Nx1) – Array of x components of segmented objects.

  • yc (array Nx1) – Array of y components of segmented objects.

  • offset (int) – Offset from true corner points of segmented area.

Returns

  • bx (int, 1x1) – X component of bounding box.

  • by (int, 1x1) – Y component of bounding box.

  • bw (int, 1x1) – Width component of bounding box.

  • bh (int, 1x1) – Height component of bounding box.

Authors

Andreas P. Cuny - initial implementation

+TracX.@Utils.imcrop3C(s, cuboidWindow)

IMCROP3C Custom fast implementation on Matlabs imcrop3 to crop a 3D image.

Parameters
  • s (double NxNx3) – 3D image stack

  • cuboidWindow (array 1x6) – Crop coordinates in the form of [x, y, z, w, h, l]

Returns

ret – Croped 3D image stack.

Return type

(double NxNx3)

Authors

Thomas Kuendig - initial implementation

+TracX.@Utils.imcropC(image, imageCropCoordinateArray)

IMCROPC Crop image. Custom imcrop function. Faster (~3.5-6x) than native MATLAB interactive imcrop function.

Parameters
  • image (double, NxM) – Image matrix

  • imageCropCoordinateArray (int, 1x4) – Array with coordinates to crop an image. imageCropCoordinateArray

Returns

crop – Croped image matrix.

Return type

(double NxM)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Utils.insertValueAtIdx(arrIn, val, idx)

INSERTVALUEATIDX Inserts an array of values a at a certain position within array b.

Parameters
  • arrIn (array 1xM) – Array where values have to be inserted.

  • val (array 1xN) – Array with values to insert.

  • idx (int 1x1) – Index withing arrIn where.

Returns

arrOut – Final array with inserts

Return type

(array 1x(M+N))

Authors

Andreas P. Cuny - initial implementation

+TracX.@Utils.isPointInsideEllipse(x, y, x0, y0, theta, minorAxis, majorAxis)

ISPOINTINSIDEELLIPSE Determines if a point P(x,y) lays inside or on the ellipse boundaries given by E(x0,y0, theta, minorAxis, majorAxis).

Parameters
  • x (float, Nx1) – x coordinate of query point.

  • y (float, Nx1) – y coordinate of query point.

  • x0 (float, 1x1) – x coordinate of ellipse center.

  • y0 (float, 1x1) – y coordinate of ellipse center.

  • theta (float, 1x1) – angle of ellipse rotaion in degrees.

  • minorAxis (float, 1x1) – minorAxis length of ellipse.

  • majorAxis (float, 1x1) – majorAxis length of ellipse.

Returns

Result array. If ret < 1 := inside ellipse else if ret == 1 := on ellpise else ret > 1 := outside ellipse.

Return type

ret (Nx1, float)

Example:

>>> printToConsole('My message')
06-Jun-2017 11:30:30:  My message
Authors

Andreas P. Cuny - initial implementation

+TracX.@Utils.natSortNames(X, varargin)

NATSORT Wrapper to alphanumeric / Natural-Order sort of a cell array of filenames/filepaths. See TracX.ExternalDependencies.natsortfiles for detailed information.

Parameters
  • X (double 1xN) – Array to be sorted

  • varargin (str) – Additional input arguments. See TracX.ExternalDependencies.natsortfiles for detailed information.

Returns

  • X (array 1xN) – Cell of Strings, <X> with all strings sorted into natural-order.

  • ndx (arrax 1xN) – Numeric Array, such that Y = X(ndx). The same size as <X>.

Authors

Andreas P. Cuny - initial implementation

+TracX.@Utils.padImageCrop(image, imageCropCoordinateArray)

PADIMAGECROP creates an image crop of the 2D input image (NxM) applying the crop coordinates. It fills crops at the image border with zeros to always keep the same imgOut image size (image padding).

Parameters
  • image (uint16 NxN) – Image matrix

  • imageCropCoordinateArray (int 1x4) – Array with coordinates to crop an image. imageCropCoordinateArray

Returns

paddedImage – Image matrix with exact size indicated by imageCropCoordinateArray where as regions outside the input images are set to 0 but the size given by imageCropCoordinateArray is maintained.

Return type

(uint16, NxM)

Authors

Andreas P. Cuny - initial implementation

+TracX.@Utils.printTimeLeft(taskName, actStep, totStep)

PRINTTIMELEFT printTimeLeft(taskName, actStep, totStep) prints the remaining time in a computation when actStep steps out of totSteps have been made. taskName is a String describing what will be computed A “tic” must have been called at the beginnig of the computation. This code must be called at the end of the step act_step (and not at the beginning). To reduce the computaton overhead, the code will only be active if floor(percentage) has changed in the last step (this can easy be removed by deleting the first ‘if’ condition).

Parameters
  • taskName (str, 1x1) – Name of the task.

  • actStep (int, 1x1) – Current step of the evaluation totStep (int, 1x1): Total number of steps in this task/loop.

Returns

Prints to console directly

Return type

void (str)

Example:

>>> tic
>>> for i = 1:10
>>>    printTimeLeft('MyTask', i, 10)
>>> end
Authors
  • Nicolas Le Roux [lerouxni@iro.umontreal.ca] - initial implementation July, 20th, 2005

  • Andreas P. Cuny - Restructured code and modified design of waitbar for TracX

+TracX.@Utils.printToConsole(message)

PRINTTOCONSOLE Outputs logging/status information to the console with a time stamp. A static function in Utils.

Parameters

message (str) – Message to be printed to the console.

Returns

Prints message to console directly.

Return type

void (str)

Example:

>>> printToConsole('My message')
06-Jun-2017 11:30:30:  My message
Authors

Andreas P. Cuny - initial implementation

+TracX.@Utils.progressBar(total, varargin)

PROGRESSBAR Wrapper around a class to provide a convenient and useful progress bar

Parameters
  • total (int) – The total number of iterations [default: []] matrix

  • varargin (array) – Title - the progress bar’s title shown in front [default: ‘Processing’] Unit - the unit of the update process. Can either be ‘Iterations’ or ‘Bytes’ [default: ‘Iterations’] UpdateRate - the progress bar’s update rate in Hz. Defines the printing update interval [default: 5 Hz]

Returns

retBin – Returns a progressBar instance.

Return type

(object)

Authors
  • J.-A. Adrian (JA) [jensalrik.adrian AT gmail.com] - initial implementation 28-Jun-2016 16:52

  • Andreas P. Cuny - Wrapper around ProgressBar for TracX

+TracX.@Utils.progressUpdateParallel(stepSize, workerDirName)

UPDATEPARALLEL Wrapper around update function when ProgressBar is used in parallel setup. For details see TracX.ExternalDependencies.matlabProgressBar

Parameters
  • stepSize (int) – The size of the progress step when the function is called. This can be used to pass the number of processed bytes when using ‘Bytes’ as units. If bytes are used be sure to pass only integer values. [default: stepSize = 1]

  • workerDirName (str) – Directory where the worker aux. files will be saved. This can be specified for debug purposes or if multiple progress bars in a parallel setup would get in each other’s way since all have the same file pattern and would distract each progress bar’s progress state. [default: workerDirName = tempdir()]

Returns

filePattern – The common beginning of every file name before the unique part begins. This is an auxiliary function output which is used by the ProgressBar() class. Typically not be of interest for the user. The variable is only returned if no input arguments were passed!

Return type

(str)

Example:

>>> [pattern] = updateParallel(1, pwd)
Authors
  • J.-A. Adrian (JA) [jensalrik.adrian AT gmail.com] - initial implementation 28-Jun-2016 16:52

  • Andreas P. Cuny - Wrapper around updateParallel for TracX

+TracX.@Utils.rgb2java(rgb)

RGB2JAVA Convert uint8 rgb Matlab image to Java BufferedImage.

Parameters

rgb (array, NxM) – RGB Matlab image

Returns

image – Java BufferedImage

Return type

(array NxM)

Note

Adopted from original im2java2d.m (Matlab) that fails to run with parfor / parpool due to inexistent ‘swing’ check.

Authors

Andreas P. Cuny - initial implementation Aaron Ponti - initial implementation