registry#
Name registry + config factory for FrameProcessor subclasses.
Kept dependency-free (no import of mesofield.processors.base, which pulls
in PyQt6) so a subclass can register itself at import time without a circular
import. The factory only instantiates whatever class was registered.
A camera stanza in an experiment.json (or hardware.yaml) can opt a
processor in per-experiment:
"processors": [
{"type": "frame_mean", "enabled": true, "plot": true,
"label": "Mesoscope Frame Mean"}
]
Each entry is either a bare type name ("frame_mean") or a mapping with a
type plus constructor/plot options and an optional enabled toggle.
- mesofield.processors.registry.register_processor(name)[source]#
Class decorator registering a
FrameProcessorundername.The name is what a config
processorsentry uses as itstype.- Parameters:
name (str)
- mesofield.processors.registry.get_processor_class(name)[source]#
Return the registered class for
name, orNone.
- mesofield.processors.registry.available_processors()[source]#
Sorted list of registered processor type names.
- mesofield.processors.registry.build_processor(spec, camera=None, default_name=None)[source]#
Build a
FrameProcessorfrom a configspec.specis either a type-name string or a mapping with atypekey. Remaining mapping keys are forwarded to the processor constructor (plot,sampling_rate, and the recognized plot-styling kwargs).enabledis ignored here – callers decide whether to build a disabled entry.Raises
ValueErrorfor an unknown/missing type andTypeErrorfor a spec that is neither a string nor a mapping.