Processor#
The datalab.gui.processor package provides the processor objects
for signals and images.
Processor objects are the bridge between the computation modules
(in sigima.proc) and the GUI modules (in datalab.gui).
They are used to call the computation functions and to update the GUI from inside
the data panel objects.
When implementing a processing feature in DataLab, the steps are usually the following:
Add an action in the
datalab.gui.actionhandlermodule to trigger the processing feature from the GUI (e.g. a menu item or a toolbar button).Implement the computation function in the
sigima.procmodule (that would eventually call the algorithm from thesigima.toolsmodule).Implement the processor object method in this package to call the computation function and eventually update the GUI.
The processor objects are organized in submodules according to their purpose:
datalab.gui.processor.base: Common processing featuresdatalab.gui.processor.signal: Signal processing featuresdatalab.gui.processor.image: Image processing features
Generic processing types#
To support consistent processing workflows, the BaseProcessor class defines
five generic processing methods, each corresponding to a fundamental input/output
pattern. These methods are tightly integrated with the GUI logic: the input objects
are taken from the current selection in the active panel (Signal or Image), and the
output objects are automatically appended to the same panel.
Descriptions:
compute_1_to_1: Applies an independent transformation to each selected object.compute_1_to_0: Runs an analysis or measurement producing metadata or scalar data.compute_1_to_n: Produces multiple output objects from a single input (e.g. ROI extraction).compute_n_to_1: Aggregates multiple objects into one (e.g. sum, average); supports pairwise mode.compute_2_to_1: Applies a binary operation with a second operand (object or constant); supports pairwise mode.
Method name |
Signature |
Multi-selection behavior |
|---|---|---|
|
1 object โ 1 object |
k โ k |
|
1 object โ no object |
k โ 0 |
|
1 object โ n objects |
k โ kยทn |
|
n objects โ 1 object |
n โ 1<br>n โ n (pairwise mode) |
|
1 object + 1 operand โ 1 object |
k + 1 โ k<br>n + n โ n (pairwise mode) |
These methods are for internal or advanced use (e.g. plugin or macro authors) and will evolve without backward compatibility guarantees.
Future developments (such as a visual pipeline editor) may require generalizing this model to support additional sources and destinations beyond the current panel-based selection/output logic.