en_face_region
A configurable en-face measurement region.
Shared vocabulary rather than step-local config: every calculation step that measures over the en-face plane restricts itself to the SAME region, so scans acquired with different fields of view report comparable numbers.
Module
Functions
blank_region_to_none
def blank_region_to_none(value: Any) ‑> Any:Map an unset region to None, for use as a mode="before" validator.
A template exposes the region's sizes as variables, so an unset region
arrives as None, an empty mapping, or a mapping whose sizes are both
null (with a literal centre beside them). All of these mean "measure the
whole scan". A mapping with only one size set is passed through, so it
fails validation rather than silently measuring the whole scan.
Arguments
value: The rawanalysis_regionvalue.
Returns
None for a blank region, otherwise value unchanged.
Classes
AnalysisRegionConfigMixin
class AnalysisRegionConfigMixin(**data: Any):The analysis_region field shared by every region-aware step config.
Attributes
analysis_region: The en-face region to restrict measurements to, orNoneto measure the whole scan.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Subclasses
EnFaceRegionSpec
class EnFaceRegionSpec(**data: Any):An axis-aligned rectangle on the en-face plane, in millimetres.
Attributes
width_mm: Extent along a B-scan (the A-scan column axis).height_mm: Extent across B-scans (the slice axis).centre: What the rectangle is centred on.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Variables
- static
centre : RegionCentre
- static
height_mm : float
- static
model_config
- static
width_mm : float
Methods
describe
def describe(self) ‑> str:A one-line description for the report's region column.
Returns
For example "6 x 6 mm, fovea-centred".
RegionCentre
class RegionCentre(*args, **kwds):What the region is centred on.
FOVEA anchors on the fovea model's landmark, falling back to the scan
centre (flagged) when none is located. IMAGE_CENTRE always uses the scan
centre.
StrEnum, so a member is its own YAML/JSON representation and the
task_hash sees a plain string.