IntegrationRoiManager
scanimage.components.IntegrationRoiManager, reachable as
hSI.hIntegrationRoiManager, computes intensity traces from integration ROIs while an
acquisition runs, and can drive analog or digital outputs from those traces.
See also
ROI Integration (Online Analysis) for the feature guide and IntegrationField API for building integration scanfields.
Properties
Property |
Description |
|---|---|
|
|
|
Enable the computation of intensity traces. |
|
Plot the traces. |
|
Number of samples retained in the trace history. Default 1000. |
|
Function handle applied to the integration values before they drive the outputs. |
|
Names of the configured output channels. |
|
The physical terminal each output channel is bound to. |
|
Logical array, one per output channel. |
|
Cell array of function handles, one per output channel, mapping integration values to an output value. |
|
The ROI each output channel evaluates. |
Methods
Method |
Description |
|---|---|
|
The most recent integration value for each ROI. |
|
The retained history, |
|
Re-read the configured
|
hSI.hIntegrationRoiManager.enable = true;
[rois,vals,ts] = hSI.hIntegrationRoiManager.getIntegrationValues();
for idx = 1:numel(rois)
fprintf('%s: %.3f\n',rois(idx).name,vals(idx));
end
% history, for plotting
[rois,hist,tHist] = hSI.hIntegrationRoiManager.getIntegrationHistory();
plot(tHist,hist);
Post processing and outputs
postProcessFcn runs on every update, before the output channel functions. It is the hook
for closed-loop experiments: threshold a trace, and drive an output.
The signature matches the shipped default,
scanimage.components.integrationRois.integrationPostProcessingFcn, which simply passes
the values through:
hSI.hIntegrationRoiManager.postProcessFcn = @myPostProcess;
function integrationValues = myPostProcess(rois,integrationDone,arrayIndices, ...
integrationValueHistory,integrationTimestampHistory,integrationFrameNumberHistory)
integrationValues = integrationValueHistory(arrayIndices);
% ... modify integrationValues here ...
end
Setting postProcessFcn to empty restores the default function.
Note
The post-process function and the output channel functions run inside the frame callback. Keep them short - work done here delays the display and, on a loaded system, the acquisition.
Events
updateAnalysisDisplay fires when new integration values are available;
resetIntegrationRoiDisplay fires when the display should be cleared, for example when the
ROI group changes.