Get affine implied by given shape and zooms
We get the translations from the center of the image (implied by shape).
Parameters : | shape : (N,) array-like
zooms : (N,) array-like
x_flip : {True, False}
|
---|---|
Returns : | aff : (4,4) array
|
Examples
>>> shape = (3, 5, 7)
>>> zooms = (3, 2, 1)
>>> shape_zoom_affine((3, 5, 7), (3, 2, 1))
array([[-3., 0., 0., 3.],
[ 0., 2., 0., -4.],
[ 0., 0., 1., -3.],
[ 0., 0., 0., 1.]])
>>> shape_zoom_affine((3, 5, 7), (3, 2, 1), False)
array([[ 3., 0., 0., -3.],
[ 0., 2., 0., -4.],
[ 0., 0., 1., -3.],
[ 0., 0., 0., 1.]])