主要内容

imrotate3

Rotate 3-D volumetric grayscale image

描述

example

B= imrotate3(V,角度,W)rotates the 3-D volumeVby角度逆时针绕过轴穿过原点的学位[0 0 0]W是一个1 x-3向量,指定3-D空间中旋转轴的方向。默认,imrotate3设置体素的值B在旋转卷的边界之外0

B= imrotate3(V,角度,W,method)还指定了插值方法。

B= imrotate3(V,角度,W,method,bbox)also specifies the size of the output volume,bbox。如果指定'庄稼', thenimrotate3makes the output volume the same size as the input volume. If you specify'松动的', thenimrotate3使输出量足够大,以包括整个旋转体积的整体。

B= imrotate3(___,“填充”,fillValues)设置用于输出像素的填充值,而输入图像中没有相应的像素。

Examples

collapse all

Load a 3-D volumetric grayscale image into the workspace, and display it.

s = load('MRI');Mrivolume = Squeeze(S.D);沃尔肖(Mrivolume);

Rotate the volume 90 degrees around the Z axis.

B = imrotate3(mriVolume,90,[0 0 1],“最近”,'松动的',“FillValues”,0);

Display the rotated output volume. You can also explore the volume in the Volume Viewer app.

沃尔肖(b);

Input Arguments

collapse all

旋转的音量, specified as a 3-D numeric array, 3-D logical array, or 3-D categorical array.

Data Types:single|double|int8|INT16|INT32|int64|uint8|UINT16|uint32|uint64|logical|分类

Rotation angle in degrees, specified as numeric scalar. To rotate the volume clockwise, specify a negative value for角度imrotate3makes the output volumeBlarge enough to contain the entire rotated 3-D volume.

Data Types:single|double|int8|INT16|INT32|int64|uint8|UINT16|uint32|uint64

旋转轴的方向in 3-D space in Cartesian coordinates, specified as a 1-by-3 numeric vector.

If you want to specify the direction of the axis of rotation in spherical coordinates, usesph2cartto convert values to Cartesian coordinates before passing it toimrotate3

例子:[0 0 1]旋转Z轴周围的音量

Data Types:single|double|int8|INT16|INT32|int64|uint8|UINT16|uint32|uint64|logical

Interpolation method, specified as one of the following values.

Method 描述
“最近”

最近的邻居插值。将输出体素分配给点落入其中的体素的值。不考虑其他体素。

Nearest-neighbor interpolation is the only method supported for categorical images and it is the default method for images of this type.

'linear'

Trilinear interpolation.

Trilinear interpolation is the default method for numeric and logical images.

'立方体'

Tricubic interpolation

Note

Tricubic interpolation can produce pixel values outside the original range.

Data Types:char|string

输出量的大小, specified as either of the following values.

Method 描述
'庄稼'

Make the output volume the same size as the input volume, cropping the rotated volume to fit.

'松动的'

使输出量足够大,以包含整个旋转量。通常,旋转体积大于输入体积。

Data Types:char|string

Fill values used for output pixels outside the input image, specified as one of the following values.imrotate3uses fill values for output pixels when the corresponding inverse transformed location in the input image is completely outside the input image boundaries.

Image Type

Format of Fill Values

Numeric image or logical image
  • Numeric scalar. The default fill value of numeric and logical images is0

Categorical image
  • 图像中的有效类别,指定为字符串标量或字符向量。

  • missing, which corresponds to the<未定义>category. This is the default fill value for categorical images. For more information, seemissing

Data Types:single|double|int8|INT16|INT32|int64|uint8|UINT16|uint32|uint64|logical|char|string

Output Arguments

collapse all

Rotated volume, returned as a numeric, logical, or categorical array of the same class as the input volume,V

提示

  • imrotate3假设输入卷Vis centered on the origin[0 0 0]。If your volume is not centered on the origin, then useImtranslateto translate the volume to[0 0 0]before usingimrotate3。您可以翻译输出量B返回与相反翻译向量的原始位置。

Extended Capabilities

Version History

Introduced in R2017a