de.unihalle.informatik.MiToBo.apps.singleCellTracking2D
Class CellTrackerBipartite

java.lang.Object
  extended by de.unihalle.informatik.Alida.operator.ALDOperator
      extended by de.unihalle.informatik.MiToBo.core.operator.MTBOperator
          extended by de.unihalle.informatik.MiToBo.apps.singleCellTracking2D.CellTrackerBipartite
All Implemented Interfaces:
de.unihalle.informatik.Alida.datatypes.ALDConfigurationValidator

@ALDAOperator(genericExecutionMode=ALL,
              level=STANDARD)
public class CellTrackerBipartite
extends MTBOperator


Nested Class Summary
 
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode
 
Field Summary
private  double currentMax
           
private  int DISAPPEARED
           
private static double inf
           
private  MTBImage inImg
           
(package private)  MTBImage labelImg
           
private  double maxAreaChange
           
private  double maxDist
           
private  java.util.Vector<java.lang.Integer> objectLabels
           
private  java.lang.Boolean objects8Connected
           
private  MTBImage resultImg
           
private  int sizeT
           
private  int sizeX
           
private  int sizeY
           
private  int totalNumberOfObjects
           
private  boolean useAutoDistance
           
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
completeDAG, name, portHashAccess, verbose, versionProvider
 
Constructor Summary
CellTrackerBipartite()
           
CellTrackerBipartite(MTBImage inImg)
           
 
Method Summary
private  byte[][] assign(MTBRegion2DSet currentRegions, MTBRegion2DSet nextRegions)
          assign regions from one frame to regions from another frame
private  int determineGatingDistance()
          automatic gating distance determination according to:

"Automated and semi-automated cell tracking: addressing portability challenges"
KAN, A. and CHAKRAVORTY, R. and BAILEY, J. and LECKIE, C. and MARKHAM, J. and DOWLING, M.R.
private  MTBImage drawRegions(MTBRegion2DSet regions)
           
private  double[][] getAreaFracMatrix(MTBRegion2DSet currRegions, MTBRegion2DSet nextRegions)
           
private  double getAreaFraction(MTBRegion2D r, MTBRegion2D s)
           
private  double getDistance(MTBRegion2D r, MTBRegion2D s)
           
private  double[][] getDistMatrix(MTBRegion2DSet currRegions, MTBRegion2DSet nextRegions)
           
 MTBImage getResultImage()
           
private  MTBRegion2DSet label(MTBImage img)
           
 void operate()
           
private  MTBImage relabel(byte[][] a, int n, int m, MTBRegion2DSet nextRegions)
          find and assign object labels to segmented objects in two frames
 void setMaxAreaChange(double t)
           
 void setMaxDistance(double t)
           
 void setObjectsEightConnected(boolean eightconnected)
           
private  void track()
          the actual tracking method
 void useAutoDistanceDetermination(boolean useAutoDistance)
           
private  void verbosePrintln(java.lang.String s)
          prints the given text if the verbose flag is set
 
Methods inherited from class de.unihalle.informatik.MiToBo.core.operator.MTBOperator
readResolve
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
deserializeFromXmlFile, fieldContained, getALDPortHashAccessKey, getConstructionMode, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterNames, getSupplementalNames, getVerbose, getVersion, isConfigured, parametersToXmlObject, print, print, print, printInterface, printInterface, readHistory, reinitializeParameterDescriptors, runOp, runOp, runOp, serializeToXmlFile, setConstructionMode, setName, setParameter, setParametersFromXml, setParametersFromXml, setVerbose, toStringVerbose, unconfiguredItems, validate, validateCustom, validateGeneric, writeHistory, writeHistory, writeHistory, writeParametersToXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentMax

private double currentMax

DISAPPEARED

private final int DISAPPEARED
See Also:
Constant Field Values

inf

private static double inf

inImg

@Parameter(label="binary input image",
           required=true,
           direction=IN,
           supplemental=false,
           description="binary input image")
private transient MTBImage inImg

labelImg

MTBImage labelImg

maxAreaChange

@Parameter(label="maximum area change",
           required=false,
           direction=IN,
           supplemental=false,
           description="maximum change in area (fraction) for two objects to be assigned to each other")
private double maxAreaChange

maxDist

@Parameter(label="maximum distance (pixels)",
           required=false,
           direction=IN,
           supplemental=false,
           description="maximum distance for two objects to be assigned to each other")
private double maxDist

objectLabels

private java.util.Vector<java.lang.Integer> objectLabels

objects8Connected

@Parameter(label="are objects 8-connected",
           required=false,
           direction=IN,
           supplemental=false,
           description="are objects 8-connected")
private java.lang.Boolean objects8Connected

resultImg

@Parameter(label="result image",
           required=true,
           direction=OUT,
           supplemental=false,
           description="result image")
private transient MTBImage resultImg

sizeT

private int sizeT

sizeX

private int sizeX

sizeY

private int sizeY

totalNumberOfObjects

private int totalNumberOfObjects

useAutoDistance

@Parameter(label="determine gating distance automatically",
           required=true,
           direction=IN,
           supplemental=false,
           description="determine gating distance automatically")
private boolean useAutoDistance
Constructor Detail

CellTrackerBipartite

public CellTrackerBipartite()
                     throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

CellTrackerBipartite

public CellTrackerBipartite(MTBImage inImg)
                     throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Parameters:
inImg -
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail

assign

private byte[][] assign(MTBRegion2DSet currentRegions,
                        MTBRegion2DSet nextRegions)
                 throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                        de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
assign regions from one frame to regions from another frame

Parameters:
currentRegions - vector containing the n regions from one frame
nextRegions - vector containing the m regions from another frame
Returns:
((n+m) x (n+m))-table containing assignments (entry == 1) of the input regions
rows: regions from the first frame, columns: regions from the second frame
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

determineGatingDistance

private int determineGatingDistance()
                             throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                                    de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
automatic gating distance determination according to:

"Automated and semi-automated cell tracking: addressing portability challenges"
KAN, A. and CHAKRAVORTY, R. and BAILEY, J. and LECKIE, C. and MARKHAM, J. and DOWLING, M.R.
Journal of Microscopy. Vol 244. Number 2. 2011

Throws:
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

drawRegions

private MTBImage drawRegions(MTBRegion2DSet regions)
Parameters:
regions -
Returns:
image where the regions are drawn with an intensity value corresponding to their ids + 1

getAreaFracMatrix

private double[][] getAreaFracMatrix(MTBRegion2DSet currRegions,
                                     MTBRegion2DSet nextRegions)
Parameters:
currRegions -
nextRegions -
Returns:
matrix containing the fractions of the areas of the input regions

getAreaFraction

private double getAreaFraction(MTBRegion2D r,
                               MTBRegion2D s)

getDistance

private double getDistance(MTBRegion2D r,
                           MTBRegion2D s)
Parameters:
r -
s -
Returns:
euclidean distance (pixels) between the centroids of r and s

getDistMatrix

private double[][] getDistMatrix(MTBRegion2DSet currRegions,
                                 MTBRegion2DSet nextRegions)
Parameters:
currRegions -
nextRegions -
Returns:
distance matrix for the given region sets

getResultImage

public MTBImage getResultImage()

label

private MTBRegion2DSet label(MTBImage img)
                      throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                             de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Parameters:
img - binary image
Returns:
set of regions from the binary image
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

operate

public void operate()
             throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                    de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Specified by:
operate in class de.unihalle.informatik.Alida.operator.ALDOperator
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

relabel

private MTBImage relabel(byte[][] a,
                         int n,
                         int m,
                         MTBRegion2DSet nextRegions)
find and assign object labels to segmented objects in two frames

Parameters:
a - assignment table
n - number of objects from the current frame
m - number of objects from the next frame
nextRegions - regions from the next frame
Returns:
frame where all connected components are labeled according to the assignments contained in a

setMaxAreaChange

public void setMaxAreaChange(double t)

setMaxDistance

public void setMaxDistance(double t)

setObjectsEightConnected

public void setObjectsEightConnected(boolean eightconnected)

track

private void track()
            throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                   de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
the actual tracking method

Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

useAutoDistanceDetermination

public void useAutoDistanceDetermination(boolean useAutoDistance)

verbosePrintln

private void verbosePrintln(java.lang.String s)
prints the given text if the verbose flag is set

Parameters:
s - text to print