models

Pydantic models used throughout mio.

These models should be kept as generic as possible, and any refinements needed for a specific acquisition class should be defined within that module, inheriting from the relevant parent class. Rule of thumb: keep what is common common, and what is unique unique.

Data models :)

class mio.models.Container

Root model for models intended to be used as runtime data containers, eg. those that actually carry data from a buffer, rather than those that configure positions within a header.

See also: MiniscopeConfig

model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class mio.models.DenoiseConfig(*, id: Annotated[str, _PydanticGeneralMetadata(pattern='[\\w\\-\\/#]+')], mio_model: Annotated[str, AfterValidator(func=_is_identifier)] = None, mio_version: str = '0.11.0', interactive_display: InteractiveDisplayConfig | None = None, noise_patch: NoisePatchConfig | None = None, frequency_masking: FrequencyMaskingConfig | None = None, end_frame: int | None = None, minimum_projection: MinimumProjectionConfig | None = None, output_result: bool = True, output_dir: str | None = None)

Configuration for denoising a video.

end_frame: int | None
frequency_masking: FrequencyMaskingConfig | None
interactive_display: InteractiveDisplayConfig | None
minimum_projection: MinimumProjectionConfig | None
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

noise_patch: NoisePatchConfig | None
output_dir: str | None
output_result: bool
class mio.models.FrequencyMaskingConfig(*, id: Annotated[str, _PydanticGeneralMetadata(pattern='[\\w\\-\\/#]+')], mio_model: Annotated[str, AfterValidator(func=_is_identifier)] = None, mio_version: str = '0.11.0', enable: bool = True, cast_float32: bool = False, spatial_LPF_cutoff_radius: int, vertical_BEF_cutoff: int = 5, horizontal_BEF_cutoff: int = 0, output_result: bool = False, output_mask: bool = False, output_freq_domain: bool = False)

Configuration for frequency filtering. This includes a spatial low-pass filter and vertical and horizontal band elimination filters.

cast_float32: bool
enable: bool
horizontal_BEF_cutoff: int
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

output_freq_domain: bool
output_mask: bool
output_result: bool
spatial_LPF_cutoff_radius: int
vertical_BEF_cutoff: int
class mio.models.MiniscopeConfig

Root model for all configuration models, eg. those that are effectively static at runtime.

Note

Not named Config or BaseConfig because those are both in use already.

See also: Container

model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class mio.models.MiniscopeIOModel

Root model for all mio models

model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class mio.models.UpdateBatch(*, id: Annotated[str, _PydanticGeneralMetadata(pattern='[\\w\\-\\/#]+')], mio_model: Annotated[str, AfterValidator(func=_is_identifier)] = None, mio_version: str = '0.11.0', devices: list[DeviceUpdateEntry])

Batch update configuration. Only list form is supported:

devices: [DeviceUpdateEntry, …]

devices: list[DeviceUpdateEntry]
iter_updates(default_port: str | None) list[tuple[str | None, int, Literal['LED', 'GAIN', 'ROI_X', 'ROI_Y', 'SUBSAMPLE'], int]]

Yield (port, device_id, key, value) tuples for all updates in this batch.

model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].