Core Classes¶
TrackerCommandLineParser¶
- class TracX.@TrackerCommandLineParser.TrackerCommandLineParser¶
Bases:
handleTrackerCommandLineParser Command-line interface for TracX batch processing.
- Lives under the TracX package folder so it is called as:
parser = TracX.TrackerCommandLineParser(args);
- Logging is delegated to the Tracker’s own utility:
Tracker.utils.printToConsole(msg)
which produces timestamped output identical to the interactive session. Before the Tracker instance exists the parser formats its own timestamps.
- USAGE (compiled executable)
TracXRunner <projectConfig.xml> [options] TracXRunner <trackerState.mat> [options] TracXRunner –create-project [–create-* options] TracXRunner <source> –call <method.path> [–call-arg <v>]… [–call-out <file>]
- USAGE (MATLAB source)
parser = TracX.TrackerCommandLineParser({‘project.xml’,’–verbose’}); parser.run();
- REQUIRED (normal run)
- <projectConfig.xml> OR <trackerState.mat>
Either an existing TracX project XML (created by GUI or CLI), or a .mat state file saved by Tracker.saveCurrentTrackerState(). The .mat file contains a fully configured Tracker instance which may already have tracking results — useful for post-processing, debugging, or continuing interrupted work without re-running.
- GLOBAL OPTIONS
- --workflow
<file|keyword> Workflow XML or .m script (see keywords below)
- --state
<file.mat> Load Tracker from a .mat state file (alternative to passing it as first argument)
- --output
<dir> Override tracker results directory
- --image-dir <dir>
Override image directory in project XML
- --seg-dir
<dir> Override segmentation results directory
- --log
<file> Append all console output to a log file
- --dryrun
Validate inputs only; do not run
- --verbose
Extra diagnostic output
–help | -h Print this help and exit
- INLINE CALL MODE (–call)
Calls any single method reachable from the Tracker instance without needing a workflow file. Useful for interactive debugging, one-off queries, and wrapper scripts.
- --call
<method.path> Dotted method path relative to Tracker, e.g. imageProcessing.overlayMaskOnImage
io.readFromXML configuration.ParameterConfiguration.setMaxCellCenterDisplacement runTracker
- --call-arg
<value> Typed argument passed to the method. Repeat for each argument. Type inference:
true / false -> logical 3.14 / [1 2 3] -> double (eval’d) anything else -> char string
- Quote strings to protect them:
–call-arg “‘BFdivide’”
- --call-out
<file> Write any return value as CSV to this file (stdout is always used regardless).
- EXAMPLES
- TracXRunner state.mat –call imageProcessing.overlayMaskOnImage
–call-arg image.tif –call-arg mask.tif
- TracXRunner state.mat –call data.getFieldArray
–call-arg “‘track_index’” –call-arg 1 –call-out tracks.csv
- TracXRunner state.mat –call configuration.ParameterConfiguration.setMaxCellCenterDisplacement
–call-arg 25
- CALLMETHOD WORKFLOW STEP
The same capability is available as a workflow step named CallMethod, enabling arbitrary method calls within an XML workflow sequence. Params:
Method (required) dotted method path Args pipe-delimited typed arg list: “25|false|some/path” Delimiter CSV delimiter for output (default ,) OutFile optional output CSV file
- BUILT-IN WORKFLOW KEYWORDS
- default LoadProject -> OverridePaths -> ClearData -> ImportData
-> RunTracker -> SaveState -> SaveProject -> SaveTable -> SaveControlImages
yeast default + RevertCrop + RunLineage + SaveCellCycleTable tuning Test steps only; saves project XML at end generic-masks PrepareGenericMasks -> LoadCustomProject -> default pipeline
- PROJECT CREATION FLAG
- --create-project
Enter the interactive project-creation wizard (create_project.m). All –create-* options below are forwarded to it; they may also be supplied without –create-project to run non-interactively.
- PROJECT CREATION OPTIONS
- --create-name
<str> Project name
- --create-image-dir
<dir> Path to raw images
- --create-seg-dir
<dir> Path to segmentation results
- --create-fp-channel
<str> Fingerprint channel identifier (e.g. BFdivide)
- --create-lineage-ch
<str> Lineage marker channel (e.g. mKate)
- --create-well-id
<str> Well-position identifier (empty = none)
- --create-crop
<x,y,h,w> CellX crop coordinates (empty = none)
- --create-movie-length
<int> Number of frames to track
- --create-division-type <str>
asym | sym
- --create-from-generic-segmentation
<bool> true/false. creates
minimal project file for tracking from generic segmentation masks. –create-run-tuning Also run tuning workflow after creation
- WORKFLOW STEP NAMES
- Project / data lifecycle
LoadProject Tracker.loadTrackingProject(dir, file) LoadCustomProject Creates a full TracX project file from a
minimal generic masks project.
OverridePaths Apply –image-dir / –seg-dir / –output ClearData Tracker.data.clearAllData() ImportData Tracker.importData() RevertCrop Tracker.revertSegmentationImageCrop()
- Image / filename utilities
ParseFileNames Tracker.io.imageFileNameParser(…) ConvertFileNames Tracker.io.convertImageFileNames(…) DestackTif Tracker.io.destackTimepoints(…)
- Segmentation preparation
PrepareGenericMasks Tracker.prepareDataFromSegmentationMask(…)
- Segmentation filtering / constraint
RemoveArtefacts Tracker.deleteSegArtefacts(‘channel’,ch,’stdFactor’,f) RemoveByFeature Tracker.deleteByFeature(feature, threshold) RemoveAtBorder Tracker.deleteSegObjAtBorder(borderOffset) RemoveByROI Tracker.deleteByROI(roi)
- Test / diagnostic steps (write control images; do not alter state)
TestParameters Tracker.testTrackingParameters([start,end]) TestBudNeck Tracker.testBudNeckSegmentation(frame,…) TestMarkerTracking Tracker.testMarkerTrackingParameters([start,end]) TestArtefactRemoval Tracker.testSegmentationArtefactRemoval(frame,ch,std) TestFeatureRemoval Tracker.testFeatureDataRemoval(frame,feature,thresh) TestBorderRemoval Tracker.testImageBorderDataRemoval(frame,offset) TestROIRemoval Tracker.testROIDataRemoval(frame)
- Tracking
RunTracker Tracker.runTracker() RunLineage Tracker.runLineageReconstruction(…)
- Manual corrections
CorrectLineage Tracker.correctMDMisassignment(daughters, mothers) CorrectTracks Tracker.correctTrackMisassignment(frames, old, new)
- Save / export
SaveState Tracker.saveCurrentTrackerState(…) SaveProject Tracker.saveTrackingProject(filePath, fileName) SaveTable Tracker.saveTrackerResultsAsTable(…) SaveCellCycleTable Tracker.saveTrackerCellCycleResultsAsTable(…) SaveControlImages Tracker.saveTrackerProjectControlImages(…)
- Visualisation
PlotAnnotated Tracker.imageVisualization.plotAnnotatedControlImageFrame(…) PlotFingerprint Tracker.imageVisualization.plotFingerprintControlImageFrame(…) PlotTracking Tracker.imageVisualization.plotTrackControlImageFrame(…) PlotPoleAge Tracker.imageVisualization.plotPoleAgeControlImageFrame(…) PlotLineageTree Tracker.imageVisualization.plotLineageTree(…) GenerateMovie Tracker.imageProcessing.generateLineageMovie(…) GenerateMarkerSeries Tracker.imageProcessing.generateMarkerTimeSeriesImage(…)
- Data retrieval (CSV to stdout + optional file; no timestamp in output)
ExportFieldArray Tracker.data.getFieldArray(property, channelId) ExportFieldFrame Tracker.data.getFieldArrayForFrame(property,frame,ch) ExportFieldTrack Tracker.data.getFieldArrayForTrackIndex(property,track,ch)
- Arbitrary method call (any TracX API, including sub-objects)
CallMethod any Tracker method via dotted path + typed args
See also: TracX.TrackerWorkflow, tracx_main, create_project% :Authors:
Andreas P. Cuny - initial implementation
- Method Summary
- run()¶
Main entry point: parse -> validate -> execute.
Three top-level modes, selected by the first positional argument or by flags:
Normal workflow TracXRunner project.xml [–workflow …] State-file mode TracXRunner state.mat [–workflow …] Inline call mode TracXRunner project.xml –call method [args…]
TracXRunner state.mat –call method [args…]
Project creation TracXRunner –create-project [–create-* …]
Fingerprint¶
- 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) –FingerprintinstancecrfO (
array) – Fingerprint (CRF) array for oldFrame.crfN (
array) – Fingerprint (CRF) array fpr newFrame.dCRFAsgmt (
array) – Fingerprint distance (dCRF) of all assignments between old and newFramenhbrhdM (
array) – Neighbourhood indices locial matrix
- Returns:
FFPa (
array) – Fraction of neighbouring cells with lower dCRF for each assigned cellFFP (
array) – Fraction of neighbouring cells with lower dCRF (size of # neighbour)NNFPa (
array) – Sum of dCRFDiff > 0 for each assigned cellNNFP (
array) – Sum of dCRFDiff > 0 (size of # neighbour)nNhbra (
array) – Total number of neighbouring cells for each assigned cellnNhbr (
array) – Total number of neighbouring cells (size of # neighbour)
- 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) –Fingerprintinstanceimg (
uint8NxNx3 uint8, 16, 32, 64) – Image matrixfingerprintResizeFactor (
int) – +TracX.ParameterConfiguration.fingerprintResizeFactorfingerprintMaxConsideredFrequencies (
int) – +TracX.ParameterConfiguration.fingerprintMaxConsideredFrequencies
- Returns:
retFq – [1x64] Real frequency fingerprint array.
- Return type:
float1xM- Authors:
Tomas Kuendig - 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) –FingerprintinstancefromFrame (
int) – Starting frame for calculationtoFrame (
int) – End frame for calculationfingerprintHalfWindowSideLength (
int) – +TracX.ParameterConfiguration.fingerprintHalfWindowSideLengthfingerprintResizeFactor (
int) – +TracX.ParameterConfiguration.fingerprintResizeFactorfingerprintMaxConsideredFrequencies (
int) – +TracX.ParameterConfiguration.fingerprintMaxConsideredFrequenciesimageDir (
str) – +TracX.ProjectConfiguration.imageDirimageFingerprintFileArray (
cell array1xK) – +TracX.ProjectConfiguration.imageFingerprintFileArrayimageCropCoordinateArray (
double1x4) – +TracX.ProjectConfiguration.imageCropCoordinateArraycellFrameArray (
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 Zplaneactive3DFingerprint (
bool) – Switch for active 3D fingerprint.
- Returns:
retFq – fingerprints for each segmented object.
- Return type:
doubleArray with the real- Authors:
Tomas Kuendig - 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:
this (
object) –Fingerprintinstancedata (
object) –TrackerDatainstancestartFrame (
int) –trackerStartFrameendFrame (
int) –trackerEndFrame
- 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) –FingerprintinstancexFPDistAssigned (
array1xN) – Fingerprint distance of all assignmentsxFPDistAssignedToCompare (
array1xM) – Fingerprint distances of neighbouring cells for each assigned cell.yDeltaDistAssigned (
array1xN) – Delta distance of all assignments to the minimal FPdist of all possible assignments for each cell.yDeltaDistToCompare (
array1xM) – Delta distance of all assignments to their comparator (i.e. its direct neighbours or all other cells)lowerQuantile (
float1x1) – Lower quantile in the range [0,1];
- Returns:
fpDistThreshold (
float1x1:) – Fingerprint distance threshold.fpDistThresholdMadCorr (
float1x1:) – Fingerprint distance threshold outlier corrected.fpDistanceSubset (
float1x1:) – Data used for fingerprint threshold determination.
- 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) –FingerprintinstancerealTrackFingerprintOldFrame (
cell array) – Real fingerprint array for all cells in the oldFramerealTrackFingerprintNewFrame (
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.computeAssignmentFingerprintDistanceArray(this, oldFrame, newFrame)¶
COMPUTEASSIGNMENTFINGERPRINTDISTANCEARRAY Computes the fingerprint distance for real fingerprints for all assigned cells between oldFrame and newFrame.
- Parameters:
this (
object) –FingerprintinstanceoldFrame (
object) –oldFramenewFrame (
object) –mewFrame
- Returns:
realFingerprintTrackDistance – Array with fingerprint distances from real fingerprints.
- Return type:
double- Authors:
Andreas P. Cuny - initial implementation
- 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) –FingerprintinstancefromFrame (
int) – Starting frame for calculationtoFrame (
int) – End frame for calculationfingerprintHalfWindowSideLength (
int) – +TracX.ParameterConfiguration.fingerprintHalfWindowSideLengthfingerprintResizeFactor (
int) – +TracX.ParameterConfiguration.fingerprintResizeFactorfingerprintMaxConsideredFrequencies (
int) – +TracX.ParameterConfiguration.fingerprintMaxConsideredFrequenciesimageDir (
str) – +TracX.ProjectConfiguration.imageDirimageFingerprintFileArray (
cell array1xK) – +TracX.ProjectConfiguration.imageFingerprintFileArrayimageCropCoordinateArray (
double1x4) – +TracX.ProjectConfiguration.imageCropCoordinateArraycellFrameArray (
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:
doubleArray with the real- Authors:
Andreas P. Cuny - 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) –FingerprintinstanceassignedFPdistTotalMovie (
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 distancestartIdx (
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
- 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 (
uint8NxNx1 uint8, 16, 32, 64) – Image matrixfingerprintResizeFactor (
int) –fingerprintResizeFactorfingerprintMaxConsideredFrequencies (
int) –fingerprintMaxConsideredFrequencies
- Returns:
retFq – [1x64] Real frequency fingerprint array.
- Return type:
float1xM- Authors:
Andreas P. Cuny - initial implementation
- class TracX.@Fingerprint.Fingerprint¶
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
- Constructor Summary
- 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
- Property Summary
- debugLevel¶
Debug level
- utils¶
TracX.@Utilsinstance implementing utility methods
- Method Summary
- computeAssignmentFingerprintDistanceArray(this, oldFrame, newFrame)¶
COMPUTEASSIGNMENTFINGERPRINTDISTANCEARRAY Computes the fingerprint distance for real fingerprints for all assigned cells between oldFrame and newFrame.
- Parameters:
this (
object) –FingerprintinstanceoldFrame (
object) –oldFramenewFrame (
object) –mewFrame
- Returns:
realFingerprintTrackDistance – Array with fingerprint distances from real fingerprints.
- Return type:
double- Authors:
Andreas P. Cuny - initial implementation
- 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:
this (
object) –Fingerprintinstancedata (
object) –TrackerDatainstancestartFrame (
int) –trackerStartFrameendFrame (
int) –trackerEndFrame
- 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
- computeFPDistThreshold(~, xFPDistAssigned, xFPDistAssignedToCompare, yDeltaDistAssigned, yDeltaDistToCompare, lowerQuantile)¶
COMPUTEFPDISTTHRESHOLD Computes the fingerprint distance threshold based on the lower quantile of negative delta distances.
- Parameters:
ignoredArg (
object) –FingerprintinstancexFPDistAssigned (
array1xN) – Fingerprint distance of all assignmentsxFPDistAssignedToCompare (
array1xM) – Fingerprint distances of neighbouring cells for each assigned cell.yDeltaDistAssigned (
array1xN) – Delta distance of all assignments to the minimal FPdist of all possible assignments for each cell.yDeltaDistToCompare (
array1xM) – Delta distance of all assignments to their comparator (i.e. its direct neighbours or all other cells)lowerQuantile (
float1x1) – Lower quantile in the range [0,1];
- Returns:
fpDistThreshold (
float1x1:) – Fingerprint distance threshold.fpDistThresholdMadCorr (
float1x1:) – Fingerprint distance threshold outlier corrected.fpDistanceSubset (
float1x1:) – Data used for fingerprint threshold determination.
- Authors:
Andreas P. Cuny - initial implementation
- 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 (
uint8NxNx1 uint8, 16, 32, 64) – Image matrixfingerprintResizeFactor (
int) –fingerprintResizeFactorfingerprintMaxConsideredFrequencies (
int) –fingerprintMaxConsideredFrequencies
- Returns:
retFq – [1x64] Real frequency fingerprint array.
- Return type:
float1xM- Authors:
Andreas P. Cuny - initial implementation
- 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) –Fingerprintinstanceimg (
uint8NxNx3 uint8, 16, 32, 64) – Image matrixfingerprintResizeFactor (
int) – +TracX.ParameterConfiguration.fingerprintResizeFactorfingerprintMaxConsideredFrequencies (
int) – +TracX.ParameterConfiguration.fingerprintMaxConsideredFrequencies
- Returns:
retFq – [1x64] Real frequency fingerprint array.
- Return type:
float1xM- Authors:
Tomas Kuendig - initial implementation
- 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) –FingerprintinstancecrfO (
array) – Fingerprint (CRF) array for oldFrame.crfN (
array) – Fingerprint (CRF) array fpr newFrame.dCRFAsgmt (
array) – Fingerprint distance (dCRF) of all assignments between old and newFramenhbrhdM (
array) – Neighbourhood indices locial matrix
- Returns:
FFPa (
array) – Fraction of neighbouring cells with lower dCRF for each assigned cellFFP (
array) – Fraction of neighbouring cells with lower dCRF (size of # neighbour)NNFPa (
array) – Sum of dCRFDiff > 0 for each assigned cellNNFP (
array) – Sum of dCRFDiff > 0 (size of # neighbour)nNhbra (
array) – Total number of neighbouring cells for each assigned cellnNhbr (
array) – Total number of neighbouring cells (size of # neighbour)
- Authors:
Andreas P. Cuny - initial implementation
- 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) –FingerprintinstancerealTrackFingerprintOldFrame (
cell array) – Real fingerprint array for all cells in the oldFramerealTrackFingerprintNewFrame (
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
- 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) –FingerprintinstancefromFrame (
int) – Starting frame for calculationtoFrame (
int) – End frame for calculationfingerprintHalfWindowSideLength (
int) – +TracX.ParameterConfiguration.fingerprintHalfWindowSideLengthfingerprintResizeFactor (
int) – +TracX.ParameterConfiguration.fingerprintResizeFactorfingerprintMaxConsideredFrequencies (
int) – +TracX.ParameterConfiguration.fingerprintMaxConsideredFrequenciesimageDir (
str) – +TracX.ProjectConfiguration.imageDirimageFingerprintFileArray (
cell array1xK) – +TracX.ProjectConfiguration.imageFingerprintFileArrayimageCropCoordinateArray (
double1x4) – +TracX.ProjectConfiguration.imageCropCoordinateArraycellFrameArray (
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:
doubleArray with the real- Authors:
Andreas P. Cuny - initial implementation
- 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) –FingerprintinstancefromFrame (
int) – Starting frame for calculationtoFrame (
int) – End frame for calculationfingerprintHalfWindowSideLength (
int) – +TracX.ParameterConfiguration.fingerprintHalfWindowSideLengthfingerprintResizeFactor (
int) – +TracX.ParameterConfiguration.fingerprintResizeFactorfingerprintMaxConsideredFrequencies (
int) – +TracX.ParameterConfiguration.fingerprintMaxConsideredFrequenciesimageDir (
str) – +TracX.ProjectConfiguration.imageDirimageFingerprintFileArray (
cell array1xK) – +TracX.ProjectConfiguration.imageFingerprintFileArrayimageCropCoordinateArray (
double1x4) – +TracX.ProjectConfiguration.imageCropCoordinateArraycellFrameArray (
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 Zplaneactive3DFingerprint (
bool) – Switch for active 3D fingerprint.
- Returns:
retFq – fingerprints for each segmented object.
- Return type:
doubleArray with the real- Authors:
Tomas Kuendig - initial implementation
- 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) –FingerprintinstanceassignedFPdistTotalMovie (
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 distancestartIdx (
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¶
- TracX.@ImageProcessing.generateMarkerControlImageFrame(this, frameNumber)¶
GENERATEMARKERCONTROLIMAGEFRAME Generates a marker tracking control image to visualize i.e budneck marker tracking.
- Parameters:
this (
object) –ImageProcessinginstanceframeNumber (
int) – Image frame number
- Returns:
Image matrix including segmentation mask of cell cycle marker.
- Return type:
labeledMask
arrayNxM- 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) –ImageProcessinginstancetracks2Merge (
arraykx1) – 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.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) –ImageProcessinginstanceimg (
uint8NxNx1 uint8, 16, 32, 64) – Image matriximageFrequency (
float) – Image frequency in hoursframe (
int) – Image frame numbervarargin (
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
unit8NxM- 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) –ImageProcessinginstanceimg (
uint8NxNx1 uint8, 16, 32, 64) – Image matriximageFrequency (
float) – Image frequency in hoursframe (
int) – Image frame numbervarargin (
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.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) –ImageProcessinginstancefromImageFrame (
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’; AnySegmentationDatapropertyvideoQuality (
int0-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.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) –ImageProcessinginstanceimage (
arrayNxM) – Image matrixmask (
array) – the specified channel with the in alpha specified transparency.varargin (
str varchar) –maskOverlayAlpha (
float0-1): Sets the transparency of the mask in the range[0,1].imageBrightness (
float0-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
doubleNxM- 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) –ImageProcessinginstancerootTrack (
int) – Track index of the lineage root to be visualized.imageFrequency (
float) – Image frequency in hoursmovieName (
str) – Name of the movievarargin (
str varchar) –figurePosition (
float): Figure position and size (x,y, width, height) array for the movie generation. Default is: [10 10 1350 600]videoQuality (
int0-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.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) –ImageProcessinginstanceframeNumber (
int) – Image frame numbervarargin (
str varchar) –useTrackIndices (
bool): If track indices should be used. Defaults to true. Othewise cell indices are used.customCMap (
arraykx3): Use custom colormat to color the cell segmentation masks. Otherwise auto generates one.
- Returns:
Image matrix with tracked cell segmentation masks.
- Return type:
labeledMask
arrayNxM- Authors:
Andreas P. Cuny - initial implementation
- TracX.@ImageProcessing.relabelMaskIndices(~, mask, newLabelArray, oldLabelArray)¶
RELABELMASKINDICES Relabels indices on a 2D mask [NxM].
- Parameters:
ignoredArg (
object) –ImageProcessinginstancemask (
uint16NxM) – Matrix with numerical labelsnewLabelArray (
int1xN) – Array containing the new numerical labels to replace the old ones with.oldLabelArray (
int1xN) – Array containing all the numerical labels of mask.
- Returns:
Matrix with labels replaced.
- Return type:
maskRelabeled
doubleNxM- 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) –ImageProcessinginstancerootTrack (
int) – Track index of the lineage root to be visualized.imageFrequency (
float) – Image frequency in hoursframe (
int) – Image frame numbervarargin (
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.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) –ImageProcessinginstancetrackToLabelArray (
array1xK) – Array of track numbers which should be labeled with their segmentation mask on an image.frameNumber (
int1x1) – Image frame numbervarargin (
str varchar) –maskOverlayAlpha (
float0-1): Sets the transparency of the mask in the range[0,1].imageBrightness (
float0-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:
arrayNxM- 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
ddoubleNxM- Authors:
Sotiris Dimopoulos - initial implementation in CellX
- Authors:
Andreas P. Cuny - adaptation for TracX
- 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) –ImageProcessinginstanceimageFilePath (
str) – Path to image locationsegmentationResultDir (
str) – Path to segmentation result files.imageFileNameArray (
str1xN) – Cell array with image file namestrackerResultMaskArray (
str1xN) – Cell array with tracker mask file names.cycleMarker (
array1x2) – 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 (
int1x1) – 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:
arrayWxHx3xN- 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) –ImageProcessinginstance- Returns:
void – Corrected masks are saved directly to disk.
- Return type:
(
-)- 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) –ImageProcessingobjectframeNumber (
int) – Image frame number.varargin (
str varchar) –fieldName (
str): Property to be displayed on the image. Defaults to ‘track_index’ can be any propery ofTracX.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).
- fontSize (
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.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) –ImageProcessinginstancehalfWindowLength (
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.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) –ImageProcessinginstanceimageFilePath (
str) – Path to image locationsegmentationResultDir (
str) – Path to segmentation result files.imageFileNameArray (
str1xN) – Cell array with image file namestrackerResultMaskArray (
str1xN) – Cell array with tracker mask file names.coiFrameArray (
int1xN) – Array with frame number for cell of interest.cellCenterXArray (
int1xN) – Array with x coordinates for the cell of interest.cellCenterYArray (
int1xN) – 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 (
int1xN) – Array of image frames where a tracked cell is present.trackIndexArray (
int1xN) – Array with track indicestrackOI – selected Track (current track of interest)
trackContainedInTrack (
int1xN) – 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:
arrayWxHx3xN- 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) –ImageProcessinginstanceproperty (
str) –SegmentationDataproperty
- Returns:
cMap
floatKx3 – Color map for track indicescMapFull
floatKx3 – Full color mapcLim
float1x2 – Min and max property values
- 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) –ImageProcessinginstancefontSize (
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
doubleNxM- Authors:
Andreas P. Cuny - initial implementation
- class TracX.@ImageProcessing.ImageProcessing¶
ImageProcessing Class for processing image matrices. It implements methods to generate various control images.
- Authors:
Andreas P. Cuny - initial implementation
- Constructor Summary
- ImageProcessing(io, configuration, data, utils, lineage)¶
Constructor of an
ImageProcessingobject- Parameters:
io (
object) –TracX.@IOinstance.configuration (
object) –TracX.@TrackerConfigurationinstance.data (
object) –TracX.@TrackerDatainstance.utils (
object) –TracX.@Utilsinstance.lineage (
object) –TracX.@Lineageinstance.
- Returns:
ImageProcessinginstance- Return type:
obj (
object)- Authors:
Andreas P. Cuny - initial implementation
- Property Summary
- configuration¶
TracX.@TrackerConfigurationinstance with the tracking parameters and project metadata
- data¶
TracX.@TrackerDatainstance stores all segmentation, quantification and lineage data.
- lineage¶
TracX.@Lineageinstance implementing lineage methods
- utils¶
TracX.@Utilsinstance implementing utility methods
- Method Summary
- 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) –ImageProcessinginstanceimg (
uint8NxNx1 uint8, 16, 32, 64) – Image matriximageFrequency (
float) – Image frequency in hoursframe (
int) – Image frame numbervarargin (
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
unit8NxM- Authors:
Andreas P. Cuny - initial implementation
- 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
ddoubleNxM- Authors:
Sotiris Dimopoulos - initial implementation in CellX
- Authors:
Andreas P. Cuny - adaptation for TracX
- 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) –ImageProcessinginstanceimageFilePath (
str) – Path to image locationsegmentationResultDir (
str) – Path to segmentation result files.imageFileNameArray (
str1xN) – Cell array with image file namestrackerResultMaskArray (
str1xN) – Cell array with tracker mask file names.coiFrameArray (
int1xN) – Array with frame number for cell of interest.cellCenterXArray (
int1xN) – Array with x coordinates for the cell of interest.cellCenterYArray (
int1xN) – 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 (
int1xN) – Array of image frames where a tracked cell is present.trackIndexArray (
int1xN) – Array with track indicestrackOI – selected Track (current track of interest)
trackContainedInTrack (
int1xN) – 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:
arrayWxHx3xN- Authors:
Andreas P. Cuny - initial implementation
- 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) –ImageProcessinginstanceimageFilePath (
str) – Path to image locationsegmentationResultDir (
str) – Path to segmentation result files.imageFileNameArray (
str1xN) – Cell array with image file namestrackerResultMaskArray (
str1xN) – Cell array with tracker mask file names.cycleMarker (
array1x2) – 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 (
int1x1) – 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:
arrayWxHx3xN- Authors:
Andreas P. Cuny - initial implementation
- 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) –ImageProcessingobjectframeNumber (
int) – Image frame number.varargin (
str varchar) –fieldName (
str): Property to be displayed on the image. Defaults to ‘track_index’ can be any propery ofTracX.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).
- fontSize (
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
- 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) –ImageProcessingobjectfontSize (
int) – Font size of track indicies labels.rectHalfSideLength (
int) –fingerprintWindowHalfSideLengthframeNumber (
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
- 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) –ImageProcessinginstancerootTrack (
int) – Track index of the lineage root to be visualized.imageFrequency (
float) – Image frequency in hoursframe (
int) – Image frame numbervarargin (
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
- generateLineageMovie(this, rootTrack, imageFrequency, movieName, varargin)¶
GENERATELINEAGEMOVIE Generates a video displaying the cell lineage, labeled image and quantified signals over time.
- Parameters:
this (
object) –ImageProcessinginstancerootTrack (
int) – Track index of the lineage root to be visualized.imageFrequency (
float) – Image frequency in hoursmovieName (
str) – Name of the movievarargin (
str varchar) –figurePosition (
float): Figure position and size (x,y, width, height) array for the movie generation. Default is: [10 10 1350 600]videoQuality (
int0-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
- generateMarkerControlImageFrame(this, frameNumber)¶
GENERATEMARKERCONTROLIMAGEFRAME Generates a marker tracking control image to visualize i.e budneck marker tracking.
- Parameters:
this (
object) –ImageProcessinginstanceframeNumber (
int) – Image frame number
- Returns:
Image matrix including segmentation mask of cell cycle marker.
- Return type:
labeledMask
arrayNxM- Authors:
Andreas P. Cuny - initial implementation
- 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) –ImageProcessinginstanceimg (
uint8NxNx1 uint8, 16, 32, 64) – Image matriximageFrequency (
float) – Image frequency in hoursframe (
int) – Image frame numbervarargin (
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
- 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
arrayNxM- Authors:
Andreas P. Cuny - initial implementation
- 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) –ImageProcessinginstance- Returns:
void – Corrected masks are saved directly to disk.
- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- 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) –ImageProcessinginstancetracks2Merge (
arraykx1) – Image matrix
- Returns:
Writes new massks to disk directly into a tmp folder.
segmentationResultDir- Return type:
void (
-)- Authors:
Andreas P. Cuny - initial implementation
- 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) –ImageProcessinginstancefromImageFrame (
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’; AnySegmentationDatapropertyvideoQuality (
int0-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
- 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) –ImageProcessinginstancefontSize (
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
doubleNxM- Authors:
Andreas P. Cuny - initial implementation
- 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) –ImageProcessinginstancefromImageFrame (
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 (
int0-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
- 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) –ImageProcessinginstancehalfWindowLength (
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
- 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) –ImageProcessinginstancetrackOfInterest (
int1x1) – Track number of a cell of interestframeNumber (
int1x1) – Image frame numbervarargin (
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
arrayNxM
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
- 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) –ImageProcessinginstanceframeNumber (
int) – Image frame numbervarargin (
str varchar) –useTrackIndices (
bool): If track indices should be used. Defaults to true. Othewise cell indices are used.customCMap (
arraykx3): Use custom colormat to color the cell segmentation masks. Otherwise auto generates one.
- Returns:
Image matrix with tracked cell segmentation masks.
- Return type:
labeledMask
arrayNxM- Authors:
Andreas P. Cuny - initial implementation
- 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) –ImageProcessinginstanceproperty (
str) –SegmentationDataproperty
- Returns:
cMap
floatKx3 – Color map for track indicescMapFull
floatKx3 – Full color mapcLim
float1x2 – Min and max property values
- Authors:
Andreas P. Cuny - initial implementation
- getTextOnJavaImage(~, image, string, position, fontColor, fontName, fontSize, fontEmphasis)¶
GETTEXTONJAVAIMAGE Outputs image with string label at position for a Java BufferedImage.
- Parameters:
ignoredArg (
object) –ImageProcessinginstanceimage (
arrayNxM) – 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 imageposition (
array2x1) – Position with x and y coordinates to place the string onto the imagefontColor (
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
arrayNxM
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
- 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) –ImageProcessinginstancetrackToLabelArray (
array1xK) – Array of track numbers which should be labeled with their segmentation mask on an image.frameNumber (
int1x1) – Image frame numbervarargin (
str varchar) –maskOverlayAlpha (
float0-1): Sets the transparency of the mask in the range[0,1].imageBrightness (
float0-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:
arrayNxM- Authors:
Andreas P. Cuny - initial implementation
- 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) –ImageProcessinginstance- Returns:
void – Corrected masks are saved directly to disk.
- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- normalizeImage(~, imageMatrix)¶
NORMALIZEIMAGE Normalizes image between 0 and 1.
- Input:
ignoredArg (
object):ImageProcessinginstance imageMatrix (arrayNxM): Image matrix to be normalized.
- Returns:
imageMatrixNorm – Normalized image matrix.
- Return type:
arrayNxM- Authors:
Sotiris Dimopoulos - initial implementation in CellX
- Authors:
Andreas P. Cuny - adapation for TracX
- 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) –ImageProcessinginstanceimage (
arrayNxM) – Image matrixmask (
array) – the specified channel with the in alpha specified transparency.varargin (
str varchar) –maskOverlayAlpha (
float0-1): Sets the transparency of the mask in the range[0,1].imageBrightness (
float0-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
doubleNxM- Authors:
Andreas P. Cuny - initial implementation
- relabelMaskIndices(~, mask, newLabelArray, oldLabelArray)¶
RELABELMASKINDICES Relabels indices on a 2D mask [NxM].
- Parameters:
ignoredArg (
object) –ImageProcessinginstancemask (
uint16NxM) – Matrix with numerical labelsnewLabelArray (
int1xN) – Array containing the new numerical labels to replace the old ones with.oldLabelArray (
int1xN) – Array containing all the numerical labels of mask.
- Returns:
Matrix with labels replaced.
- Return type:
maskRelabeled
doubleNxM- 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) –ImageProcessinginstancefromImageFrame (
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 (
int0-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.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) –ImageProcessinginstance- Returns:
void – Corrected masks are saved directly to disk.
- Return type:
(
-)- 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) –ImageProcessinginstanceimage (
arrayNxM) – 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 imageposition (
array2x1) – Position with x and y coordinates to place the string onto the imagefontColor (
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
arrayNxM
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.normalizeImage(~, imageMatrix)¶
NORMALIZEIMAGE Normalizes image between 0 and 1.
- Input:
ignoredArg (
object):ImageProcessinginstance imageMatrix (arrayNxM): Image matrix to be normalized.
- Returns:
imageMatrixNorm – Normalized image matrix.
- Return type:
arrayNxM- Authors:
Sotiris Dimopoulos - initial implementation in CellX
- Authors:
Andreas P. Cuny - adapation for TracX
- 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) –ImageProcessinginstancetrackOfInterest (
int1x1) – Track number of a cell of interestframeNumber (
int1x1) – Image frame numbervarargin (
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
arrayNxM
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.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) –ImageProcessingobjectfontSize (
int) – Font size of track indicies labels.rectHalfSideLength (
int) –fingerprintWindowHalfSideLengthframeNumber (
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.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
arrayNxM- Authors:
Andreas P. Cuny - initial implementation
ImageVisualization¶
- 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) –ImageVisualizationobjectvarargin (
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.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) –ImageVisualizationobjectpathToResults (
str) – Full path to fingerprintEvaluation result file.
- Returns:
Displays figures.
- 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) –ImageVisualizationobjectvarargin (
str varchar) –PropertyToVisualise (
str): Property to be displayed on the image. Defaults to ‘track_index’ can be any propery ofTracX.SegmentationData.Track (
int): Track number which should be highlighed.Frames (
array): Image frames arrayColorMap (
arraykx3): Colormap to be usedDelayTime (
float1x1): Deleay time. Defaults to 0.3.NameOnly (
bool1x1): Flag if name only. Defaults to false.FileName (
str1x1): 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
- 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) –ImageVisualizationobjectvarargin (
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.plotDifferenceAlphaShapeVsReducedAlphaShape(this, cellIdxArray)¶
PLOTDIFFERENCEALPHASHAPEVSREDUCEDALPHASHAPE Displays a control image for the differences in alpha shapes vs reduced alpha shapes.
- Parameters:
this (
obj) –ImageVisualizationinstance.cellIdxArray (
array) – Array of cell indices to plot.
- Returns:
Image is visualized in figure.
- Return type:
void (
-)- Authors:
Tomas Kuendig - 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) –ImageVisualizationobjectfontSize (
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.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) –ImageVisualizationobjectframeNumber (
int) – Image frame number.varargin (
str varchar) –fieldName (
str): Property to be displayed on the image. Defaults to ‘track_index’ can be any propery ofTracX.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.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) –ImageVisualizationobjectfontSize (
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
- class TracX.@ImageVisualization.ImageVisualization¶
IMAGEVISUALIZATION Class handles all the image visualization aspects of TracX. i.e. control images displayed to the user.
- Authors:
Andreas P. Cuny - initial implementation
- Constructor Summary
- ImageVisualization(data, configuration, imageProcessing, lineage)¶
Constructor of an
ImageVisualizationobject. Class handles all the image visualization aspects of TracX. i.e. control images displayed to the user.- Parameters:
data (
obj) –TrackerDatainstanceconfiguration (
obj) –TrackerConfigurationinstanceimageProcessing (
obj) –ImageProcessinginstancelineage (
obj) –Lineageinstance
- Returns:
ImageVisualizationinstance- Return type:
obj (
obj)- Authors:
Andreas P. Cuny - initial implementation
- Property Summary
- configuration¶
TracX.@TrackerConfigurationinstance implementing configuration methods.
- data¶
TracX.@TrackerDatainstance stores all segmentation, quantification and lineage data.
- imageProcessing¶
TracX.@ImageProcessinginstance implementing image processing methods.
- lineage¶
TracX.@Lineageinstance implementing lineage methods.
- Method Summary
- 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) –ImageVisualizationobjectframeNumber (
int) – Image frame number.varargin (
str varchar) –fieldName (
str): Property to be displayed on the image. Defaults to ‘track_index’ can be any propery ofTracX.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
- plotDifferenceAlphaShapeVsReducedAlphaShape(this, cellIdxArray)¶
PLOTDIFFERENCEALPHASHAPEVSREDUCEDALPHASHAPE Displays a control image for the differences in alpha shapes vs reduced alpha shapes.
- Parameters:
this (
obj) –ImageVisualizationinstance.cellIdxArray (
array) – Array of cell indices to plot.
- Returns:
Image is visualized in figure.
- Return type:
void (
-)- Authors:
Tomas Kuendig - initial implementation
- 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) –ImageVisualizationinstancexFPDistAssigned (
array1xk) – Fingerprint distance of all assignmentsxFPDistAssignedToCompare (
array1xj) – Fingerprint distances of neighbouring cells for each assigned cell.yDeltaDistAssigned (
array1xk) – Delta distance of all assignments to the minimal FPdist of all possible assignments for each cell.yDeltaDistToCompare (
array1xj) – Delta distance of all assignments to their comparator (i.e. its direct neighbours or all other cells)fpDistThreshold (
fluat1x1) – Fingerprint distance threshold.lowerQuantile (
float1x1) – 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:
object1xM- Authors:
Andreas P. Cuny - initial implementation
- 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) –ImageVisualizationobjectfontSize (
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
- 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) –ImageVisualizationobjectpathToResults (
str) – Full path to fingerprintEvaluation result file.
- Returns:
Displays figures.
- Return type:
void (
-)- Authors:
Andreas P. Cuny - initial implementation
- 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) –ImageVisualizationobjectvarargin (
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
- 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) –ImageVisualizationobjectfontSize (
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
- 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) –ImageVisualizationobjectvarargin (
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
- 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 ofTracX.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
- 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) –ImageVisualizationobjectvarargin (
str varchar) –PropertyToVisualise (
str): Property to be displayed on the image. Defaults to ‘track_index’ can be any propery ofTracX.SegmentationData.Track (
int): Track number which should be highlighed.Frames (
array): Image frames arrayColorMap (
arraykx3): Colormap to be usedDelayTime (
float1x1): Deleay time. Defaults to 0.3.NameOnly (
bool1x1): Flag if name only. Defaults to false.FileName (
str1x1): 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
- 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 ofTracX.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.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) –ImageVisualizationinstancexFPDistAssigned (
array1xk) – Fingerprint distance of all assignmentsxFPDistAssignedToCompare (
array1xj) – Fingerprint distances of neighbouring cells for each assigned cell.yDeltaDistAssigned (
array1xk) – Delta distance of all assignments to the minimal FPdist of all possible assignments for each cell.yDeltaDistToCompare (
array1xj) – Delta distance of all assignments to their comparator (i.e. its direct neighbours or all other cells)fpDistThreshold (
fluat1x1) – Fingerprint distance threshold.lowerQuantile (
float1x1) – 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:
object1xM- Authors:
Andreas P. Cuny - initial implementation
IO¶
- 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) –IOinstance.pathToFile (
str) – Path to mask file.
- Returns:
Segmentation mask matrix.
- Return type:
mask (
array, NxM)- Authors:
Andreas P. Cuny - 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) –IOinstance.vector3D (
array) – 3D vector
- Returns:
tag – Orientation incompressed format.
- Return type:
int- Authors:
Thomas Kuendig - initial implementation
- TracX.@IO.writeToMAT(~, data, resultFilePath, resultFileName, varargin)¶
WRITETOMAT Writes tracker results to disk in mat format.
- Parameters:
ignoredArg (
obj) –IOinstance.data (
table) – Table ofTrackerData.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.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) –IOinstance.pathToFile (
str) – Path to image file.varargin – [x, y, w-1, h-1]
imageCropCoordinateArrayused 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.convertXLSToCSV(this, fullFileName, dataDelimiter)¶
CONVERTXLSTOCSV Convert a excel spreadsheet to csv table from a file.
- Parameters:
this (
obj) –IOinstance.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.writeToPNG(~, image, fullPath)¶
WRITETOPNG Writes an image matrix as png file to disk.
- Parameters:
ignoredArg (
obj) –IOinstance.image (
array, NxM) – Image matrixfullPath (
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.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) –IOinstance.frameNumber (
int) – Image frame numbersegmentationFile (
str) – Name of segmentation fileimageFile (
str) – Name of image fileresultPath (
str) – Path to where output should be saved. Defaults to experiment folder.pxPerZInterval (
int) – Conversion factor pixel to z intervalfluoTags (
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.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) –IOinstance.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.writeToXLS(~, data, resultFilePath, resultFileName, varargin)¶
WRITETOXLS Writes tracker results to disk as excel spreadsheet.
- Parameters:
ignoredArg (
obj) –IOinstance.data (
table) – Table ofTrackerDatainstance..resultFilePath (
str) – Path to where tracker results should be saved.resultFileName (
str) – Name of result filevarargin (
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
- class TracX.@IO.IO¶
Bases:
handleIO class to deal with TracX input and output while reading or writing data to disk.
- Authors:
Andreas P. Cuny - initial implementation
- Constructor Summary
- 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
- Property Summary
- convertedImageFileNameArray¶
Converted image file name array
- rawImageFileNameArray¶
Raw image file name array
- utils¶
TracX.@Utilsinstance implementing utility methods
- Method Summary
- convertChallengeFilesToParseable(~, path, setName)¶
CONVERTCHALLENGEFILESTOPARSEABLE Converts files from the tracker challenge into parseable format.
- Parameters:
ignoredArg (
obj) –IOinstance.path (
str) – Path to the imagessetName (
str) – Name of the dataset.
- Returns:
Converted set saved to disk directly.
- Return type:
void (
-)- Authors:
Thomas Kuendig - initial implementation
- 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) –IOinstance.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
- convertXLSToCSV(this, fullFileName, dataDelimiter)¶
CONVERTXLSTOCSV Convert a excel spreadsheet to csv table from a file.
- Parameters:
this (
obj) –IOinstance.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
- destackTimepoints(this, inputFilePath, fileRegEx, nTimepoints, nPlanes, direction)¶
DESTACKTIMEPOINTS Destacks a 3D (multipage tiff) stack into single files per time point.
- Parameters:
this (
obj) –IOinstance.inputFilePath (
str) – Path to files.fileRegEx (
str) – File name identifier regular expressionnTimepoints (
int) – Number of time points in stacknPlanes (
int) – Number of planes in stackdirection (
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
- filenameSorterForCellXinput(~, fileNameArray)¶
FILENAMESORTERFORCELLXINPUT Sorts CellX output file names and returns them as well as the number of time points and planes.
- Parameters:
this (
obj) –IOinstance.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
- 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) –IOinstance.imageFilePath (
str) – Path to the images to be paresedimageFileType (
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
- 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) –IOinstance.frameNumber (
int) – Image frame numbersegmentationFile (
str) – Name of segmentation fileimageFile (
str) – Name of image fileresultPath (
str) – Path to where output should be saved. Defaults to experiment folder.pxPerZInterval (
int) – Conversion factor pixel to z intervalfluoTags (
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
- orientationCompressor(~, vector3D)¶
ORIENTATIONCOMPRESSOR Compresses the orientation vector into a single number. Note: Vector should be already of unit length!
- Parameters:
ignoredArg (
obj) –IOinstance.vector3D (
array) – 3D vector
- Returns:
tag – Orientation incompressed format.
- Return type:
int- Authors:
Thomas Kuendig - initial implementation
- 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) –IOinstance.file (
str) – Path to CellX parameter xml file
- Returns:
ret (:obj:`struct`)
- Return type:
CellX parameter as struct.
- Authors:
Andreas P. Cuny - initial implementation
- readFromXML(~, configuration, file)¶
READFROMXML Reads a TracX configuration xml file and stores the parameters in the ParameterConfiguration object.
- Parameters:
ignoredArg (
obj) –IOinstance.configuration (
obj) –TrackerConfigurationobject.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
- 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) –IOinstance.pathToFile (
str) – Path to image file.varargin – [x, y, w-1, h-1]
imageCropCoordinateArrayused 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
- readImageToRGB(~, imageFilePath, varargin)¶
READIMAGETORGB loads an image as RGB matrix
- Parameters:
ignoredArg (
obj) –IOinstance.imageFilePath (
str) – Path to image file.varargin – [x, y, w-1, h-1]
imageCropCoordinateArrayused 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
- 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) –IOinstance.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 fileNameArrayfieldNameArray (
array) – Array of cell arrays with the column header names of the imported data for each frame.
- Authors:
Andreas P. Cuny - initial implementation
- 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) –IOinstance.pathToFile (
str) – Path to mask file.
- Returns:
Segmentation mask matrix.
- Return type:
mask (
array, NxM)- Authors:
Andreas P. Cuny - initial implementation
- stackZPlanes(~, inputFilePath, fileRegEx, planeRegEx, convert)¶
STACKZPLANES Stacks single file z planes into one multipage tiff.
- Parameters:
ignoredArg (
obj) –IOinstance.inputFilePath (
str) – File path to imagesfileRegEx (
str) – File identifier regular expressionplaneRegEx (
str) – File z plane identifier regular expressionconvert (
bool) – Bool if stack should be converted.
- Returns:
uRemnants – Unique remnants.
- Return type:
str- Authors:
Thomas Kuendig - initial implementation
- 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) –IOinstance.maskDilated (
array, NxM) – Segmentation mask. Dilated such that cells touch each others.foundEdgesFilled (
array, NxM) – Budneck segmentation mask.trackIndexArray (
array, 1xK) – Track index arraycellCenterXArray (
array, 1xK) – Cell center x arraycellCenterYArray (
array, 1xK) – Cell center y arraysegmentationResultDir (
str) – Path to segmentation results.frameNumber (
int) – Image frame numberimageCropCoordinateArray (
array) – Image crop coordinates
- Returns:
Writes the output image directly to disk.
- Return type:
void (
-)- Authors:
Andreas P. Cuny - initial implementation
- writeToCSV(~, data, resultFilePath, resultFileName, dataDelimiter)¶
WRITETOCSV Writes tracker results to disk in csv format.
- Parameters:
ignoredArg (
obj) –IOinstance.data (
table) – Table ofTrackerDatainstance..resultFilePath (
str) – Path to where tracker results should be saved.resultFileName (
str) – Name of result filedataDelimiter (
str) – Name or symbol of delimiter
- Returns:
Writes text file to disk
- Return type:
void (
-)- Authors:
Andreas P. Cuny - initial implementation
- writeToMAT(~, data, resultFilePath, resultFileName, varargin)¶
WRITETOMAT Writes tracker results to disk in mat format.
- Parameters:
ignoredArg (
obj) –IOinstance.data (
table) – Table ofTrackerData.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
- writeToPNG(~, image, fullPath)¶
WRITETOPNG Writes an image matrix as png file to disk.
- Parameters:
ignoredArg (
obj) –IOinstance.image (
array, NxM) – Image matrixfullPath (
str) – Path to where the image will be saved.
- Returns:
Writes image file to disk.
- Return type:
void (
-)- Authors:
Andreas P. Cuny - initial implementation
- writeToTIF(~, image, fullPath)¶
WRITETOTIF Writes an image matrix as tif file to disk.
- Parameters:
ignoredArg (
obj) –IOinstance.image (
array, NxM) – Image matrixfullPath (
str) – Path to where the image will be saved.
- Returns:
Writes image file to disk.
- Return type:
void (
-)- Authors:
Andreas P. Cuny - initial implementation
- writeToTXT(~, data, resultFilePath, resultFileName, dataDelimiter)¶
WRITETOTEXT Writes tracker results to disk in txt format.
- Parameters:
ignoredArg (
obj) –IOinstance.data (
table) – Table ofTrackerDatainstance..resultFilePath (
str) – Path to where tracker results should be saved.resultFileName (
str) – Name of result filedataDelimiter (
str) – Name or symbol of delimiter
- Returns:
Writes text file to disk.
- Return type:
void (
-)- Authors:
Andreas P. Cuny - initial implementation
- writeToXLS(~, data, resultFilePath, resultFileName, varargin)¶
WRITETOXLS Writes tracker results to disk as excel spreadsheet.
- Parameters:
ignoredArg (
obj) –IOinstance.data (
table) – Table ofTrackerDatainstance..resultFilePath (
str) – Path to where tracker results should be saved.resultFileName (
str) – Name of result filevarargin (
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
- writeToXML(~, configuration, file)¶
WRITETOXML Writes a TracX configuration xml file with all the parameters stored in the ParameterConfiguration and ProjectConfiguration object.
- Parameters:
ignoredArg (
obj) –IOinstance. instanceconfiguration (
obj) –TrackerConfigurationobject.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
- 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) –IOinstance..joinedTrackerDataTable (
table) – Table with joinedTrackerDataresultFilePath (
str) – Path to where tracker results should be saved.resultFileName (
str) – Name of result filevarargin (
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
- TracX.@IO.readImageToRGB(~, imageFilePath, varargin)¶
READIMAGETORGB loads an image as RGB matrix
- Parameters:
ignoredArg (
obj) –IOinstance.imageFilePath (
str) – Path to image file.varargin – [x, y, w-1, h-1]
imageCropCoordinateArrayused 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.writeToTIF(~, image, fullPath)¶
WRITETOTIF Writes an image matrix as tif file to disk.
- Parameters:
ignoredArg (
obj) –IOinstance.image (
array, NxM) – Image matrixfullPath (
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.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) –IOinstance.imageFilePath (
str) – Path to the images to be paresedimageFileType (
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.filenameSorterForCellXinput(~, fileNameArray)¶
FILENAMESORTERFORCELLXINPUT Sorts CellX output file names and returns them as well as the number of time points and planes.
- Parameters:
this (
obj) –IOinstance.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.destackTimepoints(this, inputFilePath, fileRegEx, nTimepoints, nPlanes, direction)¶
DESTACKTIMEPOINTS Destacks a 3D (multipage tiff) stack into single files per time point.
- Parameters:
this (
obj) –IOinstance.inputFilePath (
str) – Path to files.fileRegEx (
str) – File name identifier regular expressionnTimepoints (
int) – Number of time points in stacknPlanes (
int) – Number of planes in stackdirection (
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.writeToTXT(~, data, resultFilePath, resultFileName, dataDelimiter)¶
WRITETOTEXT Writes tracker results to disk in txt format.
- Parameters:
ignoredArg (
obj) –IOinstance.data (
table) – Table ofTrackerDatainstance..resultFilePath (
str) – Path to where tracker results should be saved.resultFileName (
str) – Name of result filedataDelimiter (
str) – Name or symbol of delimiter
- Returns:
Writes text file to disk.
- Return type:
void (
-)- Authors:
Andreas P. Cuny - 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) –IOinstance.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.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) –IOinstance.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 fileNameArrayfieldNameArray (
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.readFromXML(~, configuration, file)¶
READFROMXML Reads a TracX configuration xml file and stores the parameters in the ParameterConfiguration object.
- Parameters:
ignoredArg (
obj) –IOinstance.configuration (
obj) –TrackerConfigurationobject.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.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) –IOinstance..joinedTrackerDataTable (
table) – Table with joinedTrackerDataresultFilePath (
str) – Path to where tracker results should be saved.resultFileName (
str) – Name of result filevarargin (
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
- TracX.@IO.writeToCSV(~, data, resultFilePath, resultFileName, dataDelimiter)¶
WRITETOCSV Writes tracker results to disk in csv format.
- Parameters:
ignoredArg (
obj) –IOinstance.data (
table) – Table ofTrackerDatainstance..resultFilePath (
str) – Path to where tracker results should be saved.resultFileName (
str) – Name of result filedataDelimiter (
str) – Name or symbol of delimiter
- Returns:
Writes text 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) –IOinstance. instanceconfiguration (
obj) –TrackerConfigurationobject.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.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) –IOinstance.maskDilated (
array, NxM) – Segmentation mask. Dilated such that cells touch each others.foundEdgesFilled (
array, NxM) – Budneck segmentation mask.trackIndexArray (
array, 1xK) – Track index arraycellCenterXArray (
array, 1xK) – Cell center x arraycellCenterYArray (
array, 1xK) – Cell center y arraysegmentationResultDir (
str) – Path to segmentation results.frameNumber (
int) – Image frame numberimageCropCoordinateArray (
array) – Image crop coordinates
- Returns:
Writes the output image directly to disk.
- Return type:
void (
-)- 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) –IOinstance.inputFilePath (
str) – File path to imagesfileRegEx (
str) – File identifier regular expressionplaneRegEx (
str) – File z plane identifier regular expressionconvert (
bool) – Bool if stack should be converted.
- Returns:
uRemnants – Unique remnants.
- Return type:
str- Authors:
Thomas Kuendig - initial implementation
- TracX.@IO.convertChallengeFilesToParseable(~, path, setName)¶
CONVERTCHALLENGEFILESTOPARSEABLE Converts files from the tracker challenge into parseable format.
- Parameters:
ignoredArg (
obj) –IOinstance.path (
str) – Path to the imagessetName (
str) – Name of the dataset.
- Returns:
Converted set saved to disk directly.
- Return type:
void (
-)- Authors:
Thomas Kuendig - initial implementation
LAP¶
- 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) –LAPinstance.oldFrame (
object) – oldFrameTemporaryTrackingDatainstancenewFrame (
object) – newFrameTemporaryTrackingDatainstancemaxCellCenterDisplacement (
int, 1x1) – Maximal frame to frame segmentation centroid displacementmaxMajorAxisRotation (
float1x1) – Max allowed major axis rotation in degree.individualFunctionPenalty (
int1x1) – Individual function penaltymaxCellSizeDecrease (
float1x1) – Maximal allowed frame to frame cell size decrease fraction.averageCellSizeGrowth (
float1x1) – Average allowed frame to frame cell size growth fraction.maxCellSizeIncrease (
float1x1) – Maximal allowed frame to frame cell size increase fraction.usedFunctionsForCostMatrix (
array1x4) – Logical array to select which of the four penalty functions should be used to build the cost matrix.meanCellDiameter (
float1x1) – Mean segmentation object diameter (cell diameter).maxTrackFrameSkipping (
int1x1) – Max number of frames a cell is allowed to be missing from a trackdisplacementWeightingMode (
bool) – For quadratic (default) or 1 for linear displacement cost calculation.is3DData (
bool) – Is data 3D. Defaults to 0 for 2D data.
- Returns:
totalCost (
floatIxJ) – Costmatrix with the sum of cost matricies positionCost to frameSkippingCostpositionCost (
floatIxJ) – Costmatrix for spatial position.areaCost (
floatIxJ) – Costmatrix for size difference (area).rotationCost (
floatIxJ) – Costmatrix for rotation difference (orientation).frameSkippingCost (
floatIxJ) – 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.computeOrientationDifference(~, a, b)¶
COMPUTEORIENTATIONDIFFERENCE Calculates the central angle between two orientation vectors
- Parameters:
ignoredArg (
object) –LAPinstance.a (
array) – Orientation vector ab (
array) – Orientation vector b
- Returns:
result – Resulting orientation difference
- Return type:
double- Authors:
Thomas Kuendig - initial implementation
- 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) –LAPinstance.oldFrame (
object) – oldFrameTemporaryTrackingDatainstance.newFrame (
object) – newFrameTemporaryTrackingDatainstance.individualFunctionPenalty (
int1x1) – Individual function penaltyradius (
int1x1) – Radius for neighbourhooddCRFM (
arrayNxM) – Cell region fingerprint distances.
- Returns:
totalCost (
floatIxJ) – Costmatrix with the sum of cost matriciespositionCost (
floatIxJ) – Costmatrix for dCRFareaCost (
floatIxJ) – Costmatrix placeholderrotationCost (
floatIxJ) – Costmatrix placeholderframeSkippingCost (
floatIxJ) – 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) –LAPinstance.oldFrame (
object) – oldFrameTemporaryTrackingDatainstance.newFrame (
object) – newFrameTemporaryTrackingDatainstance.displacementOfAssignedTracks (
array, Kx3) – Displacement of assigned tracks in x,y,zmaxExpectedMovement (
float) – Maximum expected segmented centroid movementcellCloseNeighbours (
array) – Array of cell close neighboursindividualFunctionPenalty (
int1x1) – Individual function penaltymaxCellSizeDecrease (
float1x1) – Maximal allowed frame to frame cell size decrease as fraction.averageCellSizeGrowth (
float1x1) – Average allowed frame to frame cell size growth as fraction.maxCellSizeIncrease (
float1x1) – Maximal allowed frame to frame cell size increase as fraction.
- Returns:
weightedTotalCosts (
floatnxm) – Costmatrix with the sum of cost matrices weightedpositionCost to weightedAreaCostweightedPositionCost (
floatnxm) – Weighted cost matrix for spatial differences (position).weightedAreaCost (
floatnxm) – 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.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) –LAPinstance.oldFrame (
object) – oldFrameTemporaryTrackingDatainstance.newFrame (
object) – newFrameTemporaryTrackingDatainstance.costMatrix (
double, NxM) – Cost matrix for assignments between old- and newFrame.fingerprintDistThreshold (
float) –fingerprintDistThreshold
- Returns:
costMatrix (
doubleNxM) – Refined cost matrixexcludeFromAssignmentIdx (
arrayNx1) – Logical indicies of rows to exclude from costMatrix.
- 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) –LAPinstance.oldFrameData (
object) – oldFrameTemporaryTrackingDatainstance.newFrameData (
object) – newFrameTemporaryTrackingDatainstance.daughterpairTracks (
int, 1xK) – Array of daughterpair tracksparentTracks (
int, 1xJ) – Array of parent tracksdaughterpairTypes (
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
- class TracX.@LAP.LAP¶
LAP class to create cost matricies and solve linear assignment problem.
- Authors:
Andreas P. Cuny - initial implementation
- Constructor Summary
- LAP()¶
LAP Constructs a
TemporaryTrackingDataobject to create cost matricies and solve linear assignment problem.- Returns:
obj
- Return type:
objectReturns aTemporaryTrackingDatainstance.- Authors:
Andreas P. Cuny - initial implementation
- Method Summary
- 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) –LAPinstance.oldFrame (
object) – oldFrameTemporaryTrackingDatainstancenewFrame (
object) – newFrameTemporaryTrackingDatainstancemaxCellCenterDisplacement (
int, 1x1) – Maximal frame to frame segmentation centroid displacementmaxMajorAxisRotation (
float1x1) – Max allowed major axis rotation in degree.individualFunctionPenalty (
int1x1) – Individual function penaltymaxCellSizeDecrease (
float1x1) – Maximal allowed frame to frame cell size decrease fraction.averageCellSizeGrowth (
float1x1) – Average allowed frame to frame cell size growth fraction.maxCellSizeIncrease (
float1x1) – Maximal allowed frame to frame cell size increase fraction.usedFunctionsForCostMatrix (
array1x4) – Logical array to select which of the four penalty functions should be used to build the cost matrix.meanCellDiameter (
float1x1) – Mean segmentation object diameter (cell diameter).maxTrackFrameSkipping (
int1x1) – Max number of frames a cell is allowed to be missing from a trackdisplacementWeightingMode (
bool) – For quadratic (default) or 1 for linear displacement cost calculation.is3DData (
bool) – Is data 3D. Defaults to 0 for 2D data.
- Returns:
totalCost (
floatIxJ) – Costmatrix with the sum of cost matricies positionCost to frameSkippingCostpositionCost (
floatIxJ) – Costmatrix for spatial position.areaCost (
floatIxJ) – Costmatrix for size difference (area).rotationCost (
floatIxJ) – Costmatrix for rotation difference (orientation).frameSkippingCost (
floatIxJ) – 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.
- 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) –LAPinstance.oldFrame (
object) – oldFrameTemporaryTrackingDatainstance.newFrame (
object) – newFrameTemporaryTrackingDatainstance.individualFunctionPenalty (
int1x1) – Individual function penaltyradius (
int1x1) – Radius for neighbourhooddCRFM (
arrayNxM) – Cell region fingerprint distances.
- Returns:
totalCost (
floatIxJ) – Costmatrix with the sum of cost matriciespositionCost (
floatIxJ) – Costmatrix for dCRFareaCost (
floatIxJ) – Costmatrix placeholderrotationCost (
floatIxJ) – Costmatrix placeholderframeSkippingCost (
floatIxJ) – Costmatrix placeholder
- Authors:
Andreas P. Cuny - Initial implementation
- 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) –LAPinstance.oldFrame (
object) – oldFrameTemporaryTrackingDatainstance.newFrame (
object) – newFrameTemporaryTrackingDatainstance.displacementOfAssignedTracks (
array, Kx3) – Displacement of assigned tracks in x,y,zmaxExpectedMovement (
float) – Maximum expected segmented centroid movementcellCloseNeighbours (
array) – Array of cell close neighboursindividualFunctionPenalty (
int1x1) – Individual function penaltymaxCellSizeDecrease (
float1x1) – Maximal allowed frame to frame cell size decrease as fraction.averageCellSizeGrowth (
float1x1) – Average allowed frame to frame cell size growth as fraction.maxCellSizeIncrease (
float1x1) – Maximal allowed frame to frame cell size increase as fraction.
- Returns:
weightedTotalCosts (
floatnxm) – Costmatrix with the sum of cost matrices weightedpositionCost to weightedAreaCostweightedPositionCost (
floatnxm) – Weighted cost matrix for spatial differences (position).weightedAreaCost (
floatnxm) – 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.
- 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) –LAPinstance.oldFrame (
object) – oldFrameTemporaryTrackingDatainstance.newFrame (
object) – newFrameTemporaryTrackingDatainstance.maxCellCenterDisplacement (
int, 1x1) – Maximal frame to frame segmentation centroid displacementmaxMajorAxisRotation (
float1x1) – Max allowed major axis rotation in degree.maxTrackFrameSkipping (
int1x1) – Max number of frames a cell is allowed to be missing from a trackindividualFunctionPenalty (
int1x1) – Individual function penaltymaxCellSizeDecrease (
float1x1) – Maximal allowed frame to frame cell size decrease in percent.averageCellSizeGrowth (
float1x1) – Average allowed frame to frame cell size growth in percent.maxCellSizeIncrease (
float1x1) – Maximal allowed frame to frame cell size increase in percent.usedFunctionsForCostMatrix (
array1x4) – Logical array to select which of the four penalty functions should be used to build the cost matrix.fingerprintDistThreshold (
float1x1) – CRF thresholdmeanCellDiameter (
float1x1) – Mean segmentation object diameter (cell diameter).is3DData (
bool) – Is data 3D. Defaults to 0 for 2D data.
- Returns:
newTrackIndex (
array) – New track indices arraytotalCost (
floatIxJ) – Costmatrix with the sum of cost matricies positionCost to frameSkippingCostpositionCost (
floatIxJ) – Costmatrix for spatial position.areaCost (
floatIxJ) – Costmatrix for size difference (area).rotationCost (
floatIxJ) – Costmatrix for rotation difference (orientation).frameSkippingCost (
floatIxJ) – Costmatrix for frame skipping (segmented object not present/detected on current image frame).
- Authors:
Andreas P. Cuny - initial implementation
- computeOrientationDifference(~, a, b)¶
COMPUTEORIENTATIONDIFFERENCE Calculates the central angle between two orientation vectors
- Parameters:
ignoredArg (
object) –LAPinstance.a (
array) – Orientation vector ab (
array) – Orientation vector b
- Returns:
result – Resulting orientation difference
- Return type:
double- Authors:
Thomas Kuendig - initial implementation
- computeOrientationDifferenceMatrix(this, A, B)¶
COMPUTEORIENTATIONDIFFERENCEMATRIX Computes the orientation difference matrix.
- Parameters:
this (
object) –LAPinstance.A (
array) – Orientation matrix AB (
array) – Orientation matrix B
- Returns:
resultMatrix – Resulting matrix
- Return type:
double- Authors:
Thomas Kuendig - initial implementation
- 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) –LAPinstance.oldFrame (
object) – oldFrameTemporaryTrackingDatainstance.newFrame (
object) – newFrameTemporaryTrackingDatainstance.costMatrix (
double, NxM) – Cost matrix for assignments between old- and newFrame.fingerprintDistThreshold (
float) –fingerprintDistThreshold
- Returns:
costMatrix (
doubleNxM) – Refined cost matrixexcludeFromAssignmentIdx (
arrayNx1) – Logical indicies of rows to exclude from costMatrix.
- Authors:
Andreas P. Cuny - initial implementation
- 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) –LAPinstance.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 indicescost (
array) – Minimum COST based on the assignment problemv (
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
- mammalianLineageCost(~, oldFrameData, newFrameData, daughterpairTracks, parentTracks, daughterpairTypes, parentTypes)¶
MAMMALIANLINEAGECOST Cost matrix function for mammalian lineage reconstruction in 2 & 3D.
- Parameters:
ignoredArg (
object) –LAPinstance.oldFrameData (
object) – oldFrameTemporaryTrackingDatainstance.newFrameData (
object) – newFrameTemporaryTrackingDatainstance.daughterpairTracks (
int, 1xK) – Array of daughterpair tracksparentTracks (
int, 1xJ) – Array of parent tracksdaughterpairTypes (
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
- orientationDecompressor(~, tag)¶
ORIENTATIONDECOMPRESSOR Decompresses the linearized orientation vector to its 3D format.
- Parameters:
ignoredArg (
object) –LAPinstance.tag (
array) – Compressed and linearized orientation 3D vector
- Returns:
vec – Decompressed orientation vector
- Return type:
arrayKx3- Authors:
Thomas Kuendig - initial implementation
- 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) –LAPinstance.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 (
intIx1) – Optimal row indiciesassignmentColIdx (
intIx1) – Optimal column indiciesassignmentLocIdx (
intIx1) – Linear indicies for optimal row and column indiciesassignmentCosts
arrayIxJ – Costs of the final assignmentvarargout
int– An array for each varargin with the assignmentLocIdx applied of same size.
- 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) –LAPinstance.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 indicescost (
array) – Minimum COST based on the assignment problemv (
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.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) –LAPinstance.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 (
intIx1) – Optimal row indiciesassignmentColIdx (
intIx1) – Optimal column indiciesassignmentLocIdx (
intIx1) – Linear indicies for optimal row and column indiciesassignmentCosts
arrayIxJ – Costs of the final assignmentvarargout
int– An array for each varargin with the assignmentLocIdx applied of same size.
- Authors:
Andreas P. Cuny - initial implementation
- TracX.@LAP.orientationDecompressor(~, tag)¶
ORIENTATIONDECOMPRESSOR Decompresses the linearized orientation vector to its 3D format.
- Parameters:
ignoredArg (
object) –LAPinstance.tag (
array) – Compressed and linearized orientation 3D vector
- Returns:
vec – Decompressed orientation vector
- Return type:
arrayKx3- Authors:
Thomas Kuendig - initial implementation
- TracX.@LAP.computeOrientationDifferenceMatrix(this, A, B)¶
COMPUTEORIENTATIONDIFFERENCEMATRIX Computes the orientation difference matrix.
- Parameters:
this (
object) –LAPinstance.A (
array) – Orientation matrix AB (
array) – Orientation matrix B
- Returns:
resultMatrix – Resulting matrix
- Return type:
double- Authors:
Thomas Kuendig - initial implementation
- 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) –LAPinstance.oldFrame (
object) – oldFrameTemporaryTrackingDatainstance.newFrame (
object) – newFrameTemporaryTrackingDatainstance.maxCellCenterDisplacement (
int, 1x1) – Maximal frame to frame segmentation centroid displacementmaxMajorAxisRotation (
float1x1) – Max allowed major axis rotation in degree.maxTrackFrameSkipping (
int1x1) – Max number of frames a cell is allowed to be missing from a trackindividualFunctionPenalty (
int1x1) – Individual function penaltymaxCellSizeDecrease (
float1x1) – Maximal allowed frame to frame cell size decrease in percent.averageCellSizeGrowth (
float1x1) – Average allowed frame to frame cell size growth in percent.maxCellSizeIncrease (
float1x1) – Maximal allowed frame to frame cell size increase in percent.usedFunctionsForCostMatrix (
array1x4) – Logical array to select which of the four penalty functions should be used to build the cost matrix.fingerprintDistThreshold (
float1x1) – CRF thresholdmeanCellDiameter (
float1x1) – Mean segmentation object diameter (cell diameter).is3DData (
bool) – Is data 3D. Defaults to 0 for 2D data.
- Returns:
newTrackIndex (
array) – New track indices arraytotalCost (
floatIxJ) – Costmatrix with the sum of cost matricies positionCost to frameSkippingCostpositionCost (
floatIxJ) – Costmatrix for spatial position.areaCost (
floatIxJ) – Costmatrix for size difference (area).rotationCost (
floatIxJ) – Costmatrix for rotation difference (orientation).frameSkippingCost (
floatIxJ) – Costmatrix for frame skipping (segmented object not present/detected on current image frame).
- Authors:
Andreas P. Cuny - initial implementation
Lineage¶
- TracX.@Lineage.evaluateNewMammalianRoots(this, varargin)¶
EVALUATENEWMAMMALIANROOTS Determination of best lineage for given root cells for mammalian lineage reconstruction.
- Parameters:
this (
object) –Lineageinstancevarargin (
str varchar) –roots (
array): Array of lineage roots.
- Returns:
Prints reslut to console.
- Return type:
void (
-)- Authors:
Thomas Kuendig - 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) –Lineageinstance- Returns:
Lineage summary as table.
- Return type:
summaryTable
table- 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) –Lineageinstance- Return type:
void
-- 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) –Lineageinstance.lineageTree (
obj) – Lineage treefirstFrame (
int) – First frame of experimentlastFrame (
int) – Last frmae of experimentimageFreq (
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.getTracks2Merge(this)¶
GETTRACKS2MERGE Returns a matrix with the mothers and buds to be merged prior division.
- Parameters:
this (
object) –Lineageinstance.- 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.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) –Lineageinstance.trackIndexArray (
array, kx1) – Array with all track indiciestrack_indextrackParentArray (
array, kx1) – Array with all track parentstrack_parentrootTrack (
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) –Lineageinstance.trackIndexArray (
array, kx1) – Array with all track indiciestrack_indextrackParentArray (
array, kx1) – Array with all track parentstrack_parentrootTrack (
int, 1x1) – The lineage tree root trackrootTrackRelatedCellArray (
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.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) –LineageinstanceimageDir (
str) – Path to image directoryfluoLineageFileName (
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) –divisionMarkerDenoisingdivisionMarkerEdgeSensitivityThresh (
float) –divisionMarkerEdgeSensitivityThreshdivisionMarkerConvexAreaLowerThresh (
float) –divisionMarkerConvexAreaLowerThreshdivisionMarkerConvexAreaUpperThresh (
float) –divisionMarkerConvexAreaUpperThresh
- Returns:
budPixelIndiciesArray
array– Array of all pixels belonging to a bud.foundEdgesFilled
arrayNxM – Image after edge detection with filled holesfluoImgDenoised
arrayNxM – Denoised image
- Authors:
Andreas P. Cuny - 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) –Lineageinstancevarargin (
str varchar) –- rootIndicies (
array): Array of lineage root track indices.
- rootIndicies (
- 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.recursiveTrackParentColoring(this, root, color, colormap, trackIndexArray, trackParentArray)¶
RECURSIVETRACKPARENTCOLORING Returns a colormap for recursive track parent coloring.
- Parameters:
this (
object) –Lineageinstance.root (
int) – Root track index.color (
array) – Color.colormap (
array) – ColormaptrackIndexArray (
array) – Track index array.trackParentArray (
array) – Track parent array.
- Returns:
Colormap
- Return type:
colormap
arraykx3- Authors:
Thomas Kuendig - 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) –LineageinstancetoRootTrackRelatedCellArray (
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.runMarkerTracking(this, varargin)¶
RUNMARKERTRACKING Runs the tracker algorithm for cell cycle marker channels. To track i.e a bud neck marker.
- Parameters:
this (
object) –Lineageinstancevarargin (
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.setTrackAge(this)¶
SETTRACKAGE Sets the cell age for each track after lineage reconstruction.
- Parameters:
this (
object) –Lineageinstance- Return type:
void
-- Authors:
Andreas P. Cuny - initial implementation
- TracX.@Lineage.getCellCyclePhaseTable(this)¶
GETCELLCYCLEPHASETABLE Returns the full cell cycle phase table.
- Parameters:
this (
object) –Lineageinstance- 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.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) –Lineageinstancechannel (
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.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) –Lineageinstance- 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) –Lineageinstance- Return type:
void
-- 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) –Lineageinstance.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
arrayArray of resampled line profile.lineProfileRaw
arrayArray of raw line profile – with applied resizing.
- 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) –LineageinstancestartFrame (
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.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) –Lineageinstance.- 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) –Trackerinstance- Return type:
void
-- Authors:
Thomas Kuendig - initial implementation
- TracX.@Lineage.getNewickFormat(this, varargin)¶
GETNEWICKFORMAT Converts the LineageTreeObject/Summary to a phytree object or to the Newick format.
- Parameters:
this (
obj) –Lineageobjectvarargin (
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.getBkgCorrSig(~, x, y, track, minSigLength, qc)¶
GETBKGCURRSIG Returns a background corrected nuclear signal for G1 determination.
- Parameters:
ignoredArg (
object) –Lineageinstancex (
array) – Array of frame numbers of signal.y (
array) – Array with raw signaltrack (
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
- class TracX.@Lineage.Lineage¶
Bases:
handleLINEAGE Implements functionalities to reconstruct the cell lineage for asymmetrically and symetrically dividing cell types.
- Authors:
Andreas P. Cuny - initial implementation
- Constructor Summary
- Lineage(data, config)¶
LINEAGE Constructs a Lineage object to reconstruct the generalogy for asymmetric and symmetric dividing cells.
- Returns:
Returns a
Lineageobject instance.- Return type:
obj (
-)- Authors:
Andreas P. Cuny - initial implementation
- Property Summary
- cellCyclePhaseTable¶
Cell cycle phases
- configuration¶
TracX.@TrackerConfigurationTrackerConfiguration instance with the tracking parameters and project metadata.
- data¶
TracX.@TrackerDatainstance stores all segmentation, quantification and lineage data.
- fingerprint¶
TracX.@Fingerprintinstance implementing fingerprinting methods.
- lap¶
TracX.@LAPinstance implementing tracking methods.
- lineageData¶
TracX.@LineageDatainstance implementing temporary lineage data storage.
- lineageTable¶
Lineage summary table.
- motion¶
TracX.@Motioninstance implementing motion methods.
- tracks2Merge¶
Matrix with info about mother and buds to merge prior division
- unresolvedTempLinAss¶
TracX.@TemporaryLineageAssignmentinstance implementing temporary assignments methods.
- utils¶
TracX.@Utilsinstance implementing utility methods.
- Method Summary
- asymmetricalLineageReconstruction(this)¶
ASYMMETRICALLINEAGERECONSTRUCTION Runs the asymmetrical lineage reconstruction i.e for budding yeast.
- Parameters:
this (
object) –Lineageinstance- Return type:
void (
-)
- 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) –LineageinstanceimageDir (
str) – Path to image directoryfluoLineageFileName (
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) –divisionMarkerDenoisingdivisionMarkerEdgeSensitivityThresh (
float) –divisionMarkerEdgeSensitivityThreshdivisionMarkerConvexAreaLowerThresh (
float) –divisionMarkerConvexAreaLowerThreshdivisionMarkerConvexAreaUpperThresh (
float) –divisionMarkerConvexAreaUpperThresh
- Returns:
budPixelIndiciesArray
array– Array of all pixels belonging to a bud.foundEdgesFilled
arrayNxM – Image after edge detection with filled holesfluoImgDenoised
arrayNxM – Denoised image
- Authors:
Andreas P. Cuny - initial implementation
- evaluateNewMammalianRoots(this, varargin)¶
EVALUATENEWMAMMALIANROOTS Determination of best lineage for given root cells for mammalian lineage reconstruction.
- Parameters:
this (
object) –Lineageinstancevarargin (
str varchar) –roots (
array): Array of lineage roots.
- Returns:
Prints reslut to console.
- Return type:
void (
-)- Authors:
Thomas Kuendig - initial implementation
- 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) –Lineageinstancevarargin (
str varchar) –- rootIndicies (
array): Array of lineage root track indices.
- rootIndicies (
- 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
- getBkgCorrSig(~, x, y, track, minSigLength, qc)¶
GETBKGCURRSIG Returns a background corrected nuclear signal for G1 determination.
- Parameters:
ignoredArg (
object) –Lineageinstancex (
array) – Array of frame numbers of signal.y (
array) – Array with raw signaltrack (
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
- getCellCyclePhaseTable(this)¶
GETCELLCYCLEPHASETABLE Returns the full cell cycle phase table.
- Parameters:
this (
object) –Lineageinstance- 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
- 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) –LineageinstancetoRootTrackRelatedCellArray (
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
- 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) –Lineageinstance.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
arrayArray of resampled line profile.lineProfileRaw
arrayArray of raw line profile – with applied resizing.
- Authors:
Andreas P. Cuny - initial implementation
- 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) –Lineageinstance- Returns:
Lineage summary as table.
- Return type:
summaryTable
table- Authors:
Andreas P. Cuny - initial implementation
- getNewickFormat(this, varargin)¶
GETNEWICKFORMAT Converts the LineageTreeObject/Summary to a phytree object or to the Newick format.
- Parameters:
this (
obj) –Lineageobjectvarargin (
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
- 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) –Lineageinstance.trackIndexArray (
array, kx1) – Array with all track indiciestrack_indextrackParentArray (
array, kx1) – Array with all track parentstrack_parentrootTrack (
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
- 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) –Lineageinstance.trackIndexArray (
array, kx1) – Array with all track indiciestrack_indextrackParentArray (
array, kx1) – Array with all track parentstrack_parentrootTrack (
int, 1x1) – The lineage tree root trackrootTrackRelatedCellArray (
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
- getTracks2Merge(this)¶
GETTRACKS2MERGE Returns a matrix with the mothers and buds to be merged prior division.
- Parameters:
this (
object) –Lineageinstance.- 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
- getTreeNodeDurations(this, lineageTree, firstFrame, lastFrame, imageFreq)¶
GETTREENODEDURATIONS Returns a tree object containing the cell cycle duration until cell division.
- Parameters:
this (
object) –Lineageinstance.lineageTree (
obj) – Lineage treefirstFrame (
int) – First frame of experimentlastFrame (
int) – Last frmae of experimentimageFreq (
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
- mammalianLineageReconstruction(this)¶
MAMMALIANLINEAGERECONSTRUCTION Runs the symmetrical lineage reconstruction for mammalian cells with convex shapes.
- Parameters:
this (
object) –Lineageinstance- Return type:
void (
-)
- recursiveTrackParentColoring(this, root, color, colormap, trackIndexArray, trackParentArray)¶
RECURSIVETRACKPARENTCOLORING Returns a colormap for recursive track parent coloring.
- Parameters:
this (
object) –Lineageinstance.root (
int) – Root track index.color (
array) – Color.colormap (
array) – ColormaptrackIndexArray (
array) – Track index array.trackParentArray (
array) – Track parent array.
- Returns:
Colormap
- Return type:
colormap
arraykx3- Authors:
Thomas Kuendig - initial implementation
- 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) –Lineageinstance.- Return type:
void
-- Authors:
Andreas P. Cuny - initial implementation
- runLineageReconstruction(this, varargin)¶
RUNLINEAGERECONSTRUCTION Starts lineage reconstruction based on tracking results for symmetrically and asymmetrically dividing cells.
- Parameters:
this (
object) –Lineageinstancevarargin (
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 (
-)
- runMarkerTracking(this, varargin)¶
RUNMARKERTRACKING Runs the tracker algorithm for cell cycle marker channels. To track i.e a bud neck marker.
- Parameters:
this (
object) –Lineageinstancevarargin (
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
- 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) –Lineageinstance- Return type:
void
-- Authors:
Andreas P. Cuny - initial implementation
- setLineageTable(this)¶
SETLINEAGETABLE Sets the lineage summary table.
- Parameters:
this (
object) –Lineageinstance- Return type:
void (
-)
- 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) –Lineageinstance- Return type:
void
-- Authors:
Andreas P. Cuny - initial implementation
- setParentMamDivCells(this, startFrame, endFrame, imageFrameNumberArray, joinTracks, printOutput)¶
SETPARENTMAMDIVCELLS Determines the relationship between daughter and mother cell of symmetricaly dividing cells.
- Parameters:
this (
object) –LineageinstancestartFrame (
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
- 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) –Lineageinstancechannel (
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
- setTrackAge(this)¶
SETTRACKAGE Sets the cell age for each track after lineage reconstruction.
- Parameters:
this (
object) –Lineageinstance- Return type:
void
-- Authors:
Andreas P. Cuny - initial implementation
- setTrackGeneration(this)¶
SETTRACKGENERATION Sets the cell generation for each track after lineage reconstruction.
- Parameters:
this (
object) –Lineageinstance- Return type:
void
-- Authors:
Andreas P. Cuny - initial implementation
- splitSurvivingParentTracks(this)¶
SPLITSURVIVINGPARENTTRACKS Splits surviving parent tracks during mammalian lineage reconstruction.
- Parameters:
this (
object) –Trackerinstance- Return type:
void
-- Authors:
Thomas Kuendig - initial implementation
- symmetricalLineageReconstruction(this)¶
SYMMETRICALLINEAGERECONSTRUCTION Runs the symmetrical lineage reconstruction (rod shaped cells).
- Parameters:
this (
object) –Lineageinstance- Return type:
void (
-)
- 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) –Trackerinstance- Return type:
void
-- Authors:
Andreas P. Cuny - 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) –Trackerinstance- Return type:
void
-- Authors:
Andreas P. Cuny - initial implementation
LineageData¶
- TracX.@LineageData.moveToVeryOld(this, selectedTrackArray, neighbourhoodSearchRadius)¶
MOVETOVERYOLD Moves temporary data stored in OldFrame to VeryOld.
- Parameters:
this (
object) –LineageDatainstanceselectedTrackArray (
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
arrayNxM- Authors:
Andreas P. Cuny - initial implementation
- 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) –LineageDatainstancexCoordinateArray (
array, kx1) – Array with x coordinatesyCoordinateArray (
array, kx1) – Array with y coordinatesneighbourhoodSearchRadius (
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
arrayNxM- Authors:
Andreas P. Cuny - initial implementation
- class TracX.@LineageData.LineageData¶
Bases:
handleLINEAGEDATA 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
- Property Summary
- NewFrame¶
NewFrame to keep obj frame properties for tracking
- OldFrame¶
OldFrame to keep obj frame properties for tracking
- VeryOld¶
VeryOld to keep obj frame properties for tracking
- numberOfTracks¶
Max number of tracks
- obj_area¶
Area of segmented object.
- obj_center_x¶
X component of segmented object center.
- obj_center_y¶
Y component of segmented object center.
- obj_center_z¶
Z component of segmented object center.
- obj_channel_id¶
Image channel id of segmented object.
- obj_close_neighbour¶
Neighbourhood of each object
- obj_dif_x¶
old to newFrame displacement in x.
- obj_dif_y¶
old to newFrame displacement in y.
- obj_dif_z¶
old to newFrame displacement in z.
- obj_filtered_dif_x¶
Filtered old to newFrame displacement in x.
- obj_filtered_dif_y¶
Filtered old to newFrame displacement in x.
- obj_filtered_dif_z¶
Filtered old to newFrame displacement in x.
- obj_fluoImgDenoised¶
chl_n}.
- Type:
Denoised image of obj_channel_id {obj1
- Type:
obj_n, chl_1
- obj_fluo_mean¶
Mean denoised signal of segmented object.
- obj_fluo_total¶
Total denoised signal of segmented object.
- obj_frame¶
Image frame number of segmented object.
- obj_index¶
Unique segmentation object label for each frame.
- obj_major_axis¶
Major axis of segmented object.
- obj_minor_axis¶
Minor axis of segmented object.
- obj_orientation¶
Orientation of segmented object.
- obj_parent_fluo_mean¶
Mean denoised signal of parent cell of segmented object (i.e. background).
- obj_parent_fluo_total¶
Total denoised signal of parent cell of segmented object (i.e. background).
- obj_parent_seg_mask_id¶
Cell segmentation mask id overlaping with object.
- obj_parent_track_index¶
Trackindex of parent cell.
- obj_parent_uuid¶
UUID of parent cell.
- obj_perimeter¶
Perimeter of segmented object.
- obj_pixelIdxList¶
chl_n}.
- Type:
Pixel indicies list of segmented object {obj1
- Type:
obj_n, chl_1
- obj_track_age¶
Track age of each obj
- obj_track_fingerprint_real¶
Track fingerprint real
- obj_track_index¶
Track index of obj
- track_fingerprint_real_distance¶
Track fingerprint read distance
- uuid¶
Primary key (unique identifier for each object).
- Method Summary
- InitializeVeryOld(this, assignmentRowIdx, maxTrackFrameSkipping)¶
INITIALIZEVERYOLD Initailizes the VeryOld property of the Tracker with data from OldFrame.
- Parameters:
this (
object) –LineageDatainstanceassignmentRowIdx (
int) – Row index of track assignment.maxTrackFrameSkipping (
int) – Max tolerated frames a track is allowed to be missing.
- Returns:
LineageDatainstance.- Return type:
this
object
- clearMarkerTracking(this)¶
CLEANMARKGERTRACKING Deletes all previous assignments made during marker trakcing (for cell cycle determination of asymmetrically dividing cells).
- Parameters:
this (
object) –LineageDatainstance- 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) –LineageDatainstancedataToSave (
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) –LineageDatainstancetrustedFrames (
array, kx1) – Array of trusted frames.currDaughter (
int) – Track index of current daughter.currMother (
int) – Track index of current mother.
- Returns:
LineageDatainstance.- Return type:
this
object
- 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) –LineageDatainstancexCoordinateArray (
array, kx1) – Array with x coordinatesyCoordinateArray (
array, kx1) – Array with y coordinatesneighbourhoodSearchRadius (
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
arrayNxM- Authors:
Andreas P. Cuny - initial implementation
- 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) –LineageDatainstancefieldName (
str) – String with fieldname where to get values from.fieldNameCond (
str) – String with fieldname to match the conditionCondition (
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) –LineageDatainstancefieldName (
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) –LineageDatainstanceframeNumber (
int) – Frame number for which the data should be retrieved.
- Returns:
Number of rows in
LineageDatafor frameNumber.- Return type:
nRows (
int)
- getTrackIndexStorageIndicies(this)¶
GETTRACKINDEXSTORAGEINDICIES Returns indicies of track_index where to store them.
- Parameters:
this (
object) –LineageDatainstance- 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
LineageDataobject.- Parameters:
this (
object) –LineageDatainstanceneighbourRadius (
int) – Distance in pixel to consider other cells to be a neighbouring cell.nUniqueFrames (
int) – Max number of frames to initialize neighbourhood.
- Returns:
LineageDatainstance.- 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) –LineageDatainstanceframeNumber (
int) – Frame number of subsequent image frame.
- Returns:
Initializes the
LineageData.NewFrameobject and returnsLineageData.- 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) –LineageDatainstance- Returns:
LineageDatainstance.- Return type:
this
object
- moveToVeryOld(this, selectedTrackArray, neighbourhoodSearchRadius)¶
MOVETOVERYOLD Moves temporary data stored in OldFrame to VeryOld.
- Parameters:
this (
object) –LineageDatainstanceselectedTrackArray (
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
arrayNxM- Authors:
Andreas P. Cuny - initial implementation
- 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) –LineageDatainstanceframeNumber (
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) –LineageDatainstancefieldName (
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) –LineageDatainstancedaughters (
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:
LineageDatainstance.- 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:
LineageDatainstance :type this:object- Returns:
LineageDatainstance.- Return type:
this
object
- updateTemporaryTrackingDataForNextFrameEvaluation(this, neighbourhoodSearchRadius)¶
UPDATETEMPORARYTRACKINGDATAFORNEXTFRAMEEVALUATION Update the temporary data (oldFrame) by joining newFrame and veryOld for the next frame track assignment iteration.
- Parameters:
this (
object) –LineageDatainstanceneighbourRadius (
int) – Distance in pixel to consider other cells to be a neighbouring cell.
- Return type:
void (
-)
Motion¶
- 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) –Motioninstancex (
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.meanCellDiameternStd (
int, 1x1) – : Nr of standard deviations to keep from the mean vector length of the vector field.
- Returns:
invalidVectorsIdx (
arrayNx1) – Logical indicies of invalid vector lengths.vecLength (
arrayNx1) – Array of common vector lengths.
- 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) –MotioninstanceX (
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 directionradiusSupportY (
int) – Radius of the Gaussian weighting function support in Y direction
- Returns:
wdX (
arrayNx1) – Filtered components ate the X positions with calculated Gaussian weightswdY (
arrayNx1) – Filtered components ate the Y positions with calculated Gaussian weights.
- Authors:
Aaron Ponti - initial implementation in Python
- Authors:
Andreas P. Cuny - Translation to Matlab
- class TracX.@Motion.Motion¶
MOTION class to deal with cell motion and filter vectorns on consecutive images.
- Authors:
Andreas P. Cuny - initial implementation
- Constructor Summary
- Motion()¶
MOTION Constructs a
Motionobject to deal with cell motion and filter vectorns on consecutive images.- Returns:
obj – Returns a
Motioninstance- Return type:
object- Authors:
Andreas P. Cuny - initial implementation
- Method Summary
- 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) –MotioninstanceX (
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 directionradiusSupportY (
int) – Radius of the Gaussian weighting function support in Y direction
- Returns:
wdX (
arrayNx1) – Filtered components ate the X positions with calculated Gaussian weightswdY (
arrayNx1) – Filtered components ate the Y positions with calculated Gaussian weights.
- Authors:
Aaron Ponti - initial implementation in Python
- Authors:
Andreas P. Cuny - Translation to Matlab
- 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) –Motioninstancex (
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.meanCellDiameternStd (
int, 1x1) – : Nr of standard deviations to keep from the mean vector length of the vector field.
- Returns:
invalidVectorsIdx (
arrayNx1) – Logical indicies of invalid vector lengths.vecLength (
arrayNx1) – Array of common vector lengths.
- Authors:
Andreas P. Cuny - initial implementation
- interpolateVectorComponents(~, x, y, fdX, fdY, fdZ, Lia, neighbourLocIdxMatrix)¶
INTERPOLATEVECTORCOMPONENTS Averages vector components by its neighbourhood.
- Parameters:
ignoredArg (
object) –Motioninstancex (
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 (
arrayNx1) – Filtered components ate the X positions with averaged components.wdY (
arrayNx1) – Filtered components ate the Y positions with averaged components.
- 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) –Motioninstancex (
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 (
arrayNx1) – Filtered components ate the X positions with averaged components.wdY (
arrayNx1) – Filtered components ate the Y positions with averaged components.
- Authors:
Andreas P. Cuny - initial implementation
NonAssignedTracks¶
- class TracX.@NonAssignedTracks.NonAssignedTracks¶
Bases:
handleNONASSIGNEDTRACKS 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
- Constructor Summary
- NonAssignedTracks()¶
NONASSIGNEDTRACKS Constructs a
NonAssignedTracksobject instance to keep teporary frame data during tracking.- Returns:
obj – Returns
NonAssignedTracksinstance.- Return type:
object- Authors:
Andreas P. Cuny - initial implementation
- Property Summary
- 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
- maxTrackFrameSkipping¶
ParameterConfigurationmaxTrackFrameSkipping
- 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
- Method Summary
- addCell(this, data, varargin)¶
ADDCELL Adds a cell to TracX.NonAssignedTracks instance to keep teporary the data of non assigned tracks.
- Parameters:
this (
object) –NonAssignedTracksinstance.data (
array) – Data array in order of propertiesvarargin (
array) – Optional input
- Returns:
Adds data to
NonAssignedTracksdirectly.- Return type:
void (
-)
- evaluateTrackAge(this)¶
EVALUTATETRACKAGE Evaluates track age and removes cell above maxTrackFrameSkipping threshold.
- Parameters:
this (
object) –NonAssignedTracksinstance.- Returns:
Adds data to
NonAssignedTracksdirectly.- Return type:
void (
-)
- getCellStruct(this)¶
GETCELLSTRUCT Returns data as struct.
- Parameters:
this (
object) –NonAssignedTracksinstance.- Returns:
Data from TracX.NonAssignedTracks as formated struct.
- Return type:
ret (
struct)
- increaseTrackAge(this)¶
INCREASETRACKAGE Increases track age by one.
- Parameters:
this (
object) –NonAssignedTracksinstance.- Returns:
Acts on
NonAssignedTracksdirectly- Return type:
void (
-)
- merge(~, structA, structB)¶
MERGE Merges two structs.
- Parameters:
ignoredArg (
object) –NonAssignedTracksinstance.structA (
struct) – Struct AstructB (
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) –NonAssignedTracksinstance.track_index (
array) – Track indices of data to be removed
- Returns:
Removes data from
NonAssignedTracksdirectly.- Return type:
void (
-)
- setMaxTrackFrameSkipping(this, maxTrackFrameSkipping)¶
SETMAXTRACKFRAMESKIPPING Sets the max track frame skipping threshold.
- Parameters:
this (
object) –NonAssignedTracksinstance.maxTrackFrameSkipping (
int) – Max track frame skipping threshold
- Returns:
Acts on
NonAssignedTracksdirectly- Return type:
void (
-)
ProjectConfiguration¶
- class TracX.@ProjectConfiguration.ProjectConfiguration¶
Bases:
handlePROJECTCONFIGURATION 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
- Constructor Summary
- ProjectConfiguration()¶
PROJECTCONFIGURATION Constructs an empty ProjectConfiguration object.
- Returns:
ProjectConfigurationinstance- Return type:
this (
object)
- Property Summary
- cellDivisionType¶
Cell division type
- controlPrefix¶
Prefix for segmentation control files.
- 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¶
Default fontsize for plotting.
- 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¶
Image directory to be used in the current project.
- imageFileArray¶
Array of all image file names
- imageFileFormat¶
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¶
Prefix for segmentation mask files.
- nFramesToImport¶
Number of frames to import. If for e.g. not all files should be tracked.
- projectName¶
Name of ccurrent project (i.e. experiment name).
- segmentationControlFileArray¶
Array of all segmentation control image file names
- segmentationResultDir¶
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
- trackerEndFrame¶
End frame number where the tracker should terminate.
- trackerPrefix¶
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.
- Method Summary
- addFluoImage(this, fluoImgFile)¶
ADDFLUOIMAGE Adds the fluo image identifier.
- Parameters:
this (
object) –ProjectConfigurationinstance.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) –ProjectConfigurationinstance.fluoImgFile (
str) – Fluorescence image file name.tag (
str) – Fluorescence image file name channel identifier.
- Return type:
void (
-)
- checkProjectConfiguration(this)¶
CHECKPROJECTCONFIGURATION Checks if all values in the ProjectConfiguration object are defined.
- Parameters:
this (
object) –ProjectConfigurationinstance.- Return type:
void (
-)
- createProjectConfiguration(this, projectName, imageDir, segmentationResultDir, fileIdentifierFingerprintImages, fileIdentifierWellPositionFingerprint, fileIdentifierCellLineage, imageCropCoordinateArray, varargin)¶
CREATEPROJECTCONFIGURATION creates a ProjectConfiguration object for a given TracX project
- Parameters:
this (
object) –ProjectConfigurationinstance.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:
ProjectConfigurationinstance 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) –ProjectConfigurationinstance.- Return type:
void (
-)
- getControlImageFormat(this)¶
GETCONTROLIMAGEFORMAT Returns the image file format of the segmentation control images.
- Parameters:
this (
object) –ProjectConfigurationinstance.- 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) –ProjectConfigurationinstanceidx (
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) –ProjectConfigurationinstance.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) –ProjectConfigurationinstance- Returns:
Number of fluorescence channels in thisexperiment.
- Return type:
nfluoImageIdentifier (
int)
- 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:
this (
object) –ProjectConfigurationinstance.cellDivisionType (
str) – Cell division type.
- Return type:
void (
-)
- setControlPrefix(this, controlPrefix)¶
SETCONTROLPREFIX Sets control output filename prefix
- Parameters:
this (
object) –ProjectConfigurationinstance.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) –ProjectConfigurationinstance.fileIdentFingerprintImages (
str) – File name identifier of images to be used for fingerprint computationfileIdentWellPosFingerPrint (
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) –ProjectConfigurationinstance.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) –ProjectConfigurationinstance.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) –ProjectConfigurationinstance.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:
this (
object) –ProjectConfigurationinstance.fontSize (
str) – Label font size.
- Return type:
void (
-)
- setImageBitDepth(this, val)¶
SETIMAGEBITDEPTH Sets the image bit depth.
- Parameters:
this (
object) –ProjectConfigurationinstance.val (
int) – BitDepth (imfinfo)
- 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) –ProjectConfigurationinstance.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) –ProjectConfigurationinstance.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:
this (
object) –ProjectConfigurationinstance.val (
int) – Depth (imfinfo)
- Return type:
void (
-)
- setImageDir(this, path)¶
SETIMAGEDIR Sets the directory to all the images of the TracX project.
- Parameters:
this (
object) –ProjectConfigurationinstance.path (
str) – Path to project images.
- Return type:
void (
-)
- setImageFileArray(this, varargin)¶
SETIMAGEFILEARRAY Sets all the image names
- Parameters:
this (
object) –ProjectConfigurationinstance.varargin (
array) – Optional array with image filenames.
- Return type:
void (
-)
- setImageFileFormat(this, imageFileFormat)¶
SETIMAGEFILEFORMAT Sets the image file format.
- Parameters:
this (
object) –ProjectConfigurationinstance.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:
this (
object) –ProjectConfigurationinstance.fileNames (
str) – File names.
- Return type:
void (
-)
- setImageFrameNumberArray(this, frameArray)¶
SETIMAGEFRAMENUMBERARRAY Sets all the image frame numbers. According to the file name convention: ChannelID_WellPosition_ImageFrameNumber.FileType
- Parameters:
this (
object) –ProjectConfigurationinstance.frameArray (
int) – Image frame number array.
- Return type:
void (
-)
- setImageHeight(this, val)¶
SETIMAGEHEIGHT Sets the image height.
- Parameters:
this (
object) –ProjectConfigurationinstance.val (
int) – Image height (imfinfo)
- Return type:
void (
-)
- setImageIdentifiers(this)¶
SETIMAGEIDENTIFIERS Sets all the image identifiers. The convention is ChannelID_WellPosition_ImageFrameNumber.FileType.
- Parameters:
this (
object) –ProjectConfigurationinstance
- setImageMaxSampleValue(this, val)¶
SETIMAGEMAXSAMPLEVALUE Sets the image max sample value.
- Parameters:
this (
object) –ProjectConfigurationinstance.val (
int) – MaxSampleValue (imfinfo)
- Return type:
void (
-)
- setImageMinSampleValue(this, val)¶
SETIMAGEMINSAMPLEVALUE Sets the image min sample value.
- Parameters:
this (
object) –ProjectConfigurationinstance.val (
int) – MinSampleValue (imfinfo)
- Return type:
void (
-)
- setImagePositionArray(this, pos)¶
SETIMAGEPOSITIONARRAY Sets the image position array of multi well experiments.
- Parameters:
this (
object) –ProjectConfigurationinstance.pos (
str) – Array with well positions names.
- Return type:
void (
-)
- setImagePrefixArray(this, prefixArray)¶
SETIMAGEPREFIXARRAY Sets all the image prefixes. According to the file name convention: ChannelID_WellPosition_ImageFrameNumber.FileType
- Parameters:
this (
object) –ProjectConfigurationinstance.prefixArray (
str) – Image prefix array.
- 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) –ProjectConfigurationinstance.- Return type:
void (
-)
- setImageWidth(this, val)¶
SETIMAGEWIDTH Sets the image width.
- Parameters:
this (
object) –ProjectConfigurationinstance.val (
int) – Image width (imfinfo)
- Return type:
void (
-)
- setMaskPrefix(this, maskPrefix)¶
SETMASKPREFIX Sets mask output filename prefix
- Parameters:
this (
object) –ProjectConfigurationinstance.maskPrefix (
str) – Mask file name prefix.
- Return type:
void (
-)
- setMatFileNames(this)¶
SETMATFILEMANES Sets all the mat file names.
- Parameters:
this (
object) –ProjectConfigurationinstance.- Return type:
void (
-)
- setNFramesToImport(this, nFrames)¶
SETNFRAMESTOIMPORT Sets max nr of image frames to import.
- Parameters:
this (
object) –ProjectConfigurationinstance.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) –ProjectConfigurationinstance.projectName (
str) – Name of project/experiment.
- Return type:
void (
-)
- setSegmentationControlFileArray(this, varargin)¶
SETSEGMENTATIONCONTROLFILEARRAY Sets all the segmentation control files.
- Parameters:
this (
object) –ProjectConfigurationinstance.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) –ProjectConfigurationinstance.- Return type:
void (
-)
- setSegmentationResultDir(this, path)¶
SETSEGMENTATIONRESULTDIR Sets the directory to all the segmentation results of the TracX project.
- Parameters:
this (
object) –ProjectConfigurationinstance.path (
str) – Path to project images.
- Return type:
void (
-)
- setSegmentationResultFileArray(this, fileNames)¶
SETSEGMENTATIONRESULTFILEARRAY Sets all the text file names of the segmentation results.
- Parameters:
this (
object) –ProjectConfigurationinstance.fileNames (
str) – File names.
- Return type:
void (
-)
- setSegmentationResultMaskFileArray(this, varargin)¶
SETSEGMENTATIONRESULTMASKFILEARRAY Sets all the segmentation mask file names.
- Parameters:
this (
object) –ProjectConfigurationinstance.varargin (
array,) – Array with mask filenames.
- Return type:
void (
-)
- setSegmentationResultMatFileArray(this, fileNames)¶
SETSEGMENTATIONRESULTMATFILEARRAY Sets all the mat file names of the segmentation results.
- Parameters:
this (
object) –ProjectConfigurationinstance.fileNames (
str) – File names.
- Return type:
void (
-)
- setTrackerEndFrame(this, f)¶
SETTRACKERENDFRAME Sets the end frame of the current tracking project.
- Parameters:
this (
object) –ProjectConfigurationinstance.f (
int) – Last image frame number of track.
- Return type:
void (
-)
- setTrackerPrefix(this, trackerPrefix)¶
SETTRACKERPREFIX Sets tracker output filename prefix
- Parameters:
this (
object) –ProjectConfigurationinstance.trackerPrefix (
str) – Tracker output file name prefix.
- Return type:
void (
-)
- setTrackerResultMaskFileArray(this, varargin)¶
SETTRACKERRESULTMASKFILEARRAY Sets all the tracker mask file names.
- Parameters:
this (
object) –ProjectConfigurationinstance.varargin (
array,) – Array with tracker mask filenames.
- Return type:
void (
-)
- setTrackerResultsDirectory(this, path)¶
SETTRACKERRESULTSDIRECTORY Sets the tracker results directory.
- Parameters:
this (
object) –ProjectConfigurationinstance.path (
str) – Path to tracker results dir.
- Return type:
void (
-)
- setTrackerStartFrame(this, f)¶
SETTRACKERSTARTFRAME Sets the end frame of the current tracking project.
- Parameters:
this (
object) –ProjectConfigurationinstance.f (
int) – First image frame number of track.
- Return type:
void (
-)
ParameterConfiguration¶
- class TracX.@ParameterConfiguration.ParameterConfiguration¶
Bases:
handle,matlab.mixin.CustomDisplayPARAMETERCONFIGURATION 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
- Property Summary
- active3DFingerprint¶
> is 3D fingerprint used or closest z stack method > optional param
- averageCellSizeGrowth¶
> 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¶
> 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
- data3D¶
> is data 2D (0) or 3D (1)? > optional param
- debugLevel¶
> 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¶
> 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¶
> 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¶
> 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¶
> ROF denoising parameter theta for division marker. > (Lineage reconstruction) > > ROF de-noising parameter theta used for de-noising fluorescent > images. > optional param
- divisionMarkerEdgeSensitivityThresh¶
> Edge sensitivity threshold for division marker segmentation > [0-1] > (Lineage reconstruction) > > Edge sensitivity threshold for division marker segmentation > optional param
- divisionMarkerFingerprintHalfWindowSideLength¶
> 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¶
> Number of DCT frequencies to include for fingerprint computation > (Lineage reconstruction) > > Number of DCT frequencies to include for fingerprint computation; > optional param
- divisionMarkerFingerprintResizeFactor¶
> Resize factor for fingerprint calculation > (Lineage reconstruction) > > Resize factor applied to image matrix before fingerprint > calculation; > optional param
- divisionMarkerIndividualFunctionPenalty¶
> Individual function penalty > (Lineage reconstruction) > > Individual penalty maximum for each cost function (e.g. for > position, area, rotation, frame skipping); > optional param
- divisionMarkerLineProfileLength¶
> 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¶
> 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¶
> 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¶
> 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¶
> 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¶
> 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¶
> Max allowed fractional marker size decrease > (Lineage reconstruction) > > Penalty for maximum fractional segmented object size decrease for > subsequent image frames; > optional param
- divisionMarkerMaxObjSizeIncrease¶
> Max allowed fractional marker size increase > (Lineage reconstruction) > > Penalty for maximum fractional segmented object size increase for > subsequent image frames; > optional param
- divisionMarkerMaxTrackFrameSkipping¶
> 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¶
> 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¶
> 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¶
> 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¶
> 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¶
> 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¶
> 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¶
> 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¶
> 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¶
> 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¶
> Number of DCT frequencies to include for fingerprint computation > (Tracker core) > > Number of DCT frequencies to include for fingerprint computation; > advanced param
- fingerprintResizeFactor¶
> Resize factor for fingerprint calculation > (Tracker core) > > Resize factor applied to image matrix before fingerprint > calculation; > general param
- individualFunctionPenalty¶
> Individual function penalty > (Tracker core) > > Individual penalty maximum for each cost function (e.g. for > position, area, rotation, frame skipping); > general param
- major¶
Current latest version major of TracX.
- maskOverlayAlpha¶
> 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¶
> 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¶
> Max allowed fractional cell size decrease > (Tracker core) > > Penalty for maximum fractional segmented object size decrease for > subsequent image frames; > general param
- maxCellSizeIncrease¶
> Max allowed fractional cell size increase > (Tracker core) > > Penalty for maximum fractional segmented object size increase for > subsequent image frames; > general param
- maxExpectedMovement¶
> 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¶
> 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¶
> 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¶
> 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¶
> 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¶
Current latest version minor of TracX.
- neighbourhoodSearchRadius¶
> 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¶
Current latest version patch of TracX.
- pixelsPerZPlaneInterval¶
> 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¶
> 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¶
> 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¶
> 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
- usedFunctionsForCostMatrix¶
> 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
- Method Summary
- checkParameterConfiguration(this)¶
CHECKPARAMETERCONFIGURATION Checks if all values in the ParameterConfiguration object are defined.
- Parameters:
this (
object) –ParameterConfigurationinstance- Return type:
void
-
- setActive3DFingerprint(this, value)¶
SETACTIVE3DFINGERPRINT Sets value if 3D fingerprint should be activated.
- Parameters:
this (
object) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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:
this (
object) –ParameterConfigurationinstance.value (
bool) – Value if data is three dimensional.
- Return type:
void (
-)
- setDebugLevel(this, value)¶
SETDEBUGLEVEL Sets value for the debug level.
- Parameters:
this (
object) –ParameterConfigurationinstance.value (
int) – Value for the debug level.
- Return type:
void (
-)
- setDivisionMarkerAverageObjSizeGrowth(this, value)¶
SETDIVISIONMARKERAVERAGEOBJSIZEGROWTH Sets value for the divisison marker max object size growth.
- Parameters:
this (
object) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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:
this (
object) –ParameterConfigurationinstance.value (
int) – Value for the line profile length.
- 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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.value (
float) – Sets value for majoraxis rotation penalty [degrees].
- Return type:
void (
-)
- setMaxTrackFrameSkipping(this, value)¶
SETMAXTRACKFRAMESKIPPING Sets value for max allowed frame skip.
- Parameters:
this (
object) –ParameterConfigurationinstance.value (
int) – Sets value for max allowed frame skip.
- 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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.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) –ParameterConfigurationinstance.value (
array, 1x4) – Sets value for the selection of which of the four cost functions should be used.
- Return type:
void (
-)
QuantificationData¶
- class TracX.@QuantificationData.QuantificationData¶
Bases:
handle,dynamicpropsQUANTIFICATIONDATA 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
- Constructor Summary
- 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
QuantificationDatainstance.- Return type:
object- Authors:
Andreas P. Cuny - initial implementation
- Property Summary
- fluo_background_mean¶
Fluorescence channel name [string]
- fluo_background_std¶
Mean background fluorescence [a.u.]
- fluo_bright_euler¶
Quantile 25 brightest pixel fluorescence [a.u.]
- fluo_bright_q25¶
Quantile 50 brightest pixel fluorescence [a.u.]
- fluo_bright_q50¶
Quantile 75 brightest pixel fluorescence [a.u.]
- fluo_bright_q75¶
Brightest pixel of whole cell fluorescence [a.u.]
- fluo_bright_total¶
Quantile 25 of cell nucleus fluorescence [a.u.]
- fluo_cell_q25¶
Quantile 50 of cell fluorescence [a.u.]
- fluo_cell_q50¶
Quantile 75 of cell fluorescence [a.u.]
- fluo_cell_q75¶
Total cell fluorescence [a.u.]
- fluo_cell_total¶
Standard deviation of background fluorescence [a.u.]
- fluo_mem_q25¶
Quantile 50 of cell fluorescence [a.u.]
- fluo_mem_q50¶
Quantile 75 cell membrane fluorescence [a.u.]
- fluo_mem_q75¶
Total cell membrane fluorescence [a.u.]
- fluo_mem_total¶
Quantile 25 of cell fluorescence [a.u.]
- fluo_name¶
Id of fluorescence channel [int].
- fluo_nuc_q25¶
Quantile 50 of cell nucleus fluorescence [a.u.]
- fluo_nuc_q50¶
Quantile 75 of cell nucleus fluorescence [a.u.]
- fluo_nuc_q75¶
Total cell nucleus fluorescence [a.u.]
- fluo_nuc_total¶
Quantile 25 of cell fluorescence [a.u.]
- uuid¶
Primary key
- Method Summary
- 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:
this (
object) –QuantificationDatainstance.value (
int) – Value to be set for uuid
SegmentationData¶
- class TracX.@SegmentationData.SegmentationData¶
Bases:
dynamicpropsSegmentationData 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
- Constructor Summary
- SegmentationData()¶
SEGMENTATIONDATA Constructs an empty
SegmentationDataobject to save segmentation data as well as tracking results. for a TracX project.- Returns:
SegmentationDatainstance.- Return type:
obj (
object)- Authors:
Andreas P. Cuny - initial implementation
- Property Summary
- cell_area¶
Orientation of segmented cell.
- cell_center_x¶
Unique segmentation cell index for each frame.
- cell_center_y¶
X component of segmented cell center.
- cell_center_z¶
Y component of segmented cell center
- cell_close_neighbour¶
Nucleus area of segmented cell.
- cell_dif_x¶
Array of closest cell neighbours of segmented cell.
- cell_dif_y¶
X component difference between two subsequent frames of segmented cell.
- cell_dif_z¶
Y component difference between two subsequent frames of segmented cell.
- cell_eccentricity¶
Perimeter of segmented cell.
- cell_filtered_dif_x¶
Z component difference between two subsequent frames of segmented cell.
- cell_filtered_dif_y¶
Filtered X component difference between two subsequent frames of segmented cell.
- cell_filtered_dif_z¶
Filtered Y component difference between two subsequent frames of segmented cell.
- cell_fractionOfGoodMembranePixels¶
Eccentricity of segmented cell.
- cell_index¶
Image frame number of segmented cell.
- cell_majoraxis¶
Z component of segmented cell center
- cell_mask_boundary_points¶
Budneck total fluo signal for the given track
- cell_mem_area¶
Fraction of good membrane pixel of segmented cell.
- cell_mem_volume¶
Membrane area of segmented cell.
- cell_minoraxis¶
Major axis of segmented cell.
- cell_nuc_area¶
Nucleus radius of segmented cell
- cell_nuc_radius¶
Membrane volume of segmented cell..
- cell_orientation¶
Minor axis of segmented cell.
- cell_perimeter¶
Volume of segmented cell.
- cell_pole1_age¶
Cell pole 2 y component (optionally, for rod shaped object lineage reconstruction)
- cell_pole1_x¶
Filtered Z component difference between two subsequent frames of segmented cell.
- cell_pole1_y¶
Cell pole 1 x component (optionally, for rod shaped object lineage reconstruction)
- cell_pole2_age¶
Cell pole 1 age (optionally, for rod shaped object lineage reconstruction)
- cell_pole2_x¶
Cell pole 1 y component (optionally, for rod shaped object lineage reconstruction)
- cell_pole2_y¶
Cell pole 2 x component (optionally, for rod shaped object lineage reconstruction)
- cell_timepoint¶
Cell pole 2 age (optionally, for rod shaped object lineage reconstruction)
- cell_volume¶
Area of segmented cell.
- cell_zplane¶
Cell timpoint (3D data)
- track_age¶
Track fingerprint distance of segmented cell based on track_fingerprint_real.
- track_area_assignment_cost¶
Track positional assignment costs of segmented cell.
- track_assignment_fraction¶
Track cell cycle phase
- track_budneck_total¶
Track has bud indicates whether a track in a certain frame is budding
- track_cell_cycle_phase¶
Track lineage of segmented cell.
- track_contained_in_track¶
Track index corrected of segmented cell.
- track_end_frame¶
Track start frame number of segmented cell determined by penalty function.
- track_fingerprint_real¶
Track index of segmented cell after qc verification
- track_fingerprint_real_distance¶
Track real frequency based fingerprint of segmented cell.
- track_frame_skipping_cost¶
Track rotation assignment costs of segmented cell determined by penalty function.
- track_generation¶
Track parent score of parent assignment.
- track_has_bud¶
Track cointained in other track of segmented cell.
- track_index_corrected¶
Track end frame number of segmented cell.
- track_index_qc¶
Track index of segmented cell.
- track_lineage_tree¶
Track generation of segmented cell.
- track_parent¶
Track age of segmented cell.
- track_parent_frame¶
Track parent of segmented cell.
- track_parent_prob¶
Track parent frame of segmented cell.
- track_parent_score¶
Track parent probabliity of parent assignment.
- track_position_assignment_cost¶
Track total assignment costs of segmented cell.
- track_rotation_assignment_cost¶
Track area assignment costs of segmented cell determined by penalty function.
- track_start_frame¶
Track frame skipping assignment costs of segmented cell determined by penalty function.
- track_total_assignment_cost¶
Track assignment fraction if there is a better alternative assignment.
- uuid¶
Primary key
- Method Summary
- 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 instanceuuid (
int) – Primary keycell_frame (
int) – Image frame numbercell_index (
int) – Unique segmentation cell index for each framecell_center_x (
int) – X coordinate of segmented objectcell_center_y (
int) – Y coordinate of segmented objectcell_majoraxis (
float) – Major axiscell_minoraxis (
float) – Minor axiscell_orientation (
float) – Orienationcell_area (
float) – Areacell_volume (
float) – Volumecell_perimeter (
float) – Perimetercell_eccentricity (
float) – Eccentricitycell_fractionOfGoodMembranePixels (
float) – Fraction of good membrane pixelscell_mem_area (
float) – Membrane areacell_mem_volume (
float) – Membrane volumecell_nuc_radius (
float) – Nucleus radiuscell_nuc_area (
float) – Nucleus areacell_close_neighbour (
array) – Array of closest cell neighbourscell_dif_x (
float) – Frame to frame difference of X coordinatecell_dif_y (
float) – Frame to frame difference of Y coordinatecell_filtered_dif_x (
float) – Filtered frame to frame difference difference of X coordinatecell_filtered_dif_y (
float) – Filtered frame to frame difference difference of Y coordinatecell_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 indextrack_index_qc (
int) – Unique qc verified track indextrack_fingerprint_real (
array) – Track fingerprint realtrack_fingerprint_real_distance (
float) – Track fingerprint real distancetrack_age (
int) – Track agetrack_parent (
ont) – Track parenttrack_parent_frame (
int) – Track parent frametrack_parent_prob (
float) – Track parent assignemt probabilitytrack_parent_score (
float) – Track parent assignemt scoretrack_generation (
int) – Track generationtrack_lineage_tree (
int) – Track lineagetrack_assigmnent_fraction (
float) – Assignment fractiontrack_total_assignment_cost (
float) – Track total assignment coststrack_position_assignment_cost (
float) – Track positional coststrack_area_assignment_cost (
float) – Track area coststrack_rotation_assignment_cost (
float) – Track orientation coststrack_frame_skipping_cost (
float) – Track frame skipping coststrack_start_frame (
int) – Track start frametrack_end_frame (
int) – Track end frametrack_index_corrected (
int) – Track index correctedtrack_contained_in_track (
int) – Track contained in other tracktrack_has_bud (
int) – Track has bud indicates if a track is budding in a certain cell_frametrack_budneck_total (
float) – Total budneck signal
- Returns:
SegmentationDatainstance. 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) –SegmentationDatainstance.value (
int) – Sets value for uuid.
TemporaryData¶
- class TracX.@TemporaryData.TemporaryData¶
TEMPORARYDATA acts as temprorary data container for
TemporaryTrackingData.- Authors:
Andreas P. Cuny - initial implementation
- Constructor Summary
- TemporaryData()¶
TEMPORARYDATA Constructs a
TemporaryDataobject instance to keep teporary frame data during tracking.- Returns:
obj – Returns
TemporaryDatainstance.- Return type:
object- Authors:
Andreas P. Cuny - initial implementation
- Property Summary
- NewFrame¶
TemporaryTrackingDataobject holding the current image frame data.
- VeryOld¶
TemporaryTrackingDataobject holding the subsequent image frame data.
- Method Summary
- initializeOldFrame(this)¶
INITIALIZEOLDFRAME Initailizes the OldFrame property of the Tracker with data from the
TemporaryDataobject for the first image frame (frameNumber == 1).- Parameters:
this (
object) –TemporaryDatainstance- Returns:
this – Initializes the
TemporaryData.OldFrameproperty and returns theTemporaryDatainstance parametrized.- Return type:
object
TemporaryLineageAssignment¶
- class TracX.@TemporaryLineageAssignment.TemporaryLineageAssignment¶
Bases:
handle,matlab.mixin.CopyableTEMPORARYLINEAGEASSIGNMENT Stores temporary mother daughter lineage assignments until final decision is made which cells to assign.
- Authors:
Andreas P. Cuny - initial implementation
- Constructor Summary
- TemporaryLineageAssignment()¶
TEMPORARYLINEAGETEMPASSIGNMENT Object constructor.
- Returns:
TemporaryLineageAssignmentinstance- Return type:
obj
object- Authors:
Andreas P. Cuny - initial implementation
- Property Summary
- daughterCell¶
DaughterCell property stores daughter cells’ track indicies.
- daughterCellStartFrame¶
Start frame of daughter cell segmentation (can be error prone due to missing segmentation)
- frameOfMDPair¶
Frame on which a mother daughter pair was found
- hasBudNeckSignal¶
Binary bud neck signal quantification
- isManualCorr¶
isManualCorr indicates if assignment has been manually corrected
- lineProfile¶
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¶
Track index of marker corresponding to MD pair.
- markerTrackEndFrame¶
Track index of marker corresponding to MD pair end frame (can be error prone due to low SNR / not detectable signal)
- markerTrackStartFrame¶
Track index of marker corresponding to MD pair start frame
- maxFrameEvalAfterBirth¶
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¶
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¶
Flag if reconstruction has been finished sucessfully
- Method Summary
- deleteEntry(this, delIdx)¶
DELETEENTRY Deletes a mother daughter (MD) pair entry form
TemporaryLineageAssignment- Parameters:
this (
object) –TemporaryLineageAssignmentinstancedelIdx (
int) – Index for deletion.
- Return type:
void (
-)
- deleteRow(this, daughterArray)¶
DELETEROW Deletes the row of assigned mother - daughter pairs.
- Parameters:
this (
object) –TemporaryLineageAssignmentinstancedaughterArray (
arraykx1) – 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) –TemporaryLineageAssignmentinstance- Return type:
void (
-)
- 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) –TemporaryLineageAssignmentinstancep (
arraykx1) – Probability of MD (mother daughter pair) assignments.occ (
array, kx1) – MD pair detection occurance.
- Returns:
Weighted score for MD assignments.
- Return type:
score (
float)
- replaceOrAddNew(this, data2Modify)¶
REPLACEORADDNEW Replaces or adds new data to
TemporaryLineageAssignment- Parameters:
this (
object) –TemporaryLineageAssignmentinstancedata2Modify (
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) –TemporaryLineageAssignmentinstancemarkerID (
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:
this (
object) –TemporaryLineageAssignmentinstancelineageData (
object) – Marker lineage data.
- 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) –TemporaryLineageAssignmentinstancedaughterArray (
arraykx1) – With daughter track_index to add to the object for evaluation.motherArray (
arraykx1) – With mother track_index to add to the object for evaluationframeNumber (
int) – Image frame numberbudNeckSig (
bool) – Flag if budneck signal was detected 1, 0 otherwise.lineProfileRe (
array1x100) – 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) –TemporaryLineageAssignmentinstancesigInNuc (
int) – Flag if signal in nucleus has been detected.daughter (
int) – Daughter track index.
- Return type:
void (
-)
TemporaryTrackingData¶
- class TracX.@TemporaryTrackingData.TemporaryTrackingData¶
Bases:
handleTEMPORARYTRACKINGDATA Creates an object of minimal required information needed for frame to frame tracking.
- Authors:
Andreas P. Cuny - initial implementation
- Constructor Summary
- 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:
TemporaryTrackingDatainstance.- Return type:
this (
object)- Authors:
Andreas P. Cuny - initial implementation
- Property Summary
- cell_area¶
Orientation of segmented cell.
- cell_center_x¶
Segmentation cell index of segmented cell.
- cell_center_y¶
X component of segmented cell.
- cell_center_z¶
Y component of segmented cell.
- cell_close_neighbour¶
Area of segmented cell.
- cell_del¶
Array of closest cell neighbours of segmented cell.
- cell_dif_x¶
Z component of segmented cell.
- cell_dif_y¶
X component frame to frame difference of segmented cell.
- cell_dif_z¶
Y component frame to frame difference of segmented cell.
- cell_filtered_dif_x¶
Z component frame to frame difference of segmented cell.
- cell_filtered_dif_y¶
Filtered x component frame to frame difference of segmented cell.
- cell_filtered_dif_z¶
Filtered y component frame to frame difference of segmented cell.
- cell_index¶
Track age segmented cell.
- cell_orientation¶
Filtered z component frame to frame difference of segmented cell.
- track_age¶
Track index qc validated of segmented cell.
- track_assignment_fraction¶
Track fingerprint distance of segmented cell based on track_fingerprint_real.
- track_fingerprint_age¶
Fraction of neighbouring cell with lower track_fingerprint_real_distance
- track_fingerprint_real¶
Deletion of segmented cell.
- track_fingerprint_real_distance¶
Track real frequency based fingerprint of segmented cell.
- track_index_qc¶
Track index of segmented cell.
- Method Summary
- 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) –TemporaryTrackingDatainstance.track_index (
int, kx1) – Unique track index arrautrack_index_qc (
int, kx1) – Unique qc verified track index arraytrack_age (
int, kx1) – Track age arraucell_index (
int, kx1) – Unique segmentation cell index for each frame arraycell_center_x (
double, kx1) – X coordinate arraycell_center_y (
double, kx1) – Y coordinate arraycell_center_z (
double, kx1) – Z coordinate arraycell_dif_x (
double, kx1) – Frame to frame difference of X coordinates arraycell_dif_y (
double, kx1) – Frame to frame difference of Y coordinates arraycell_dif_z (
double, kx1) – Frame to frame difference of Z coordinates arraycell_filtered_dif_x (
double, kx1) – Filtered frame to frame differences of X coordinates arraycell_filtered_dif_y (
double, kx1) – Filtered frame to frame differences of Y coordinates arraycell_filtered_dif_z (
double, kx1) – Filtered frame to frame differences of Z coordinates arraycell_orientation (
double, kx1) – Orienationcell_area (
double, kx1) – Areacell_close_neighbour (
bool, kxk) – Matrix of closest cell neighbourscell_del (
int, kx1) – Cell deletiontrack_fingerprint_real (
double, kx1) – Track fingerprint realtrack_fingerprint_real_distance (
double, kx1) – Track fingerprint real distancetrack_assignment_fraction (
double, kx1) – Fraction of neighbouring cell with lower track_fingerprint_real_distancetrack_fingerprint_age (
int, kx1) – Track fingerprint age
- Returns:
Returns TracX.TemporaryTrackingData
- Return type:
this (
object)
- recalculateMotionCorrNeighbourhood(this, neighbourhoodSearchRadius)¶
RECALCULATEMOTIONCORRNEIGHBOURHOOD Recalculates the motion. corrected segmentation neighbourhood.
- Parameters:
this (
object) –TemporaryTrackingDatainstance.neighbourhoodSearchRadius (
double) –neighbourhoodSearchRadius
- Return type:
void (
-)
Tracker¶
- 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) –TrackerobjectframeNumber (
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 ofSegmentationData.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.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) –Trackerobject- Returns:
void – Acts on
Trackerobject directly.- 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) –Trackerobjectvarargin (
str varchar) –channel (
int): Channel numberfluo_idof 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 toneighbourhoodSearchRadius
- Returns:
void – Acts on
Trackerobject directly and deletes selected data below threshold.- Return type:
(
-)- Authors:
Andreas P. Cuny - 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) –Trackerinstance.imagePath (
str) – Path to the experiment raw images.imageDirsegmentationPath (
str) – Path to segmentation results.segmentationResultDirsegmentationFileNameRegex (
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.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) –Trackerinstance.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.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) –Trackerobjectvarargin (
str varchar) –resultFilePath (
str): Path to where to save the results. Defaults tosegmentationResultDirresultFileName (
str): Results file name. Defaults to ProjectName_CellCycleResults_TimestampfileType (
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.generateScriptFromTracker(this, varargin)¶
GENERATESCRIPTFROMTRACKER Generates a Matlab (.m) script file based on the tracker project configuration made with the GUI.
- Parameters:
this (
obj) –Trackerobjectvarargin (
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.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) –Trackerinstance.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.testBudNeckSegmentation(this, frameNumber, varargin)¶
TESTBUDNECKSEGMENTATION Tests the parameter for budneck segmentation and displays a control image to optimize the parameters if needed.
- Parameters:
this (
obj) –TrackerobjectframeNumber (
int) – Image frame to test.varargin (
str varchar) –divisionMarkerDenoising (
int): ROF denoising parameter.divisionMarkerDenoisingdivisionMarkerEdgeSensitivityThresh (
int): Edge sensitivity threshold for segmenting the marker outlines.divisionMarkerEdgeSensitivityThreshdivisionMarkerConvexAreaLowerThresh (
int): Lower area limit for detected markers.divisionMarkerConvexAreaLowerThreshdivisionMarkerConvexAreaUpperThresh (
int): Upper area limit for detected markers.divisionMarkerConvexAreaUpperThreshcontrastLimits (
array, 1x2): Image contras limits 0-1.
- 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) –TrackerobjecttestRange (
array, 1x2) – Image frame test range to test Tracking [fromFrame, toFrame].varargin (
str varchar) –mode (
array1x2): 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
- TracX.@Tracker.saveCurrentTrackerState(this, varargin)¶
SAVECURRENTTRACKERSTATE Saves the current state of the tracker to disk.
- Parameters:
this (
obj) –Trackerobjectvarargin (
str varchar) –resultFilePath (
str): Path to where to save the tracker stat. Defaults tosegmentationResultDirresultFileName (
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.testMarkerTrackingParameters(this, testRange, varargin)¶
TESTTRACKINGPARAMETERS Tests the marker tracking parameters as defined in defined in
ParameterConfigurationand displays the results for the given range.- Parameters:
this (
obj) –TrackerobjecttestRange (
array, 1x2) – Image frame test range to test Tracking [fromFrame, toFrame].varargin (
str varchar) –divisionMarkerMaxTrackFrameSkipping (
int): Max marker frame skiping.divisionMarkerMaxTrackFrameSkippingdivisionMarkerMaxObjCenterDisplacement (
int): Max marker displacement.divisionMarkerMaxObjCenterDisplacementdivisionMarkerMaxObjSizeIncrease (
float): Max marker size increase.divisionMarkerMaxObjSizeIncreasedivisionMarkerMaxObjSizeDecrease (
float): Max marker size decrease.divisionMarkerMaxObjSizeDecreasedivisionMarkerFingerprintHalfWindowSideLength (
int): Max marker fingerprint half window side length.divisionMarkerFingerprintHalfWindowSideLength
- Returns:
void – Displays the marker tracking results in an interactive movie player.
- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- class TracX.@Tracker.Tracker¶
Bases:
handleTRACKER Tracker main TracX object
- Authors:
Andreas P. Cuny - initial implementation
- Constructor Summary
- Tracker()¶
TRACKER Tracker Constructs an empty Tracker object object to save segmentation data as well as tracking results. for a TracX project.
- Returns:
obj –
Trackerinstance.- Return type:
(
obj)- Authors:
Andreas P. Cuny - initial implementation
- Property Summary
- configuration¶
TracX.@TrackerConfigurationinstance with the tracking parameters and project metadata.
- data¶
TracX.@TrackDatainstance which stores all segmentation, quantification and lineage data.
- evaluation¶
TracX.@TrackerEvaluationinstance implementing tracker performance evaluation methods
- fingerprint¶
TracX.@Fingerprintinstance implementing cell fingerprinting methods.
- imageProcessing¶
TracX.@ImageProcessinginstance implementing image processing methods.
- imageVisualization¶
TracX.@ImageVisualizationinstance implementing image visualization methods.
- isAllInstalled¶
Flag, if all TracX dependencies and toolboxes are installed. Defaults to false.
- isCorrectMotion¶
Flag, if motion should be corrected for (1). Defaults to true.
- isFFPEval¶
Flag, to evaluate FFP for manuscript. Defaults to false
- isFullCosts¶
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¶
Flag, if TracX is ready to be used. Defaults to false.
- lap¶
TracX.@LAPinstance implementing linear assignment methods.
- lineage¶
TracX.@Lineageinstance implementing lineage reconstruction methods
- motion¶
TracX.@Motioninstance implementing cell motion methods.
- utils¶
TracX.@Utilsinstance implementing utility methods.
- version¶
Current TracX version
- Method Summary
- 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) –Trackerinstance.dataToSave (
array) – Array with data to be saved toTrackerDatafieldName (
str) – Fieldname nameemptyDataLocIdx (
array) – Location indicies of empty data.oldFrameLocIdx (
array) – OldFrame location indicies for track_index.frameNumber (
int) – Frame number
- Returns:
void –
Trackerinstance- Return type:
(
-)
- 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) –Trackerinstance.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
- 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) –Trackerinstance.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
Trackerinstance directly- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- 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) –TrackerinstanceprojectName (
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 projectfileIdentifierFingerprintImages (
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:
this –
Trackerinstance with new project initialized.- Return type:
(
obj)
- deleteByFeature(this, feature, threshold, varargin)¶
DELETEBYFEATURE Deletes segmentation objects exceeding a threshold for a feature.
- Parameters:
this (
obj) –Trackerobjectfeature (
str) – Any segmentation feature to use to threshold the data before tracking.SegmentationDatathreshold (
float) – Threshold. Feature values below the threshold are selected.varargin (
str varchar) –neighbourhoodSearchRadius (
int): Neighbourhood radius. Defaults toneighbourhoodSearchRadius
- Returns:
void – Acts on
Trackerobject directly and deletes selected data below threshold.- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- deleteByROI(this, roi, varargin)¶
DELETEBYROI Deletes segmentation objects outside a region of interest (ROI).
- Parameters:
this (
obj) –Trackerobjectroi (
array) – Region of interest defined by polygon vertices to keep data for tracking.varargin (
str varchar) –neighbourhoodSearchRadius (
int): Neighbourhood radius. Defaults toneighbourhoodSearchRadius
- Returns:
void – Acts on
Trackerobject directly and deletes selected data outside ROI.- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- deleteSegArtefacts(this, varargin)¶
DELSEGARTEFACTS Deletes potential segmentation artefacts (segmented objects which are no cells based the autofluorescence.
- Parameters:
this (
obj) –Trackerobjectvarargin (
str varchar) –channel (
int): Channel numberfluo_idof 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 toneighbourhoodSearchRadius
- Returns:
void – Acts on
Trackerobject directly and deletes selected data below threshold.- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- deleteSegObjAtBorder(this, borderOffset)¶
DELETESEGOBJATBORDER Delete segmentation objects at the image border within the border offset.
- Parameters:
this (
obj) –TrackerobjectborderOffset (
int) – Offset from image border in pixel to exclude from tracking.
- Returns:
void – Acts on
Trackerobject directly and deletes selected data from the image border up to the border offset.- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- 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) –TrackerobjectresultFilePath (
str) – Path to where to save the results. Defaults tosegmentationResultDirresultFileName (
str) – Results file name. Defaults to ProjectName_CellCycleResults_Timestampvarargin (
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
- 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) –Trackerobject- Returns:
void – Writes mask files to disk
- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- 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) –TrackerobjectjoinedTrackerDataTable (
table) – Table of tracking results.resultFilePath (
str) – Path to where to save the results. Defaults tosegmentationResultDirresultFileName (
str) – Results file name. Defaults to ProjectName_CellCycleResults_Timestampvarargin (
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
- generateScriptFromTracker(this, varargin)¶
GENERATESCRIPTFROMTRACKER Generates a Matlab (.m) script file based on the tracker project configuration made with the GUI.
- Parameters:
this (
obj) –Trackerobjectvarargin (
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
- getTrackIndexStorageIndicies(this)¶
GETTRACKINDEXSTORAGEINDICIES Returns indicies of track_index where to store them.
- Parameters:
this (
obj) –Trackerinstance- Returns:
oldFrameLocIdx (
array) – Array with location indices in the oldFrame.emptyDataLocIdx (
array) – Array with location indices for empty data.
- importAlphaShapes(this)¶
IMPORTALPHASHAPES Imports the alpha shapes form the project directory.
- Parameters:
this (
obj) –Trackerinstance.- Returns:
void –
Trackerinstance- Return type:
(
-)
- importData(this)¶
IMPORTDATA Imports segmentation and eventual quantification data using the settigs set in the configuration.ProjectConfiguration object.
- Parameters:
this (
obj) –Trackerinstance- Returns:
void – Imports data into the
Trackerinstance- Return type:
(
-)
- improveInitialTracking(this, frameNumber)¶
IMPROVEINITIALTRACKING Improves the initial tracking by correcting for motion and by using the CRF as proofreading.
- Parameters:
this (
obj) –TrackerinstanceframeNumber (
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) –Trackerinstance- Returns:
void –
Trackerinstance- Return type:
(
-)
- loadTrackingProject(this, filePath, fileName)¶
LOADTRACKINGPROJECT load a TracX project. Load from xml file the meta data and parameters used during tracking.
- Parameters:
this (
obj) –TrackerinstancefilePath (
str) – File path for loading the TracX projectfileName (
str) – Filename of Tracking project to load.
- Returns:
void – Loads the project.
- Return type:
(
-)
- moveToVeryOld(this, selectedTrackArray)¶
MOVETOVERYOLD Moves temporary data stored in OldFrame to VeryOld.
- Parameters:
this (
obj) –TrackerinstanceselectedTrackArray (
int) – Array with track indices to be moved to veryOld.
- Returns:
this (
obj) –TrackerinstancetrackIdxToChange (
array) – Array with tracking indices to move.
- 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) –Trackerinstance.imagePath (
str) – Path to the experiment raw images.imageDirsegmentationPath (
str) – Path to segmentation results.segmentationResultDirsegmentationFileNameRegex (
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
- 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) –Trackerobject- Returns:
void – Acts on
Trackerobject directly.- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- runLineageReconstruction(this, varargin)¶
RUNLINEAGERECONSTRUCTION Starts lineage reconstruction based on tracking results for symmetrically and asymmetrically dividing cells. Wrapper for lineage instance.
- Parameters:
this (
object) –Trackerinstancevarargin (
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
- 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) –Trackerinstance.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
- runTracker(this, varargin)¶
RUNTRACKER Runs the tracker.
- Parameters:
this (
obj) –Trackerinstancevarargin (
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:
void –
Trackerinstance- Return type:
(
-)
- saveCurrentTrackerState(this, varargin)¶
SAVECURRENTTRACKERSTATE Saves the current state of the tracker to disk.
- Parameters:
this (
obj) –Trackerobjectvarargin (
str varchar) –resultFilePath (
str): Path to where to save the tracker stat. Defaults tosegmentationResultDirresultFileName (
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
- 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) –Trackerobjectvarargin (
str varchar) –resultFilePath (
str): Path to where to save the results. Defaults tosegmentationResultDirresultFileName (
str): Results file name. Defaults to ProjectName_CellCycleResults_TimestampfileType (
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
- 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) –TrackerobjectframeNumber (
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 ofSegmentationData.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
- 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) –TrackerobjectframeNumber (
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 (
arraykx3): 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
- saveTrackerMarkerControlImages(this)¶
SAVEMARKERCONTROLIMAGES Saves marker tracking control images to disk.
- Parameters:
this (
obj) –Trackerobject- Returns:
void – Saves images to disk.
- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- 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) –TrackerobjectframeNumber (
int) – Image frame to test.
- Returns:
void – Saves masks to disk.
- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- saveTrackerProjectControlImages(this, varargin)¶
SAVETRACKERPROJECTCONTROLIMAGES Saves control images for the current experiment for all tracked image frames.
- Parameters:
this (
obj) –Trackerobjectvarargin (
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
- saveTrackerResultsAsTable(this, varargin)¶
SAVETRACKERRESULTSASTABLE Save the tracking results along with the segmentation data in one table to a file.
- Parameters:
this (
obj) –Trackerobjectvarargin (
str varchar) –resultFilePath (
str): Path to where to save the results. Defaults tosegmentationResultDirresultFileName (
str): Results file name. Defaults to ProjectName_TrackingResults_TimestampfileType (
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
- saveTrackingProject(this, varargin)¶
SAVETRACKINGPROJECT Save a TracX project. Includes the meta data and parameters used during tracking.
- Parameters:
this (
obj) –Trackerinstancevarargin (
str varchar) –filePath (
str): File path for saving the TracX project.fileName (
str): Filename for the Tracking project.
- Returns:
fullpath (:obj:`str`)
- Return type:
Full path with filename and .xml extension
- 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) –Trackerobject- Returns:
status – Status, 1 successful 0 otherwise.
- Return type:
(
int)- Authors:
Andreas P. Cuny - Initial implementation
- testBudNeckSegmentation(this, frameNumber, varargin)¶
TESTBUDNECKSEGMENTATION Tests the parameter for budneck segmentation and displays a control image to optimize the parameters if needed.
- Parameters:
this (
obj) –TrackerobjectframeNumber (
int) – Image frame to test.varargin (
str varchar) –divisionMarkerDenoising (
int): ROF denoising parameter.divisionMarkerDenoisingdivisionMarkerEdgeSensitivityThresh (
int): Edge sensitivity threshold for segmenting the marker outlines.divisionMarkerEdgeSensitivityThreshdivisionMarkerConvexAreaLowerThresh (
int): Lower area limit for detected markers.divisionMarkerConvexAreaLowerThreshdivisionMarkerConvexAreaUpperThresh (
int): Upper area limit for detected markers.divisionMarkerConvexAreaUpperThreshcontrastLimits (
array, 1x2): Image contras limits 0-1.
- Returns:
void – Displays the detected segmentation artifacts in an image.
- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- testFeatureDataRemoval(this, frameNumber, feature, threshold)¶
TESTFEATUREDATAREMOVAL Tests the data removal for cells above a feature (
SegmentationData) value threshold.- Parameters:
this (
obj) –TrackerobjectframeNumber (
int) – Image frame to test.feature (
str) – Any segmentation feature to use to threshold the data before tracking.SegmentationDatathreshold (
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
- testImageBorderDataRemoval(this, frameNumber, borderOffset)¶
TESTIMAGEBORDERDATAREMOVAL Tests the data removal for cells touching the image border within borderOffset distance.
- Parameters:
this (
obj) –TrackerobjectframeNumber (
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
- testMarkerTrackingParameters(this, testRange, varargin)¶
TESTTRACKINGPARAMETERS Tests the marker tracking parameters as defined in defined in
ParameterConfigurationand displays the results for the given range.- Parameters:
this (
obj) –TrackerobjecttestRange (
array, 1x2) – Image frame test range to test Tracking [fromFrame, toFrame].varargin (
str varchar) –divisionMarkerMaxTrackFrameSkipping (
int): Max marker frame skiping.divisionMarkerMaxTrackFrameSkippingdivisionMarkerMaxObjCenterDisplacement (
int): Max marker displacement.divisionMarkerMaxObjCenterDisplacementdivisionMarkerMaxObjSizeIncrease (
float): Max marker size increase.divisionMarkerMaxObjSizeIncreasedivisionMarkerMaxObjSizeDecrease (
float): Max marker size decrease.divisionMarkerMaxObjSizeDecreasedivisionMarkerFingerprintHalfWindowSideLength (
int): Max marker fingerprint half window side length.divisionMarkerFingerprintHalfWindowSideLength
- Returns:
void – Displays the marker tracking results in an interactive movie player.
- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- testROIDataRemoval(this, frameNumber)¶
TESTROIDATAREMOVAL Tests the data removal for cells outside a ROI.
- Parameters:
this (
obj) –TrackerobjectframeNumber (
int) – Image frame number.
- Returns:
roi – Returns the region of interest polygon vertices.
- Return type:
(
array)- Authors:
Andreas P. Cuny - initial implementation
- 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) –Trackerobjectframe (
int) – Image frame to test.channel (
int) – Channel numberfluo_idof 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
- testTrackingParameters(this, testRange, varargin)¶
TESTTRACKINGPARAMETERS Tests the current set of tracker parameters as defined in
ParameterConfiguration.- Parameters:
this (
obj) –TrackerobjecttestRange (
array, 1x2) – Image frame test range to test Tracking [fromFrame, toFrame].varargin (
str varchar) –mode (
array1x2): 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
- 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) –Trackerobject- Returns:
void – Writes mask files to disk
- 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) –TrackerobjectframeNumber (
int) – Image frame to test.feature (
str) – Any segmentation feature to use to threshold the data before tracking.SegmentationDatathreshold (
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.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) –TrackerobjectjoinedTrackerDataTable (
table) – Table of tracking results.resultFilePath (
str) – Path to where to save the results. Defaults tosegmentationResultDirresultFileName (
str) – Results file name. Defaults to ProjectName_CellCycleResults_Timestampvarargin (
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.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) –Trackerobjectframe (
int) – Image frame to test.channel (
int) – Channel numberfluo_idof 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.deleteByFeature(this, feature, threshold, varargin)¶
DELETEBYFEATURE Deletes segmentation objects exceeding a threshold for a feature.
- Parameters:
this (
obj) –Trackerobjectfeature (
str) – Any segmentation feature to use to threshold the data before tracking.SegmentationDatathreshold (
float) – Threshold. Feature values below the threshold are selected.varargin (
str varchar) –neighbourhoodSearchRadius (
int): Neighbourhood radius. Defaults toneighbourhoodSearchRadius
- Returns:
void – Acts on
Trackerobject directly and deletes selected data below threshold.- 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) –Trackerobjectvarargin (
str varchar) –resultFilePath (
str): Path to where to save the results. Defaults tosegmentationResultDirresultFileName (
str): Results file name. Defaults to ProjectName_TrackingResults_TimestampfileType (
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.saveTrackerProjectControlImages(this, varargin)¶
SAVETRACKERPROJECTCONTROLIMAGES Saves control images for the current experiment for all tracked image frames.
- Parameters:
this (
obj) –Trackerobjectvarargin (
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.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) –TrackerobjectresultFilePath (
str) – Path to where to save the results. Defaults tosegmentationResultDirresultFileName (
str) – Results file name. Defaults to ProjectName_CellCycleResults_Timestampvarargin (
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.saveTrackerMarkerControlImages(this)¶
SAVEMARKERCONTROLIMAGES Saves marker tracking control images to disk.
- Parameters:
this (
obj) –Trackerobject- Returns:
void – Saves images 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) –Trackerobject- Returns:
status – Status, 1 successful 0 otherwise.
- Return type:
(
int)- Authors:
Andreas P. Cuny - Initial implementation
- TracX.@Tracker.testROIDataRemoval(this, frameNumber)¶
TESTROIDATAREMOVAL Tests the data removal for cells outside a ROI.
- Parameters:
this (
obj) –TrackerobjectframeNumber (
int) – Image frame number.
- Returns:
roi – Returns the region of interest polygon vertices.
- Return type:
(
array)- 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) –Trackerinstance.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
Trackerinstance directly- 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) –TrackerobjectframeNumber (
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 (
arraykx3): 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.testImageBorderDataRemoval(this, frameNumber, borderOffset)¶
TESTIMAGEBORDERDATAREMOVAL Tests the data removal for cells touching the image border within borderOffset distance.
- Parameters:
this (
obj) –TrackerobjectframeNumber (
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.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) –TrackerobjectframeNumber (
int) – Image frame to test.
- Returns:
void – Saves masks to disk.
- 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) –TrackerobjectborderOffset (
int) – Offset from image border in pixel to exclude from tracking.
- Returns:
void – Acts on
Trackerobject directly and deletes selected data from the image border up to the border offset.- 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) –Trackerobjectroi (
array) – Region of interest defined by polygon vertices to keep data for tracking.varargin (
str varchar) –neighbourhoodSearchRadius (
int): Neighbourhood radius. Defaults toneighbourhoodSearchRadius
- Returns:
void – Acts on
Trackerobject directly and deletes selected data outside ROI.- 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) –Trackerinstancevarargin (
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
TrackerConfiguration¶
- class TracX.@TrackerConfiguration.TrackerConfiguration¶
Bases:
handleTRACKERCONFIGRURATION Creates an object to store and manipulate metadata used and defining a Tracker project. The metadata itself is stored in
TracX.@ParameterConfigurationandTracX.@ProjectConfiguration.- Authors:
Andreas P. Cuny - initial implementation
- Constructor Summary
- TrackerConfiguration()¶
TrackerConfiguration Constructs a
TrackerConfigurationobject to manipulate and store trackingTracX.@ParameterConfigurationandTracX.@ProjectConfigurationdata.- Parameters:
-
- Returns:
Returns a
TrackerConfigurationinstance. object instance with initializedTracX.@ParameterConfiguration(default values) andTracX.@ProjectConfiguration(empty) objects- Return type:
this
object- Authors:
Andreas P. Cuny - initial implementation
- Property Summary
- ParameterConfiguration¶
TracX.@ParameterConfigurationinstance stores all the parameters needed for tracking.
- ProjectConfiguration¶
TracX.@ProjectConfigurationinstance stores all information needed for a tracking project.
- Method Summary
- exportTrackerConfiguration(this, file)¶
EXPORTTRACKERCONFIGURATION Writes a TracX configuration xml file with all the parameters stored in the ParameterConfiguration and ProjectConfiguration object.
- Parameters:
this (
object) –TrackerConfigurationinstance.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:
this (
object) –TrackerConfigurationinstance.file (
str) – Path to parameter xml file
- Returns:
this – Acts on
TrackerConfigurationobject directly and returns TracX configured.- Return type:
object
TrackerData¶
- 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) –TrackerDatainstance.varargin (
str varchar) –property (
str): Property ofSegmentationDatafor which colormap shold be returned. Defaults totrack_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.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:
this (
obj) –TrackerDatainstance.imageFrameNumberArray (
array, kx1) – Array of all existing image frames for the given experiment.fingerprintHalfWindowSideLength (
int) –fingerprintHalfWindowSideLengthfingerprintMaxConsideredFrequencies (
int) –fingerprintMaxConsideredFrequenciesimageDir (
str) –imageDirimageFingerprintFileArray (
array) –imageFingerprintFileArrayimageCropCoordinateArray (
array, 1x4) –imageCropCoordinateArrayneighbourhoodSearchRadius (
int) – Neighbourhood radius. Defaults toneighbourhoodSearchRadius
- Returns:
void – Acts on
TrackerData.- 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) –TrackerDatainstance.roi (
array) – Region of interest defined by polygon vertices to keep data for tracking.neighbourhoodSearchRadius (
int) – Neighbourhood radius. Defaults toneighbourhoodSearchRadius
- Returns:
void – Acts on
TrackerDataobject directly and deletes selected data outside ROI.- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- TracX.@TrackerData.propagatePendingDaughters(this, newFrameData, frameNumber, pendingDaughters, oldFrameData)¶
PROPAGATEPENDINGDAUGHTERS Resolve pending mother-daughter assignments on non-last frames.
Called on every frame except the last. Processes only entries that are expected at this frame (flagFrame + 1). If the expected daughter has not yet appeared, the entry is kept for the next iteration. Stale entries (daughter never appeared within a one-frame window) are purged.
- Parameters:
this (
object) –TrackerDatainstance.newFrameData (
object) –@TemporaryTrackingDatafor the current frameframeNumber (
array, 1x1) – Current image frame numberpendingDaughters (
struct) – containers.Map of pending assignments.oldFrameData (
object) –@TemporaryTrackingDatafor the previous frame Used to inherit pole ages when stored ages are absent.
- Return type:
void
-
See also: propagatePendingDaughtersFinalFrame
- Authors:
Andreas P. Cuny - initial implementation
- 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) –TrackerDatainstance.newFrameData (
object) – newFrame dataassignment (
object) – Assignment resultparentCandidateArray (
array) – Array with parent candidatesparentCandidateType (
int) – Type of parents (0 or 1).daughterPairs (
array) – Array with daughter pairsframe (
int) – Image frame to be evaluatedprintOutput (
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.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) –TrackerDatainstance.xCoordinateArray (
array, kx1) – Array with x coordinatesyCoordinateArray (
array, kx1) – Array with y coordinatesneighbourhoodSearchRadius – [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:
arraykxk- 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.decompressOrientationData(this)¶
DECOMPRESSORIENTATIONDATA Decompresses the orientation vector into from a single number.
- Parameters:
this (
object) –TrackerDatainstance.- Return type:
void
-- Authors:
Thomas Kuendig - initial implementation
- TracX.@TrackerData.propagatePendingDaughtersFinalFrame(this, newFrameData, frameNumber, pendingDaughters)¶
PROPAGATEPENDINGDAUGHTERSFINALFRAME Resolve all remaining pending mother-daughter assignments at the last frame of the tracked range.
Called exactly once, on the final frame. Unlike propagatePendingDaughters, this function processes every entry in pendingDaughters regardless of when it was flagged, because no future frames exist to confirm or carry forward any unresolved assignments.
- Behaviour per entry:
- Daughter present and unassigned assign using stored pole ages,
propagate to master data, remove key.
Daughter present but already set remove key (no action needed).
- Daughter absent at final frame log a warning, remove key.
The experiment ended before this daughter appeared; the parent is recorded as having divided but the daughter track is unresolvable.
Pole ages are taken from the values stored in the pendingDaughters map at flagging time (parentPole1Age / parentPole2Age). These are always available because setParentSymDivCells stores them when creating the pending entry. No lookback into historical frame data is needed.
- Parameters:
this (
object) –TrackerDatainstance.newFrameData (
object) –@TemporaryTrackingDatafor the current frameframeNumber (
array, 1x1) – Current image frame numberpendingDaughters (
struct) – containers.Map of pending assignments.
- Return type:
void
-
See also: propagatePendingDaughters
- 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) –TrackerDatainstance.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.assignDaughterImmediate(this, newFrameData, parentTrackID, daughterTracks, oldFrameData, frameNumber)¶
ASSIGNDAUGHTERIMMEDIATE Assign parent-daughter relationships immediately when daughters are confirmed present in the current frame via lookahead.
Called from the lookahead branch of setParentSymDivCells when at least one daughter from the next-frame pair is already visible in the current frame. Uses pole-to-parent-centroid distance to determine which pole of the daughter faced the parent at division.
- Parameters:
this (
object) –TrackerDatainstance.newFrameData (
object) –@TemporaryTrackingDatafor the current frameparentTrackID (
array, kx1) – Array of trackindex of the dividing parent.daughterTracks (
array, kx1) – Array of track indices confirmed as daughters.newFrameData –
@TemporaryTrackingDatafor the previous frame (parent’s last known frame).frameNumber (
array, 1x1) – Current frame
- 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) –TrackerDatainstance.- Return type:
void
-- 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) –TrackerDatainstance.dataIDToDelete (
array, 1xk) – Array with uuids of cells to be deleted.neighbourhoodSearchRadius (
int) – Neighbourhood radius. Defaults toneighbourhoodSearchRadius
- Returns:
void – Acts on
TrackerDataobject directly and deletes selected data.- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- TracX.@TrackerData.insertNewData(this, absentFrameArray, trackArray, fingerprintHalfWindowSideLength, fingerprintMaxConsideredFrequencies, imageDir, imageFingerprintFileArray, imageCropCoordinateArray, neighbourhoodSearchRadius)¶
INSERTNEWDATA Inserts a virtual object into
SegmentationDatafor 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:
this (
object) –TrackerDatainstance.absentFrameArray (
array, 1xN) – Array with frame numbers where a selected track is not present.trackArray (
array, 1xN) – Array with track indicies.fingerprintHalfWindowSideLength (
int) –fingerprintHalfWindowSideLengthfingerprintMaxConsideredFrequencies (
int) –fingerprintMaxConsideredFrequenciesimageDir (
array) –imageDirimageFingerprintFileArray (
array) –imageFingerprintFileArrayimageCropCoordinateArray (
array, 1x4) –imageCropCoordinateArrayneighbourhoodSearchRadius (
int) –neighbourhoodSearchRadius
- Return type:
void
-- Authors:
Andreas P. Cuny - initial implementation
- class TracX.@TrackerData.TrackerData¶
Bases:
handleTRACKERDATA 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
- Constructor Summary
- TrackerData()¶
TrackerData Constructs a TrackerData object to manipulate and store segmentation and tracking data.
- Return type:
void
-
- Property Summary
- NewFrame¶
TracX.@TemporaryTrackingDatainstance holding the subsequent image frame data.
- NewFrameEval¶
TracX.@TemporaryTrackingDatainstance holding the current image frame data for evaluation.
- OldFrame¶
TracX.@TemporaryTrackingDatainstance holding the current image frame data.
- OldFrameEval¶
TracX.@TemporaryTrackingDatainstance holding the previous image frame data for evaluation.
- QuantificationData¶
TracX.@QuantificationDatastores fluorescence quantification data
- SegmentationData¶
Data
- TmpLinAss¶
TracX.@TemporaryLineageAssignmentinstance object holding data of lineage assignments.
- VeryOld¶
TracX.@TemporaryTrackingDatainstance holding the previous image frame data of non assigned tracks.
- VeryOldEval¶
TracX.@TemporaryTrackingDatainstance object holding the of non assigned tracks after evaluation.
- cellDivisionMarkerData¶
Stores optional additional cell division marker segmentation and signal quantifiaction.
- joinedTrackerData¶
> JoinedTrackerData is a struct holding tracking results along with
TracX.@SegmentationDataandTracX.@QuantificationData
- joinedTrackerDataTable¶
> JoinedTrackerData is a table holding tracking results along with
TracX.@SegmentationDataandTracX.@QuantificationDatafor export to disk.
- numberOfTracks¶
Highest used track index number
- utils¶
TracX.@Utilsinstance implementing utility methods
- Method Summary
- assignDaughterImmediate(this, newFrameData, parentTrackID, daughterTracks, oldFrameData, frameNumber)¶
ASSIGNDAUGHTERIMMEDIATE Assign parent-daughter relationships immediately when daughters are confirmed present in the current frame via lookahead.
Called from the lookahead branch of setParentSymDivCells when at least one daughter from the next-frame pair is already visible in the current frame. Uses pole-to-parent-centroid distance to determine which pole of the daughter faced the parent at division.
- Parameters:
this (
object) –TrackerDatainstance.newFrameData (
object) –@TemporaryTrackingDatafor the current frameparentTrackID (
array, kx1) – Array of trackindex of the dividing parent.daughterTracks (
array, kx1) – Array of track indices confirmed as daughters.newFrameData –
@TemporaryTrackingDatafor the previous frame (parent’s last known frame).frameNumber (
array, 1x1) – Current frame
- Return type:
void
-- Authors:
Andreas P. Cuny - initial implementation
- 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) –TrackerDatainstance.newFrameData (
object) – newFrame dataassignment (
object) – Assignment resultparentCandidateArray (
array) – Array with parent candidatesparentCandidateType (
int) – Type of parents (0 or 1).daughterPairs (
array) – Array with daughter pairsframe (
int) – Image frame to be evaluatedprintOutput (
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
- decompressOrientationData(this)¶
DECOMPRESSORIENTATIONDATA Decompresses the orientation vector into from a single number.
- Parameters:
this (
object) –TrackerDatainstance.- Return type:
void
-- Authors:
Thomas Kuendig - initial implementation
- delByFeature(this, feature, threshold, neighbourhoodSearchRadius)¶
DELBYFEATURE Delete cell segmentations exceeding the feature threshold value from tracking.
- Parameters:
this (
obj) –TrackerDatainstance.feature (
str) – Any segmentation feature to use to threshold the data before tracking.SegmentationDatathreshold (
float) – Threshold. Feature values below the threshold are selected.neighbourhoodSearchRadius (
int) – Neighbourhood radius. Defaults toneighbourhoodSearchRadius
- Returns:
void – Acts on
TrackerDataobject directly and deletes selected data below threshold.- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- delByROI(this, roi, neighbourhoodSearchRadius)¶
DELETEBYROI Deletes segmentation objects outside a region of interest (ROI).
- Parameters:
this (
obj) –TrackerDatainstance.roi (
array) – Region of interest defined by polygon vertices to keep data for tracking.neighbourhoodSearchRadius (
int) – Neighbourhood radius. Defaults toneighbourhoodSearchRadius
- Returns:
void – Acts on
TrackerDataobject directly and deletes selected data outside ROI.- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- delSegArtefacts(this, neighbourhoodSearchRadius, varargin)¶
DELSEGARTEFACTS Deletes potential segmentation artefacts (segmented objects which are no cells based the autofluorescence.
- Parameters:
this (
obj) –TrackerDatainstance.neighbourhoodSearchRadius (
int) – Neighbourhood radius. Defaults toneighbourhoodSearchRadiusvarargin (
str varchar) –channel (
int): Channel numberfluo_idof the fluorescent channel to use for segmentation artefact detection. Defaults to 1.stdFactor (
float): Factor standard deviation. Defaults to 2.
- Returns:
void – Acts on
TrackerDataobject directly and deletes selected data.- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- 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) –TrackerDatainstance.dataIDToDelete (
array, 1xk) – Array with uuids of cells to be deleted.neighbourhoodSearchRadius (
int) – Neighbourhood radius. Defaults toneighbourhoodSearchRadius
- Returns:
void – Acts on
TrackerDataobject directly and deletes selected data.- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- 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:
this (
obj) –TrackerDatainstance.imageFrameNumberArray (
array, kx1) – Array of all existing image frames for the given experiment.fingerprintHalfWindowSideLength (
int) –fingerprintHalfWindowSideLengthfingerprintMaxConsideredFrequencies (
int) –fingerprintMaxConsideredFrequenciesimageDir (
str) –imageDirimageFingerprintFileArray (
array) –imageFingerprintFileArrayimageCropCoordinateArray (
array, 1x4) –imageCropCoordinateArrayneighbourhoodSearchRadius (
int) – Neighbourhood radius. Defaults toneighbourhoodSearchRadius
- Returns:
void – Acts on
TrackerData.- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- findParentCandidatesTolerant(this, currentTrackIndex, frameNumber, fieldNameArray)¶
FINDPARENTCANDITATESTOLERANT Tolerant search for parent candidates.
- Parameters:
this (
object) –TrackerDatainstance.currentTrackIndex (
array, kx1) – Array of trackindex .frameNumber (
array, 1x1) – Current framefieldNameArray (
str) – fieldNameArray
- Return type:
void
-- Authors:
Andreas P. Cuny - initial implementation
- 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) –TrackerDatainstance.xCoordinateArray (
array, kx1) – Array with x coordinatesyCoordinateArray (
array, kx1) – Array with y coordinatesneighbourhoodSearchRadius – [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:
arraykxk- Authors:
Andreas P. Cuny - initial implementation
- 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) –TrackerDatainstance.oldFrame (
obj) – Old frame instancenewFrame (
obj) – New frame instancevarargin (
str varchar) –newTrackIndex (
array): Newly assigned track indicies for newFrame
- Returns:
oldFrameSubset (
arraykx2) – Data subset for only x and y position of the oldFrame.newFrameSubset (
arraykx2) – Data subset for only x and y position of the newFrame.
- Authors:
Andreas P. Cuny - initial implementation
- getConditionalFieldArray(this, fieldName, fieldNameCond, condition, varargin)¶
GETCONDITIONALFIELDARRAY Returns an array with all the data for a given fieldName (
TracX.@SegmentationDataproperty) matching a given condition for the fieldNameCon (TracX.@SegmentationDataproperty).- Parameters:
this (
object) –TrackerDatainstance.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
- 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
- getFieldArray(this, fieldName, varargin)¶
GETFIELDARRAY Returns an array with all the data for any fieldName (
TracX.@SegmentationDataproperty) for all frameNumbers (image frames).- Parameters:
this (
object) –TrackerDatainstance.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
- 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) –TrackerDatainstance.varargin (
str varchar) –property (
str): Property ofSegmentationDatafor which colormap shold be returned. Defaults totrack_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.
- getFieldArrayForFrame(this, fieldName, frameNumber, varargin)¶
GETFIELDARRAYFORFRAME Returns an array with all the data for a given fieldName (
TracX.@SegmentationDataproperty) for a given frameNumber (image frame).- Parameters:
this (
object) –TrackerDatainstance.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.@SegmentationDataproperty) for a given frameNumber (image frame) and datasubset.- Parameters:
this (
object) –TrackerDatainstance.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.@SegmentationDataobject.- Parameters:
this (
object) –TrackerDatainstance.fieldName (
str) –TracX.@SegmentationDatafield name.trackIndex (
int) – A track_index fromTracX.@SegmentationData.SegmentationData.track_indexvarargin (
str varchar) –fluoID (
int): Fluo channel ID for which the fieldName data should be returned.
- Returns:
Array of data for a given track and fieldName.
- Return type:
array
array
- getFieldArrayForTrackIndexForFrame(this, fieldName, frameNumber, selectedTrackArray, varargin)¶
GETFIELARRAYFORTRACKINDEXFORFRAME Returns an array with values for a particular fieldname, frame and selected track.
- Parameters:
this (
object) –TrackerDatainstance.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 idfluo_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
- getFieldArray_withGhosts(this, fieldName)¶
GETFIELDARRAY_WITHGHOSTS Override for lineage tree: include ghost parents
- Parameters:
this (
object) –TrackerDatainstance.fieldName (
str) – Field name.
- Return type:
allTrackIndices (
array, 1x1)
- 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) –TrackerDatainstance.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
- 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:
this (
obj) –TrackerDatainstance.frameNumber (
int) – Frame number of the consecutive frameneighbourhoodSearchRadius (
int) –neighbourhoodSearchRadius
- Returns:
distLocM
array– Eucledian distance among segmented objects on consecutive image frames below distance thresholddistM
array– Eucledian distance among segmented objects on consecutive image frames
- Authors:
Andreas P. Cuny - initial implementation
- getNumberOfRowsFromFrame(this, frameNumber)¶
GETNUMBEROFROWSFORFRAME Returns the number of rows in the SegmentationData object for the selected frameNumber.
- Parameters:
this (
object) –TrackerDatainstance.frameNumber (
int) – Image frame number.
- Returns:
Number of rows in
TracX.@SegmentationDatafor frameNumber.- Return type:
nRows
int
- 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) –TrackerDatainstance.varargin (
str varchar) –channel (
int): Channel numberfluo_idof 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
- 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) –TrackerDatainstance.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
- getStartEndFrameOfTrack(~, cellFrameArray, trackIndexArray)¶
GETSTARTENDFRAMEOFTRACK Determines for each cell track with a track index its first and last occuring image frame.
- Parameters:
ignoredArg (
object) –TrackerDatainstance.cellFrameArray (
array, kx1) – Array of image frame numbers for each segmentet cell.cell_frametrackIndexArray (
array, kx1) – Array of track indicies.track_indextrackFingerprintDistanceArray (
array) – Array of track fingerprint distances for trackIndexArraytrackAssignmentFractionArray (
array) – Array of track assignment fractions for trackIndexArrayfingerprintDistThreshold (
float) – Fingerprint distance threshold defined byfingerprintDistThreshold
- Returns:
startFrameArray
arraykx1 – Array with frame number where track i first occured.endFrameArray
arraykx1 – Array with frame number where track i last occured.
- Authors:
Andreas P. Cuny - initial implementation
- getTemporaryDataStruct(this, fieldNameArray, imageFrame)¶
GETTEMPORARYDATASTRUCT Returns a struct of a subset of
TracX.@SegmentationDatabased on field names and a given frame number.- Parameters:
this (
object) –TrackerDatainstance.fieldNameArray (
array) – Cell array with valid fieldnames forTracX.@SegmentationDatathat 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
- 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) –TrackerDatainstance.trackIndexArray (
array) – Array of track indicies.track_indextrackFingerprintDistanceArray (
array) – Array of track fingerprint distances for trackIndexArraytrackAssignmentFractionArray (
array) – Array of track assignment fractions for trackIndexArrayfingerprintDistThreshold (
float) – Fingerprint distance threshold defined byfingerprintDistThreshold
- Returns:
Array with track indicies to reconsider the assignment.
- Return type:
trackAssignmentReconsiderationArray
arraykx1- Authors:
Andreas P. Cuny - initial implementation
- 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) –TrackerDatainstance.imgSize (
array, 1x2) – Size of image.roi (
array) – Image border offset or a impoly object
- Returns:
uuidsOutsideMask
arraykx1 – Array with data uuids outside of the roi masked image region.outsideMaskIdx
arraykx1 – Indices array for data outside of the roi masked image region.
- Authors:
Andreas P. Cuny - initial implementation
- importAlphaShapes(this, resultDir)¶
IMPORTALPHASHAPES Function to import alpha shapes from cells*.mat files from the segmentation results directory.
- Parameters:
this (
object) –TrackerDatainstance.resultDir (
array) – Segmentation results foldersegmentationResultDir
- Returns:
Acts on
TrackerDatainstance.- Return type:
void
-- Authors:
Thomas Kuendig - initial implementation
- importAlphaShapesForFrame(~, frame, resultDir, reducedShapes)¶
IMPORTALPHASHAPESFORFRAME Function to import alpha shapes from cells*.mat files for a specific frame.
- Parameters:
ignoredArg (
object) –TrackerDatainstance.frame (
int) – Frame numberresultDir (
array) – Segmentation results foldersegmentationResultDirreducedShapes (
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
- importData(this, pathName, fileNameArray, maxNrOfFrames)¶
IMPORTDATA Imports segmentation data from single files.
- Parameters:
this (
object) –TrackerDatainstance.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:
TrackerDatainstance with imported data.- Return type:
this
object
- 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) –TrackerDatainstance.data (
array) – Data arraytracks2Merge (
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
- insertNewData(this, absentFrameArray, trackArray, fingerprintHalfWindowSideLength, fingerprintMaxConsideredFrequencies, imageDir, imageFingerprintFileArray, imageCropCoordinateArray, neighbourhoodSearchRadius)¶
INSERTNEWDATA Inserts a virtual object into
SegmentationDatafor 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:
this (
object) –TrackerDatainstance.absentFrameArray (
array, 1xN) – Array with frame numbers where a selected track is not present.trackArray (
array, 1xN) – Array with track indicies.fingerprintHalfWindowSideLength (
int) –fingerprintHalfWindowSideLengthfingerprintMaxConsideredFrequencies (
int) –fingerprintMaxConsideredFrequenciesimageDir (
array) –imageDirimageFingerprintFileArray (
array) –imageFingerprintFileArrayimageCropCoordinateArray (
array, 1x4) –imageCropCoordinateArrayneighbourhoodSearchRadius (
int) –neighbourhoodSearchRadius
- Return type:
void
-- Authors:
Andreas P. Cuny - initial implementation
- joinTrackerDataAsTable(this)¶
JOINTRACKERDATAASTABLE column binds the fields of SegmentationData and QuantificationData in wide format.
- Parameters:
this (
object) –TrackerDatainstance.- Return type:
void
-- Authors:
Andreas P. Cuny - initial implementation
- mapCrop2RawCoordinates(this, imageCropCoordinateArray)¶
MAPCROP2RAWCOORDINATES Maps ProjectConfiguration.imageCropCoordinateArray coordinates to original raw image coordinates.
- Parameters:
this (
object) –TrackerDatainstance.imageCropCoordinateArray (
array, 1x4) –imageCropCoordinateArray
- Return type:
void
-- Authors:
Andreas P. Cuny - initial implementation
- propagatePendingDaughters(this, newFrameData, frameNumber, pendingDaughters, oldFrameData)¶
PROPAGATEPENDINGDAUGHTERS Resolve pending mother-daughter assignments on non-last frames.
Called on every frame except the last. Processes only entries that are expected at this frame (flagFrame + 1). If the expected daughter has not yet appeared, the entry is kept for the next iteration. Stale entries (daughter never appeared within a one-frame window) are purged.
- Parameters:
this (
object) –TrackerDatainstance.newFrameData (
object) –@TemporaryTrackingDatafor the current frameframeNumber (
array, 1x1) – Current image frame numberpendingDaughters (
struct) – containers.Map of pending assignments.oldFrameData (
object) –@TemporaryTrackingDatafor the previous frame Used to inherit pole ages when stored ages are absent.
- Return type:
void
-
See also: propagatePendingDaughtersFinalFrame
- Authors:
Andreas P. Cuny - initial implementation
- propagatePendingDaughtersFinalFrame(this, newFrameData, frameNumber, pendingDaughters)¶
PROPAGATEPENDINGDAUGHTERSFINALFRAME Resolve all remaining pending mother-daughter assignments at the last frame of the tracked range.
Called exactly once, on the final frame. Unlike propagatePendingDaughters, this function processes every entry in pendingDaughters regardless of when it was flagged, because no future frames exist to confirm or carry forward any unresolved assignments.
- Behaviour per entry:
- Daughter present and unassigned assign using stored pole ages,
propagate to master data, remove key.
Daughter present but already set remove key (no action needed).
- Daughter absent at final frame log a warning, remove key.
The experiment ended before this daughter appeared; the parent is recorded as having divided but the daughter track is unresolvable.
Pole ages are taken from the values stored in the pendingDaughters map at flagging time (parentPole1Age / parentPole2Age). These are always available because setParentSymDivCells stores them when creating the pending entry. No lookback into historical frame data is needed.
- Parameters:
this (
object) –TrackerDatainstance.newFrameData (
object) –@TemporaryTrackingDatafor the current frameframeNumber (
array, 1x1) – Current image frame numberpendingDaughters (
struct) – containers.Map of pending assignments.
- Return type:
void
-
See also: propagatePendingDaughters
- Authors:
Andreas P. Cuny - initial implementation
- registerGhostParent(this, trackID, frameNumber, parentPole1Age, parentPole2Age)¶
REGISTERGHOSTPARENT Register a parent track that disappeared but has daughters
- Parameters:
this (
object) –TrackerDatainstance.trackIndex (
int) – A track_index fromTracX.@SegmentationData.SegmentationData.track_indexframeNumber (
int) – A frame number fromTracX.@SegmentationData.SegmentationData.frame_numberparentPole1Age (
int) – Pole 1 age of parentparentPole2Age (
int) – Pole 2 age of parent
- Return type:
void
-
- 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) –TrackerDatainstance.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
- 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) –TrackerDatainstance.- 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
- setFieldArray(this, fieldName, fieldDataArray)¶
SETFIELDARRAY Sets data for a particular fieldname in the
SegmentationDataobject ofTrackerData.- Parameters:
this (
object) –TrackerDatainstance.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) –TrackerDatainstance.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
SegmentationDataobject ofTrackerData.- Parameters:
this (
object) –TrackerDatainstance.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
SegmentationDataobject ofTrackerData.- Parameters:
this (
object) –TrackerDatainstance.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) –TrackerDatainstance.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
-
- setParentSymDivCells(this, startFrame, endFrame, imageFrameNumberArray, segmentationResultDir, trackerResultMaskFileArray)¶
SETPARENTSYMDIVCELLS Determines the relationship between daughter and mother cell of symmetricaly dividing cells.
- Parameters:
this (
object) –TrackerDatainstance.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
SegmentationDatadirectly.- Return type:
void
-- 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) –TrackerDatainstance.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.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) –TrackerDatainstance.trackIndexArray (
array) – Array of track indicies.track_indextrackFingerprintDistanceArray (
array) – Array of track fingerprint distances for trackIndexArraytrackAssignmentFractionArray (
array) – Array of track assignment fractions for trackIndexArrayfingerprintDistThreshold (
float) – Fingerprint distance threshold defined byfingerprintDistThreshold
- Returns:
Array with track indicies to reconsider the assignment.
- Return type:
trackAssignmentReconsiderationArray
arraykx1- 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) –TrackerDatainstance.varargin (
str varchar) –channel (
int): Channel numberfluo_idof 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.getFieldArrayForTrackIndexForFrame(this, fieldName, frameNumber, selectedTrackArray, varargin)¶
GETFIELARRAYFORTRACKINDEXFORFRAME Returns an array with values for a particular fieldname, frame and selected track.
- Parameters:
this (
object) –TrackerDatainstance.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 idfluo_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.getStartEndFrameOfTrack(~, cellFrameArray, trackIndexArray)¶
GETSTARTENDFRAMEOFTRACK Determines for each cell track with a track index its first and last occuring image frame.
- Parameters:
ignoredArg (
object) –TrackerDatainstance.cellFrameArray (
array, kx1) – Array of image frame numbers for each segmentet cell.cell_frametrackIndexArray (
array, kx1) – Array of track indicies.track_indextrackFingerprintDistanceArray (
array) – Array of track fingerprint distances for trackIndexArraytrackAssignmentFractionArray (
array) – Array of track assignment fractions for trackIndexArrayfingerprintDistThreshold (
float) – Fingerprint distance threshold defined byfingerprintDistThreshold
- Returns:
startFrameArray
arraykx1 – Array with frame number where track i first occured.endFrameArray
arraykx1 – Array with frame number where track i last occured.
- 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) –TrackerDatainstance.imgSize (
array, 1x2) – Size of image.roi (
array) – Image border offset or a impoly object
- Returns:
uuidsOutsideMask
arraykx1 – Array with data uuids outside of the roi masked image region.outsideMaskIdx
arraykx1 – Indices array for data outside of the roi masked image region.
- Authors:
Andreas P. Cuny - 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) –TrackerDatainstance.data (
array) – Data arraytracks2Merge (
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.mapCrop2RawCoordinates(this, imageCropCoordinateArray)¶
MAPCROP2RAWCOORDINATES Maps ProjectConfiguration.imageCropCoordinateArray coordinates to original raw image coordinates.
- Parameters:
this (
object) –TrackerDatainstance.imageCropCoordinateArray (
array, 1x4) –imageCropCoordinateArray
- 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) –TrackerDatainstance.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.importAlphaShapes(this, resultDir)¶
IMPORTALPHASHAPES Function to import alpha shapes from cells*.mat files from the segmentation results directory.
- Parameters:
this (
object) –TrackerDatainstance.resultDir (
array) – Segmentation results foldersegmentationResultDir
- Returns:
Acts on
TrackerDatainstance.- Return type:
void
-- Authors:
Thomas Kuendig - 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) –TrackerDatainstance.oldFrame (
obj) – Old frame instancenewFrame (
obj) – New frame instancevarargin (
str varchar) –newTrackIndex (
array): Newly assigned track indicies for newFrame
- Returns:
oldFrameSubset (
arraykx2) – Data subset for only x and y position of the oldFrame.newFrameSubset (
arraykx2) – Data subset for only x and y position of the newFrame.
- 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) –TrackerDatainstance.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
SegmentationDatadirectly.- Return type:
void
-- Authors:
Andreas P. Cuny - 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) –TrackerDatainstance.frame (
int) – Frame numberresultDir (
array) – Segmentation results foldersegmentationResultDirreducedShapes (
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.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:
this (
obj) –TrackerDatainstance.frameNumber (
int) – Frame number of the consecutive frameneighbourhoodSearchRadius (
int) –neighbourhoodSearchRadius
- Returns:
distLocM
array– Eucledian distance among segmented objects on consecutive image frames below distance thresholddistM
array– Eucledian distance among segmented objects on consecutive image frames
- Authors:
Andreas P. Cuny - initial implementation
- TracX.@TrackerData.delByFeature(this, feature, threshold, neighbourhoodSearchRadius)¶
DELBYFEATURE Delete cell segmentations exceeding the feature threshold value from tracking.
- Parameters:
this (
obj) –TrackerDatainstance.feature (
str) – Any segmentation feature to use to threshold the data before tracking.SegmentationDatathreshold (
float) – Threshold. Feature values below the threshold are selected.neighbourhoodSearchRadius (
int) – Neighbourhood radius. Defaults toneighbourhoodSearchRadius
- Returns:
void – Acts on
TrackerDataobject directly and deletes selected data below threshold.- Return type:
(
-)- 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) –TrackerDatainstance.- 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.delSegArtefacts(this, neighbourhoodSearchRadius, varargin)¶
DELSEGARTEFACTS Deletes potential segmentation artefacts (segmented objects which are no cells based the autofluorescence.
- Parameters:
this (
obj) –TrackerDatainstance.neighbourhoodSearchRadius (
int) – Neighbourhood radius. Defaults toneighbourhoodSearchRadiusvarargin (
str varchar) –channel (
int): Channel numberfluo_idof the fluorescent channel to use for segmentation artefact detection. Defaults to 1.stdFactor (
float): Factor standard deviation. Defaults to 2.
- Returns:
void – Acts on
TrackerDataobject directly and deletes selected data.- Return type:
(
-)- Authors:
Andreas P. Cuny - initial implementation
- TracX.@TrackerData.findParentCandidatesTolerant(this, currentTrackIndex, frameNumber, fieldNameArray)¶
FINDPARENTCANDITATESTOLERANT Tolerant search for parent candidates.
- Parameters:
this (
object) –TrackerDatainstance.currentTrackIndex (
array, kx1) – Array of trackindex .frameNumber (
array, 1x1) – Current framefieldNameArray (
str) – fieldNameArray
- Return type:
void
-- Authors:
Andreas P. Cuny - initial implementation
Utils¶
- 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 (
arrayNx1) – Array of x components of segmented objects.yc (
arrayNx1) – 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.getBWLabelColor(colorMap)¶
GETBWLABELCOLOR Returns either a black or white colormap that should be well readable on an given input colorMap.
- Parameters:
colorMap (
arrayNx3) – Colormap- Returns:
color – BW colormap
- Return type:
(
arrayNx3)- Authors:
Thomas Kuendig - 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 (
double1xN) – Array to be sortedvarargin (
str) – Additional input arguments. See TracX.ExternalDependencies.natsortfiles for detailed information.
- Returns:
X (
array1xN) – Cell of Strings, <X> with all strings sorted into natural-order.ndx (
arrax1xN) – Numeric Array, such that Y = X(ndx). The same size as <X>.
- 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 (
array1xM) – Array where values have to be inserted.val (
array1xN) – Array with values to insert.idx (
int1x1) – Index withing arrIn where.
- Returns:
arrOut – Final array with inserts
- Return type:
(
array1x(M+N))- 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 (
uint16NxN) – Image matriximageCropCoordinateArray (
int1x4) – 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.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: []] matrixvarargin (
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:
(
arrayNxM)
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
- TracX.@Utils.imcrop3C(s, cuboidWindow)¶
IMCROP3C Custom fast implementation on Matlabs imcrop3 to crop a 3D image.
- Parameters:
s (
doubleNxNx3) – 3D image stackcuboidWindow (
array1x6) – Crop coordinates in the form of [x, y, z, w, h, l]
- Returns:
ret – Croped 3D image stack.
- Return type:
(
doubleNxNx3)- Authors:
Thomas Kuendig - initial implementation
- TracX.@Utils.getLeadingZeros(str)¶
GETLEADINGZEROS Get the number of leading zeros of a string.
- Parameters:
str (
str) – String.- Returns:
nLeadingZeros
- Return type:
intThe number of leading zeros.- 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.checkToolboxStatus(this)¶
CHECKTOOLBOXSTATUS Checks if all required Matlab toolboxes are installed. Returns 1 if all installed, 0 otherwise.
- Parameters:
this (
obj) –Trackerobject- Returns:
status – Returns 1 if all installed, 0 otherwise.
- Return type:
(
arrayNx3)- 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 (
arrayNx1) – Logical array including logicalB but of size logicalA.logicalAOnlyB (
arrayNx1) – Logical array of size logicalA but only containing logicalB.
- 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) –Utilsinstance.root (
int) – Root track indexcolor (
int) – Colorcolormap (
int, Nx3) – Color maptrackIndex (
array, Nx1) – Track index arraytrackParent (
array, Nx1) – Track parent array
- Returns:
colormap – Color map
- Return type:
arrayNx3- Authors:
Thomas Kuending - initial implementation
- TracX.@Utils.downloadFile(this, url, fileName)¶
DOWNLOADFILE Downloads a file and returns the path.
- Parameters:
this (
obj) –Trackerobjecturl (
str) – URL to the file to be downloadedfileName (
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
- class TracX.@Utils.Utils¶
UTILS Defines general utility functions used for TracX.
- Authors:
Andreas P. Cuny - initial implementation
- Constructor Summary
- Utils()¶
UTILS Constructor of TracX.Utils class.
- Returns:
obj – Returns a
Utilsinstance.- Return type:
object- Authors:
Andreas P. Cuny - initial implementation
- Method Summary
- checkToolboxStatus(this)¶
CHECKTOOLBOXSTATUS Checks if all required Matlab toolboxes are installed. Returns 1 if all installed, 0 otherwise.
- Parameters:
this (
obj) –Trackerobject- Returns:
status – Returns 1 if all installed, 0 otherwise.
- Return type:
(
arrayNx3)- Authors:
Andreas P. Cuny - initial implementation
- downloadFile(this, url, fileName)¶
DOWNLOADFILE Downloads a file and returns the path.
- Parameters:
this (
obj) –Trackerobjecturl (
str) – URL to the file to be downloadedfileName (
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
- getBWLabelColor(colorMap)¶
GETBWLABELCOLOR Returns either a black or white colormap that should be well readable on an given input colorMap.
- Parameters:
colorMap (
arrayNx3) – Colormap- Returns:
color – BW colormap
- Return type:
(
arrayNx3)- Authors:
Thomas Kuendig - initial implementation
- getColorMap(intendedSize, varargin)¶
GETCOLORMAP Returns a colormap of a user defined size with well distingushable colors.
- Parameters:
intendedSize (
int, 1x1) – Size of final colormapvarargin (
array, Nx3) – [Optional]customColorMapwhich 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:
(
arrayNx3)- Authors:
Andreas P. Cuny - initial implementation
- 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 (
arrayNx1) – Logical array including logicalB but of size logicalA.logicalAOnlyB (
arrayNx1) – Logical array of size logicalA but only containing logicalB.
- Authors:
Andreas P. Cuny - initial implementation
- getLeadingZeros(str)¶
GETLEADINGZEROS Get the number of leading zeros of a string.
- Parameters:
str (
str) – String.- Returns:
nLeadingZeros
- Return type:
intThe number of leading zeros.- Authors:
Andreas P. Cuny - initial implementation
- 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
- 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) –Utilsinstance.root (
int) – Root track indexcolor (
int) – Colorcolormap (
int, Nx3) – Color maptrackIndex (
array, Nx1) – Track index arraytrackParent (
array, Nx1) – Track parent array
- Returns:
colormap – Color map
- Return type:
arrayNx3- Authors:
Thomas Kuending - initial implementation
- 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 (
arrayNx1) – Array of x components of segmented objects.yc (
arrayNx1) – 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
- imcrop3C(s, cuboidWindow)¶
IMCROP3C Custom fast implementation on Matlabs imcrop3 to crop a 3D image.
- Parameters:
s (
doubleNxNx3) – 3D image stackcuboidWindow (
array1x6) – Crop coordinates in the form of [x, y, z, w, h, l]
- Returns:
ret – Croped 3D image stack.
- Return type:
(
doubleNxNx3)- Authors:
Thomas Kuendig - initial implementation
- imcropC(image, imageCropCoordinateArray)¶
IMCROPC Crop image. Custom imcrop function. Faster (~3.5-6x) than native MATLAB interactive imcrop function.
- Parameters:
image (
double, NxM) – Image matriximageCropCoordinateArray (
int, 1x4) – Array with coordinates to crop an image.imageCropCoordinateArray
- Returns:
crop – Croped image matrix.
- Return type:
(
doubleNxM)- Authors:
Andreas P. Cuny - initial implementation
- insertValueAtIdx(arrIn, val, idx)¶
INSERTVALUEATIDX Inserts an array of values a at a certain position within array b.
- Parameters:
arrIn (
array1xM) – Array where values have to be inserted.val (
array1xN) – Array with values to insert.idx (
int1x1) – Index withing arrIn where.
- Returns:
arrOut – Final array with inserts
- Return type:
(
array1x(M+N))- Authors:
Andreas P. Cuny - initial implementation
- 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
- 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 (
double1xN) – Array to be sortedvarargin (
str) – Additional input arguments. See TracX.ExternalDependencies.natsortfiles for detailed information.
- Returns:
X (
array1xN) – Cell of Strings, <X> with all strings sorted into natural-order.ndx (
arrax1xN) – Numeric Array, such that Y = X(ndx). The same size as <X>.
- Authors:
Andreas P. Cuny - initial implementation
- 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 (
uint16NxN) – Image matriximageCropCoordinateArray (
int1x4) – 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
- 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).
Note
Adopted from inital implementation from Nicolas Le Roux. https://ch.mathworks.com/matlabcentral/fileexchange/8076-ascii-progress-bar?s_tid=prof_contriblnk
- 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
- 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
- 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: []] matrixvarargin (
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
- 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
- rgb2java(rgb)¶
RGB2JAVA Convert uint8 rgb Matlab image to Java BufferedImage.
- Parameters:
rgb (
array, NxM) – RGB Matlab image- Returns:
image – Java BufferedImage
- Return type:
(
arrayNxM)
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
- 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 colormapvarargin (
array, Nx3) – [Optional]customColorMapwhich 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:
(
arrayNx3)- 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).
Note
Adopted from inital implementation from Nicolas Le Roux. https://ch.mathworks.com/matlabcentral/fileexchange/8076-ascii-progress-bar?s_tid=prof_contriblnk
- 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.imcropC(image, imageCropCoordinateArray)¶
IMCROPC Crop image. Custom imcrop function. Faster (~3.5-6x) than native MATLAB interactive imcrop function.
- Parameters:
image (
double, NxM) – Image matriximageCropCoordinateArray (
int, 1x4) – Array with coordinates to crop an image.imageCropCoordinateArray
- Returns:
crop – Croped image matrix.
- Return type:
(
doubleNxM)- 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