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 FrameProcessor under name.

The name is what a config processors entry uses as its type.

Parameters:

name (str)

mesofield.processors.registry.get_processor_class(name)[source]#

Return the registered class for name, or None.

Parameters:

name (str)

Return type:

Type | None

mesofield.processors.registry.available_processors()[source]#

Sorted list of registered processor type names.

Return type:

List[str]

mesofield.processors.registry.build_processor(spec, camera=None, default_name=None)[source]#

Build a FrameProcessor from a config spec.

spec is either a type-name string or a mapping with a type key. Remaining mapping keys are forwarded to the processor constructor (plot, sampling_rate, and the recognized plot-styling kwargs). enabled is ignored here – callers decide whether to build a disabled entry.

Raises ValueError for an unknown/missing type and TypeError for a spec that is neither a string nor a mapping.

Parameters:
  • spec (Any)

  • camera (Any | None)

  • default_name (str | None)

Return type:

Any