Difference between revisions of "BigStitcher Global optimization"

Line 16: Line 16:
 
[[File:BigStitcher_optimize_simple1.png|center|600px]]
 
[[File:BigStitcher_optimize_simple1.png|center|600px]]
  
 +
The options available here are:
 +
 +
* '''Do not find wrong links nor handle not connected tiles:''' run the global optimization once, taking all the links in the tile-network (that were not filtered out previously) into consideration. This is the fastest strategy, but it might lead to bad results if you have not carefully filtered out bad pairwise shifts or if there are multiple unconnected regions.
 +
* '''Wrong link identification only:''' run the optimization iteratively, removing the worst link in the network until the average error of the tiles falls below certain thresholds (presets STRICT and RELAXED). This strategy is more robust against a few "bad" links, but will not move unconnected regions relative to each other.
 +
* '''Identify wrong links and handle unconnected Tiles:''' first, run optimization with wrong link identification (with threshold presets STRICT and RELAXED) and then use shifts from metadata to align connected components relative to each other (while keeping the results from the first round within a component). 
 +
* '''Show full options dialog:''' Allow for the manual setting of thresholds in the next step.
  
 
This will immediately update the tile locations in the BigDataViewer, if it is open. If you want to un-do this step, you can click {{bc|Remove Transformation|Latest/Newest Transformation}} in the main menu.  
 
This will immediately update the tile locations in the BigDataViewer, if it is open. If you want to un-do this step, you can click {{bc|Remove Transformation|Latest/Newest Transformation}} in the main menu.  
Line 29: Line 35:
 
In the first dialog, you will be asked for the optimization strategy to apply:
 
In the first dialog, you will be asked for the optimization strategy to apply:
  
* '''Simple One-Round:''' run the global optimization once, taking all the links in the tile-network (that were not filtered out previously) into consideration. This is the fastest strategy, but it might lead to bad results if you have not carefully filtered out bad pairwise shifts or if there are multiple unconnected regions.
+
* '''Simple One-Round:''' same as '''Do not find wrong links nor handle not connected tiles:''' (see above)
* '''One-Round with iterative dropping of bad links:''' run the optimization iteratively, removing the worst link in the network until the average error of the tiles falls below certain thresholds (see below). This strategy is more robust against a few "bad" links, but will not move unconnected regions relative to each other.
+
* '''One-Round with iterative dropping of bad links:''' same as '''Wrong link identification only:''' (see above)
* '''Two-Round using Metadata to align unconnected Tiles:''' first, run '''Two-Round using Metadata to align unconnected Tiles''' and then use shifts from metadata to align connected components relative to each other (while keeping the results from the first round within a component)
+
* '''Two-Round using Metadata to align unconnected Tiles:''' same as '''Identify wrong links and handle unconnected Tiles:''' (see above)
  
 
{{Notice|The computational cost of the global optimization is relatively minor in comparison to the pairwise shift calculation. We therefore recommend to use the '''Two-Round using Metadata to align unconnected Tiles''' strategy (and do so by default in the Simple Mode).}}
 
{{Notice|The computational cost of the global optimization is relatively minor in comparison to the pairwise shift calculation. We therefore recommend to use the '''Two-Round using Metadata to align unconnected Tiles''' strategy (and do so by default in the Simple Mode).}}

Revision as of 10:06, 14 January 2019

Intro

After calculating and previewing pairwise shift results you can proceed to the global optimization. Since the position of a tile with multiple neighbors is usually not unambiguously defined by the pairwise shifts, this step will iteratively update the transformations of the tiles until a consensus is reached that minimizes the deviation of each tile from the locations proposed by the calculated pairwise shifts.

Furthermore, we apply a few tweaks to improve the results:

  • If the global optimization does not find an alignment with sufficiently low error, we will automatically drop disagreeing links from the tile-network and re-run the process. In the worst case, this is repeated until we end up with a minimal spanning tree of the link network.
  • If there are multiple connected components in the link network (e.g. distant colonies of cells with large stretches of background between them where we cannot calculate reliable pairwise shifts), we will first align the components using the calculated pairwise shifts and then align the "islands" relative to each other using the locations defined in the metadata (or through manual pre-alignment).

Simple Mode

The simple mode of global optimization requires only selection of an optimization strategy and no explicit setting of the threshold parameters. The simple global optimization is run automatically if you click through the Stitching wizard (in no-expert mode) or can be accessed from the main menu under Optimize Globally And Apply Shift › Simple Mode.

BigStitcher optimize simple1.png

The options available here are:

  • Do not find wrong links nor handle not connected tiles: run the global optimization once, taking all the links in the tile-network (that were not filtered out previously) into consideration. This is the fastest strategy, but it might lead to bad results if you have not carefully filtered out bad pairwise shifts or if there are multiple unconnected regions.
  • Wrong link identification only: run the optimization iteratively, removing the worst link in the network until the average error of the tiles falls below certain thresholds (presets STRICT and RELAXED). This strategy is more robust against a few "bad" links, but will not move unconnected regions relative to each other.
  • Identify wrong links and handle unconnected Tiles: first, run optimization with wrong link identification (with threshold presets STRICT and RELAXED) and then use shifts from metadata to align connected components relative to each other (while keeping the results from the first round within a component).
  • Show full options dialog: Allow for the manual setting of thresholds in the next step.

This will immediately update the tile locations in the BigDataViewer, if it is open. If you want to un-do this step, you can click Remove Transformation › Latest/Newest Transformation in the main menu.



Expert Mode

If you click on Optimize Globally And Apply Shift › Expert Mode or proceed to the global optimization from the Stitching wizard in expert mode, you will be asked for a few extra parameters before the your views are aligned.

Optimization strategy and convergence criteria

In the first dialog, you will be asked for the optimization strategy to apply:

  • Simple One-Round: same as Do not find wrong links nor handle not connected tiles: (see above)
  • One-Round with iterative dropping of bad links: same as Wrong link identification only: (see above)
  • Two-Round using Metadata to align unconnected Tiles: same as Identify wrong links and handle unconnected Tiles: (see above)



If you opt for any of the iterative strategies, you have to consider the two error thresholds, which determine when to stop dropping bad links and re-doing the optimization:

  • relative error threshold: the optimization will be repeated until the largest error of any tile is smaller than the average error of all tiles times the threshold. Lowering this threshold emphasizes consistent quality of the alignment.
  • absolute error threshold: the optimization will be repeated until the average error of the tiles falls below this value, which should be set the average magnitude of displacements (in pixels) that is still "acceptable" after alignment.

Note that both stopping conditions have to be met for the optimization to finish.

  • show expert grouping options: click this to show expert grouping options in the next dialog (see below).
BigStitcher stitch 5.png

Expert view grouping

In the next two dialogs, you will be asked which views to include in the global optimization. They are the same as in BigStitcher_Advanced_stitching.

  • In the first dialog, you can select whether all instances of an attribute or just the currently selected views should be processed. For example, in the example below, we align all Channels, Tiles and Illuminations, but only for the currently selected timepoint and angle.
BigStitcher stitch 6.png
  • Select how to process the different attributes. For example, in the figure below, we will treat TimePoints and Angles individually, which means that we will run the global optimization separately for each time point and angle. Likewise, we group Channels and Illuminations, meaning that we will align all channels and illumination directions for a tile the same way. Finally, we compare Tiles, which means that tiles will be aligned relatively to each other.
BigStitcher stitch 8.png



Fixing views

Finally, you will be asked which view groups to fix in each subset that you chose to treat individually. The selected groups will be left where they are and all others will be aligned relative to them.

Note that if you select multiple fixed groups, it might lead to worse results as the original location (e.g. from metadata) might not agree with the calculated relative position of the views.

Normally, the best idea is to select one view group to fix, using it as a starting point that all other views will be moved relative to.

BigStitcher stitch 9.png

Go back to the main page