Syntax

Description

stats = regionprops3(BW,properties)
measures a set of properties for each connected component (object) in the 3-D
volumetric binary image BW. The output
stats is a table with height (number of rows) equal to the
number of objects in BW. The variables (columns) of the table
denote different properties for each region, as specified by
properties.

For all syntaxes, if you do not specify the properties
argument, regionprops3 returns the 'Volume',
'Centroid', and 'BoundingBox'
measurements.

stats = regionprops3(CC,properties)
measures a set of properties for each connected component (object) in
CC, which is a structure returned by bwconncomp.

stats = regionprops3(L,properties)
measures a set of properties for each labeled region in the 3-D label matrix
L.

stats = regionprops3(___,V,properties)
measures a set of properties for each labeled region in the 3-D volumetric grayscale
image V. The first input (BW,
CC, or L) identifies the regions in
V.

Input Arguments

BW — Volumetric binary image3-D logical array

Volumetric binary image, specified as a 3-D logical array.

Data Types: logical

CC — Connected componentsstructure

Connected components, specified as a structure returned by bwconncomp. The
CC structure must represent a 3-D image, that is,
CC.ImageSize must be a 1-by-3 vector. The
CC structure must also have been created using a
3-D connectivity value, such as 6, 18, or 26.

Data Types: struct

L — Label matrix3-D numeric array

Label matrix, specified as a 3-D numeric array.
regionprops3 treats negative-valued pixels as
background and rounds down input pixels that are not integers. Positive
integer elements of L correspond to different regions.
For example, the set of elements of L equal to
1 corresponds to region 1; the set of elements of
L equal to 2 corresponds to region
2; and so on.

Type of measurement, specified as a comma-separated list of strings or
character vectors, a cell array of strings or character vectors,
'all' or 'basic'. Property names
are case-insensitive and can be abbreviated.

If you specify 'all',
regionprops3 computes all the shape
measurements and, if you specified a grayscale image, all the pixel
value measurements.

If you specify 'basic' or do not specify the
properties argument, then
regionprops3 computes only the
'Volume', 'Centroid', and
'BoundingBox' measurements.

The following table lists all the properties that provide shape
measurements. The Voxel Value Measurements table
lists additional properties that are valid only when you specify a grayscale
image.

Shape Measurements

Property Name

Description

'BoundingBox'

Smallest cuboid containing the region, returned as a
1-by-6 vector of the form [ulf_x ulf_y ulf_z
width_x width_y width_z].
ulf_x, ulf_y, and
ulf_z specify the upper-left front
corner of the cuboid. width_x,
width_y, and
width_z specify the width of the
cuboid along each dimension.

'Centroid'

Center of mass of the region, returned as a 1-by-3
vector of the form [centroid_x centroid_y and
centroid_z]. The first element,
centroid_x, is the horizontal
coordinate (or x-coordinate) of the
center of mass. The second element,
centroid_y, is the vertical
coordinate (or y-coordinate). The
third element, centroid_z, is the
planar coordinate (or
z-coordinate).

'ConvexHull'

Smallest convex polygon that can contain the region,
returned as a p-by-3 matrix. Each row of
the matrix contains the x-,
y-, and
z-coordinates of one vertex of the
polygon.

'ConvexImage'

Image of the convex hull, returned as a volumetric binary
image (logical) with all voxels within
the hull filled in (set to on). The image
is the size of the bounding box of the region.

'ConvexVolume'

Number of voxels in 'ConvexImage',
returned as a scalar.

'EigenValues'

Eigenvalues of the voxels representing a region, returned
as a 3-by-1 vector. regionprops3 uses the
eigenvalues to calculate the principal axes lengths.

'EigenVectors'

Eigenvectors of the voxels representing a region,
returned as a 3-by-3 vector.
regionprops3 uses the eigenvectors to
calculate the orientation of the ellipsoid that has the same
normalized second central moments as the region.

'EquivDiameter'

Diameter of a sphere with the same volume as the region,
returned as a scalar. Computed as
(6*Volume/pi)^(1/3).

'Extent'

Ratio of voxels in the region to voxels in the total
bounding box, returned as a scalar. Computed as the value of
Volume divided by the volume of the
bounding box. [Volume/(bounding box width *
bounding box height * bounding box
depth)]

'Image'

Bounding box of the region, returned as a volumetric
binary image (logical) that is the same
size as the bounding box of the region. The
on voxels correspond to the region,
and all other voxels are off.

'Orientation'

Euler angles, returned as a 1-by-3 vector. The angles
are based on the right-hand rule.
regionprops3 interprets the
angles by looking at the origin along the
x-, y-,
and z-axis representing roll,
pitch, and yaw respectively. A positive angle represents
a rotation in the counterclockwise direction. Rotation
operations are not commutative so they must be applied
in the correct order to have the intended effect. For
more information, see References.

'PrincipalAxisLength'

Length (in voxels) of the major axes of the ellipsoid
that have the same normalized second central moments as the
region, returned as 1-by-3 vector.
regionprops3 sorts the values from
highest to lowest.

'Solidity'

Proportion of the voxels in the convex hull that are also
in the region, returned as a scalar. Computed as
Volume/ConvexVolume.

'SubarrayIdx'

Indices used to extract elements inside the object
bounding box, returned as a cell array such that
L(idx{:}) extracts the elements of
L inside the object bounding
box.

'SurfaceArea'

Distance around the boundary of the region, returned as a
scalar. For more information, see References.

'Volume'

Count of the actual number of 'on'
voxels in the region, returned as a scalar. Volume
represents the metric or measure of the number of voxels in
the regions within the volumetric binary image,
BW.

'VoxelIdxList'

Linear indices of the voxels in the region, returned as a
p-element vector.

'VoxelList'

Locations of voxels in the region, returned as a
p-by-3 matrix. Each row of the matrix
has the form [x y z] and specifies the
coordinates of one voxel in the region.

The voxel value measurement properties in the following table are valid
only when you specify a grayscale volumetric image,
V.

Voxel Value Measurements

Property Name

Description

'MaxIntensity'

Value of the voxel with the greatest intensity in the
region, returned as a scalar.

'MeanIntensity'

Mean of all the intensity values in the region, returned
as a scalar.

'MinIntensity'

Value of the voxel with the lowest intensity in the
region, returned as a scalar.

'VoxelValues'

Value of the voxels in the region, returned as a
p-by-1 vector, where
p is the number of voxels in the
region. Each element in the vector contains the value of a
voxel in the region.

'WeightedCentroid'

Center of the region based on location and intensity
value, returned as a p-by-3
vector of coordinates. The first element of
WeightedCentroid is the horizontal
coordinate (or x-coordinate) of the
weighted centroid. The second element is the vertical
coordinate (or y-coordinate). The third
element is the planar coordinate (or
z-coordinate).

Data Types: char | string | cell

V — Volumetric grayscale image3-D numeric array

Volumetric grayscale image, specified as a 3-D numeric array. The size of
the image must match the size of the binary image BW,
connected component structure CC, or label matrix
L.

Output Arguments

stats — Measurement valuestable

Measurement values, returned as a table. The number of rows in the table
corresponds to the number of objects in BW,
CC.NumObjects, or
max(L(:)). The variables
(columns) in each table row denote the properties calculated for each
region, as specified by properties.