params_mixins#

Mixins for params classes The OrthoviewerSlicingMixin provides orthoviewer-related functionality.

class HasSlicingFields(*args, **kwargs)[source]#

Bases: Protocol

Implemented by params classes that expose crop_* fields.

crop_x: List[int]#
crop_y: List[int]#
crop_z: List[int]#
class OrthoviewerSlicingMixin[source]#

Bases: object

Provides:
  • ratios -> np.ndarray([rx, ry, rz])

  • scale_axis(val, axis=’x’) / reverse_scale_axis(val, axis=’x’)

  • slice_tuples / slicing (if HasSlicingFields)

Defaults to ratios = resampled_resolution / raw_resolution.

Host must provide _get_view(). If the host has name, that channel is used. If not, set pipeline = ‘TubeMap’|’CellMap’|… OR set reference_channel explicitly. The first channel matching the pipeline (via CONTENT_TYPE_TO_PIPELINE) is used as fallback.

Tunables:
  • _target_space: ‘resampled’ | ‘native’ (default ‘resampled’)

  • set_target_space(‘resampled’|’native’)

reverse_scale_axis(val: float | int, axis: str = 'x') int[source]#
scale_axis(val: float | int, axis: str = 'x') int[source]#
set_target_space(space: Literal['resampled', 'native'])[source]#
property crop_x_max: int#
property crop_x_min: int#
property crop_y_max: int#
property crop_y_min: int#
property crop_z_max: int#
property crop_z_min: int#
pipeline: str | None = None#
property ratios: ndarray#
reference_channel: str | None = None#
property slice_tuples#
property slicing#