Skip to content

Developers: The SuperSegger functions

Stella edited this page Jun 17, 2016 · 6 revisions

All the methods and their documentation can be found at http://mtshasta.phys.washington.edu/website/superSegger/index.html

The general flow is the following :

A general overview of the main functions :

GUIS

  • superSeggerGUI : to change names, crop images and start segmentation.
  • superSeggerViewerGUI : used for viewing the results of segmentation and post processing analysis.
  • trainingGUI : to train new segmentations parameters (Constants).

Main Function

  • BatchSuperSeggerOpti: runs everything from start to finish. It call the functions that align the images, set up the directory structure and segment the images, and then calls trackOpti which does the rest.

Image Alignment

  • trackOptiAlignPad : This is the alignment code, which corrects for microscope drift using the phase images. To keep as much data as possible, instead of cropping the resulting images it builds a larger image that encompases all drift positions. It saves the alignment information in a file called crop_box.mat

Internal functions of BatchSuperSeggerOpti

  • trackOptiPD : This sets up the directory structure and moves the aligned image files into their respective folders. intProcessXY: This for running the code in parallel: each xy position is hand to a separate processor.

Segmentation

  • doSeg : This is where all the initial segmentation happens. It calls the function in CONST.seg (for example ssoSegFun or ssoSegFunPerReg)
  • ssoSegFunPerReg : does the image segmentation
  • superSeggerOpti: find the segments (boundaries) and according to a scoring function decided which segments are good (true) or bad (false). It uses a local minimum filter to enhance contrast (magicContrastFast2) and then uses Matlab's WATERSHED command to generate cell boundaries. It determines the "good" and "bad" segments using the score calculated by the neural network in A (found in the CONST.seg) and the segments’ properties (under seg.info). The resulting segmented images are stored in the *seg.mat files in the seg/ directory. Note that these images are not ideally segmented because they do not use any temporal information.
  • Region Optimization: Segmentation is then optimized by using region characteristics (perRegionOpti). It turns off on and off segments using a systematic method, or simulated anneal, according to the number of segments to be considered. if the number of segments are more than MAX_NUM_RESOLVE it uses the rawScore if the number of segments are more than MAX_NUM_SYSTEMATIC it runs simulated anneal and if it is below that it uses a systematic function. The properties of a region are calculated using CONST.regionScoreFun.props and the score of a region is caclulate using the network CONST.regionScoreFun.E.

trackOpti

All the rest of the functions for segmentation are called from this function. After each sub-function is called, is creates a file in the seg/ directory that begins with .trackOpti (note the period before, you’ll have to have the hidden files visible to see those) and then the function name, e.g. .trackOptiLink.mat. This is designed for the situation when the segmentation dies somewhere in middle and you want to restart without having to recalculate everything; if these files exist, it won’t rerun that particular function again. If you do need to rerun one of these functions, you’ll have to delete the respective .trackOpti file for it to work.

Deleting small regions

  • trackOptiStripSmall : This removes regions that are far too small to be real, typically bubbles, dust, or minicells and fills in the holes in cells.

Region linking and error resolution

  • trackOptiLinkCellMulti: assigns each cell or pair of cells in the previous frame to a cell or pair of cells in the next frame. It assigns the same ID to a cell lineage, identifies a division event or changes segments if there is an assignment error. If there a change in segments is made it re-links the new regions and re-does the error resolution and ID assignment.
  • multiAssignmentFastOnlyOverlap : It assigns one cell to one or two cells according to the overlap area between the two frames. It uses the area change to decide whether one or more cells should be assigned. Faster than the next method, but fails if the overlap between cells is not high, for example in low frame rate or the edges of a big colony.
  • multiAssignmentPairs : A slower assignment code that is better for linking cells that do not overlap from frame to frame, for example if they are pushed outwards at the edge of a colony. It uses a combination of centroid location, area change, area overlap, and outward motion from the colony to create the assignments.
  • errorRez : Here is where the ids are actually given to cells and where errors in segmentation are resolved. Skip-Merge
  • trackOptiSkipMerge : This is run if the skip flag is greater than 1. It creates seg files for the skipped time points (with information from the segmented images) and stores them in a new directory called seg_full. It also re-runs the linking function with all the data.

Fluorescence background computation

  • trackOptiFluor: This is the first place where the fluorescence channels are used. This calculates basic fluor information, such as mean and integrated intensity, but NOT focus fitting.

Computing Cell Characteristics

  • trackOptiMakeCell : Computes cell characteristics and puts them in *err files under CellA{}. Fluorescence foci identification

Finding foci

  • trackOptiFindFoci: Calls the functions that fit the foic. This only runs if the number of foci to be fit is set in CONST.trackLoci.numSpots.
  • intFindFociCurve : finds the foci and assigns them to the cells.

Cells files and clist creation

  • trackOptiClist : creates the clist.mat file. Depending on the options, this can take a long time because it has to load every seg.mat file.
  • trackOptiCellFiles : creates all the cell files in the cell/ directory. An easy way to see if segmentation completed successfully is to check whether or not the cell directory has any cell files.

Visualization tools

  • superSeggerViewerGUI : used for viewing the results of segmentation and post processing analysis.

Post-Processing tools

  • gateHist : makes a histogram for the list of cells
  • gateHistDen : makes a histogram for the list of cells
  • gateHistDot : plots dot plot of two quantities in the clist.
  • plotClist3D : plots dot plot of two quantities in the clist.
  • makeCellMovie : creates a movie for a single cell file
  • makeConsensusArray : computes consensus fluorescence localization
  • makeConsensusImage : creates the consensus fluorescence localization images from output of makeConsensusArray
  • makeConsensusKymo : creates a consensus kymograph from output of makeConsensusArray
  • makeFrameMosaic : creates a tower for a single cell.
  • makeFrameStripeMosaic : creates a long stripe with all the cell towers.
  • makeKymoMosaic : creates a mosaic kymograph of multiple cells.
  • makeKymographC : creates a kymograph for given cell.
Clone this wiki locally