photon_mosaic.preprocessing.registration#
Classes
|
Apply pre-computed motion correction on-the-fly, whatever the backend. |
|
Epoch view that applies stored motion on read; backends implement |
|
Settings shared by every motion correction backend. |
- class photon_mosaic.preprocessing.registration.RegistrationSettings(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_prefix_target=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_file_depth=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_nested_max_split=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_show_env_vars=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_flag_prefix_char=None, _cli_implicit_flags=None, _cli_ignore_unknown_args=None, _cli_kebab_case=None, _cli_shortcuts=None, _secrets_dir=None, _build_sources=None, *, debug=False, tmp_dir=PosixPath('/scratch'), batch_size=500, device='cpu', nonrigid=True, max_nonrigid_shift=5, bounds=None)[source]#
Settings shared by every motion correction backend.
Only options that are meaningful for any backend live here; algorithm specific parameters belong on the subclass (e.g.
Suite2pRegistrationSettings), which is also expected to set its ownenv_prefix. The prefix here is deliberately not empty: without it these fields would read bareDEVICE/BATCH_SIZEfrom the environment.Shared fields carry one meaningful name; each field’s description records what the underlying library calls it (suite2p
maxregshiftNR, CaImAnpw_rigid, …).- debug: bool#
- tmp_dir: str | Path#
- batch_size: int#
- device: str#
- nonrigid: bool#
- max_nonrigid_shift: int#
- bounds: tuple[tuple[int | None, int | None], tuple[int | None, int | None]] | None#
- model_config = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'cli_avoid_json': False, 'cli_enforce_required': False, 'cli_exit_on_error': True, 'cli_flag_prefix_char': '-', 'cli_hide_none_type': False, 'cli_ignore_unknown_args': False, 'cli_implicit_flags': False, 'cli_kebab_case': False, 'cli_parse_args': None, 'cli_parse_none_str': None, 'cli_prefix': '', 'cli_prog_name': None, 'cli_shortcuts': None, 'cli_show_env_vars': False, 'cli_use_class_docs_for_groups': False, 'enable_decoding': True, 'env_file': '.env', 'env_file_depth': 0, 'env_file_encoding': None, 'env_ignore_empty': False, 'env_nested_delimiter': None, 'env_nested_max_split': None, 'env_parse_enums': None, 'env_parse_none_str': None, 'env_prefix': 'REGISTRATION_', 'env_prefix_target': 'variable', 'extra': 'forbid', 'json_file': None, 'json_file_encoding': None, 'nested_model_default_partial_update': False, 'protected_namespaces': ('model_validate', 'model_dump', 'settings_cached', 'settings_clear_cache', 'settings_customise_sources'), 'secrets_case_sensitive': None, 'secrets_dir': None, 'secrets_dir_max_size': None, 'secrets_dir_missing': None, 'secrets_nested_delimiter': None, 'secrets_nested_subdir': None, 'secrets_prefix': None, 'toml_file': None, 'validate_default': True, 'yaml_config_section': None, 'yaml_file': None, 'yaml_file_encoding': None}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class photon_mosaic.preprocessing.registration.RegisterImaging(imaging, motion, method='suite2p', **kwargs)[source]#
Apply pre-computed motion correction on-the-fly, whatever the backend.
Dispatch is by
method(likeMotion.compute()), defaulting to"suite2p", and resolved throughphoton_mosaic.core.get_registration_class(), so this class imports no backend itself.
- class photon_mosaic.preprocessing.registration.RegisterImagingEpoch(parent_imaging_epoch, motion, epoch_index, **kwargs)[source]#
Epoch view that applies stored motion on read; backends implement
_correct_plane().Holds the bookkeeping every backend shares – frame-bound checks, plane selection, output allocation – so a backend’s epoch class is only the per-plane correction.
Methods
get_series(start_frame, end_frame[, ...])Return motion-corrected frames
(n_frames, H, W, n_planes)for the requested interval and planes.
- photon_mosaic.preprocessing.registration.register_motion#
alias of
RegisterImaging