BW3 = bwpropfilt3(BW,prop,range)
extracts all objects from a volumetric binary image, BW, whose value
of the property prop is in the specified range.
The function bwpropfilt3 returns a binary volume,
BW3, containing only those objects that meet the criteria.
BW3 = bwpropfilt3(BW,prop,n)
sorts the objects based on the value of the specified property prop,
and returns a binary volume that contains only the top n largest
objects. In the event of a tie for nth place,
bwpropfilt3 keeps only the first n objects in
BW3.
BW3 = bwpropfilt3(BW,prop,n,keep)
specifies whether to keep the n largest objects or the
n smallest objects when sorted by the property
prop.
BW3 = bwpropfilt3(BW,I,prop,___)
sorts objects based on the intensity values in the grayscale image I
and the property prop, in addition to any combination of input
arguments from previous syntaxes.
BW3 = bwpropfilt3(___,conn)
specifies the pixel connectivity conn.
Objects in Connected Component Structures
CC3 = bwpropfilt3(CC,prop,range)
returns the connected components in CC whose value of the property
prop is in the specified range.
CC3 = bwpropfilt3(CC,prop,n)
returns the top n largest connected components. In the event of a tie
for nth place, bwpropfilt3 keeps only the first
n objects in CC3.
CC3 = bwpropfilt3(CC,prop,n,keep)
specifies whether to keep the n largest connected components or the
n smallest connected components when sorted by the property
prop.
CC3 = bwpropfilt3(CC,I,prop,___)
sorts connected components based on the intensity values in the grayscale image
I and the property prop.
Volumetric binary image to be filtered, specified as a logical array.
Data Types: logical
Connected components to be filtered, specified as a structure. You can get a
connected component structure from a binary image using the bwconncomp function.
Data Types: struct
Name of the property on which to filter, specified as one of these values.
Voxel Value Measurements
Property Name
Description
Code Generation Support
"ConvexVolume"
Number of voxels in the convex hull of volumetric binary image
BW, returned as a scalar. The convex hull is the smallest
convex polyhedron that can contain the region.
No
"EquivDiameter"
Diameter of a sphere with the same volume as the region, returned as
a scalar. Calculated as (6*Volume/pi)^(1/3).
Yes
"Volume"
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.
Yes
"SurfaceArea"
Distance around the boundary of the region, returned as a scalar.
No
"Extent"
Ratio of voxels in the region to voxels in the total bounding box, returned
as a scalar, calculated as the value of Volume divided by the
volume of the bounding box.
Yes
"Solidity"
Proportion of the voxels in the convex hull that are also in the region,
returned as a scalar, calculated as Volume/ConvexVolume.
No
You can specify a voxel value measurement property from the following table when you
include a grayscale image, I, as an input argument to the
function.
Voxel Value Measurements
Property Name
Description
Code Generation Support
"MaxIntensity"
Value of the voxel with the greatest intensity in the region, returned as a
scalar.
Yes
"MeanIntensity"
Mean of all the intensity values in the region, returned as a
scalar.
Yes
"MinIntensity"
Value of the voxel with the lowest intensity in the region, returned as a
scalar.
Yes
Data Types: char | string
Minimum and maximum property values, specified as a 2-element numeric vector of the
form [lowhigh]. Values must be nondecreasing.
Number of objects to return, specified as a positive integer.
Data Types: double
Objects to retain, specified as "largest" or
"smallest".
Data Types: char | string
Marker image, specified as a grayscale image. Intensity values in the grayscale
image define regions in the input binary image. The marker image must be the same size
as the binary image BW or match the ImageSize
field of the connected component structure.
Pixel connectivity, specified as one of these values.
Value
Meaning
6
Pixels are connected if their faces touch. Two adjoining pixels are
part of the same object if they are both on and are
connected in:
One of these directions: in, out, left, right, up, or down
Current pixel is the center of the cube.
18
Pixels are connected if their faces or edges touch. Two adjoining
pixels are part of the same object if they are both on
and are connected in:
One of these directions: in, out, left, right, up, and down
A combination of two directions, such as right-down or
in-up
Current pixel is the center of the cube.
26
Pixels are connected if their faces, edges, or corners touch. Two
adjoining pixels are part of the same object if they are both
on and are connected in:
One of these directions: in, out, left, right, up, and down
A combination of two directions, such as right-down or
in-up
A combination of three directions, such as in-right-up or
in-left-down
Current pixel is the center of the cube.
Connectivity can also be defined in a more general way by specifying a
3-by-3-by-3 array of 0s and 1s. The
1-valued elements define neighborhood locations relative to the
center element of conn. The array must be symmetric about its center
element.
bwpropfilt3 supports the generation of C
code (requires MATLAB®
Coder™). Note that if you choose the generic MATLAB Host Computer
target platform, bwpropfilt3 generates code that uses a precompiled,
platform-specific shared library. Use of a shared library preserves performance optimizations
but limits the target platforms for which code can be generated. For more information, see Types of Code Generation Support in Image Processing Toolbox.
Supports only binary images or numeric label images. Input label images of data
type categorical are not supported.
Passing a cell array of properties is not supported. Use a comma-separated list
instead.
All properties are supported except "ConvexVolume",
"Solidity", and "SurfaceArea".
Refer to the usage notes and limitations in the C/C++ Code
Generation section. The same usage notes and limitations apply to GPU code generation.