napari.utils.transforms.ScaleTranslate#
- class napari.utils.transforms.ScaleTranslate(scale=(1.0,), translate=(0.0,), *, name=None)[source]#
Bases:
Transform
n-dimensional scale and translation (shift) class.
Scaling is always applied before translation.
- Parameters:
scale (1-D array) – A 1-D array of factors to scale each axis by. Scale is broadcast to 1 in leading dimensions, so that, for example, a scale of [4, 18, 34] in 3D can be used as a scale of [1, 4, 18, 34] in 4D without modification. An empty translation vector implies no scaling.
translate (1-D array) – A 1-D array of factors to shift each axis by. Translation is broadcast to 0 in leading dimensions, so that, for example, a translation of [4, 18, 34] in 3D can be used as a translation of [0, 4, 18, 34] in 4D without modification. An empty translation vector implies no translation.
name (string) – A string name for the transform.
Methods
compose
(transform)Return the composite of this transform and the provided one.
expand_dims
(axes)Return a transform with added axes for non-visible dimensions.
set_slice
(axes)Return a transform subset to the visible dimensions.
Attributes
changed
Return the inverse transform.
Details
- compose(transform: Transform) Transform [source]#
Return the composite of this transform and the provided one.
- expand_dims(axes: Sequence[int]) ScaleTranslate [source]#
Return a transform with added axes for non-visible dimensions.
- property inverse: ScaleTranslate#
Return the inverse transform.