# outputLimits

Find output spatial limits given input spatial limits

## Syntax

``[xLimitsOut,yLimitsOut] = outputLimits(tform,xLimitsIn,yLimitsIn)``
``[xLimitsOut,yLimitsOut,zLimitsOut] = outputLimits(tform,xLimitsIn,yLimitsIn,zLimitsIn)``

## Description

example

````[xLimitsOut,yLimitsOut] = outputLimits(tform,xLimitsIn,yLimitsIn)` estimates the output spatial limits corresponding to a set of input spatial limits, `xLimitsIn` and `yLimitsIn`, given 2-D geometric transformation `tform`.```

example

````[xLimitsOut,yLimitsOut,zLimitsOut] = outputLimits(tform,xLimitsIn,yLimitsIn,zLimitsIn)` estimates the output spatial limits, given 3-D geometric transformation `tform`.```

## Examples

collapse all

Create an `affine2d` object that defines a rotation of 10 degrees counter-clockwise.

```theta = 10; tform = affine2d([cosd(theta) -sind(theta) 0; sind(theta) cosd(theta) 0; 0 0 1]);```
```tform = affine2d with properties: T: [3x3 double] Dimensionality: 2```

Estimate the output spatial limits, given the geometric transformation.

```[xlim, ylim] = outputLimits(tform,[1 240],[1 291]) ```
```xlim = 1.1585 286.8855 ylim = -40.6908 286.4054```

Create an `affine3d` object that defines a different scale factor in each dimension.

```Sx = 1.2; Sy = 1.6; Sz = 2.4; tform = affine3d([Sx 0 0 0; 0 Sy 0 0; 0 0 Sz 0; 0 0 0 1]);```
```tform = affine3d with properties: T: [4x4 double] Dimensionality: 3```

Estimate the output spatial limits, given the geometric transformation.

```[xlim, ylim, zlim] = outputLimits(tform,[1 128],[1 128],[1 27]) ```
```xlim = 1.2000 153.6000 ylim = 1.6000 204.8000 zlim = 2.4000 64.8000```

## Input Arguments

collapse all

Geometric transformation, specified as a geometric transformation object.

For 2-D geometric transformations, `tform` can be a `rigid2d`, `affine2d`, `projective2d`, `LocalWeightedMeanTransformation2D`, `PiecewiseLinearTransformation2D`, or `PolynomialTransformation2D` geometric transformation object.

For 3-D geometric transformations, `tform` can be an `affine3d` or `rigid3d` object.

Input spatial limits in the x-dimension, specified as a 1-by-2 numeric vector.

Data Types: `double`

Input spatial limits in the y-dimension, specified as a 1-by-2 numeric vector.

Data Types: `double`

Input spatial limits in the z-dimension, specified as a 1-by-2 numeric vector. Provide `zLimitsIn` only when `tform` is an `affine3d` object or a `rigid3d` object.

Data Types: `double`

## Output Arguments

collapse all

Output spatial limits in the x-dimension, returned as a 1-by-2 numeric vector.

Data Types: `double`

Output spatial limits in the y-dimension, returned as a 1-by-2 numeric vector.

Data Types: `double`

Output spatial limits in the z-dimension, returned as a 1-by-2 numeric vector. `outputLimits` returns `zLimitsIn` only when `tform` is an `affine3d` object or a `rigid3d` object.

Data Types: `double`

## Version History

Introduced in R2013a