Article
Branching in the ALTRON graph: saving, averaging and displaying at the same time
Suppose you have a sample under the camera for several hours. You want to see a clean, low-noise image on the monitor, save all the raw data for later analysis, and, separately from these, take a snapshot every few seconds for a report. Three demands from one camera. In ALTRON this is done with branching in the graph.

What does branching mean?
Every ALTRON graph is made of nodes connected by wires. The camera is at the head of the chain. Processing comes next, and storage and display nodes come at the end. A node's output doesn't have to go to just one node. You can draw several wires from one node's output, and each wire creates a separate branch.
The branch itself does not copy the data, and all branches receive the same data. So an extra display or saving branch does not change the data in the other branches.
This is the most important decision. Each branch receives exactly the data that flows at the branch point:
- Split off the saving-for-analysis branch after the physical sensor corrections, such as black level and dark and white correction, but before cosmetic changes such as gamma.
- Put smoothing and sharpening that are only for the eye in the display branch, so the saved data stays untouched.
- If your own program needs to pick up data from the middle of the path, connect a Data Holder node right there. This node doesn't change the data; it only makes it available to external code.
Build this structure in Tools › Flow Graph Editor:
- First place the camera, then the basic corrections, for example the FlatFieldCorrection node for dark and white correction.
- From the output of the last correction, drag the first wire to a raw data saving node (RawData). This branch saves everything in full.
- Run the second wire to a Smoothing node with the Continuous Average stage, and feed its output to a display. This branch shows the smooth, averaged image.
- Connect the third wire directly to another display so you can also see the live, unaveraged data.
- Save the graph and press Recreate All in the main program. The change does not take effect until the chain is rebuilt.
For periodic snapshots, put an ImagingInterval node at the start of the branch and connect the saving node after it. It has three modes:
Be sure to check the Apply to saving too option. If it's ticked, the savers after this node record only the samples that pass, and you get a time-lapse recording. If it isn't ticked, decimation only lightens processing and display. In that case, while a saver from this same camera is recording, the node passes all the data so that nothing is missing from the recording.
Among ALTRON's default graphs there is also a ready-made example named Default_AreaScan_Color_Usb3+ImagingIntervalForDataSaving that you can start from.
- Putting gamma or sharpening before the saving branch point, then wondering why the saved data doesn't match the measurements.
- forgetting Recreate All after changing the graph.
- a heavy display branch slows down the entire chain. In the Performance tab, see which node takes the largest share of the CPU, and put an ImagingInterval in Max rate mode in front of it.
Before a long recording, run the graph for a few minutes and compare each node's input and output data rates in the Internal Info tab. If a node's output is suddenly lower than its input and that isn't intentional on your part, data is being dropped exactly at that node.
For a more general explanation of processing pipelines, see Wikipedia (English).
We have collected common questions about graphs and recording in our FAQ. If your graph needs a special structure, write to us via contact page and we'll design it together.