Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

imboxfilt3

3-D box filtering of 3-D images

Syntax

B = imboxfilt3(A)
B = imboxfilt3(A,filterSize)
B = imboxfilt3(___,Name,Value)

Description

example

B = imboxfilt3(A) filters the 3-D image A with a 3-D box filter, 3-by-3-by-3 in size.

B = imboxfilt3(A,filterSize) filters 3-D image A with a 3-D box filter with size specified by filterSize.

B = imboxfilt3(___,Name,Value) filters 3-D image A where Name-Value pairs control aspects of the filtering.

Examples

collapse all

Load 3-D image data into the workspace.

volData = load('mri');
vol = squeeze(volData.D);

Filter the image with a 3-D box filter.

localMean = imboxfilt3(vol,[5 5 3]);

Input Arguments

collapse all

Image to be filtered, specified as a real, nonsparse 3-D array.

If A contains Infs or NaNs, the behavior of imboxfilt3 is undefined. This can happen when integral image based filtering is used. To restrict the propagation of Infs and NaNs in the output, consider using imfilter instead.

Example: B = imboxfilt3(A);

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32

Size of box filter, specified as a scalar or 3-element vector of positive, odd integers. If filterSize is scalar, the filter is a cube.

Example: B = imboxfilt3(A,5);

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: B = imboxfilt3(A,5,'padding','circular');

collapse all

Padding pattern, specified as one of the following values or a numeric scalar. If you specify a scalar value, input image pixels outside the bounds of the image are implicitly assumed to have the scalar value.

ValueDescription
'circular'Input image values outside the bounds of the image are computed by implicitly assuming the input image is periodic.
'replicate'Input image values outside the bounds of the image are assumed equal to the nearest image border value.
'symmetric'Input image values outside the bounds of the image are computed by mirror-reflecting the array across the array border.

Example: B = imboxfilt3(A,5,'padding','circular');

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Normalization factor applied to box filter, specified as a numeric scalar.

The default 'NormalizationFactor' has the effect of a mean filter—the pixels in the output image are the local means of the image. To get local area sums, set 'NormalizationFactor' to 1. To avoid overflow in such circumstances, consider using double precision images by converting the input image to class double.

Example: B = imboxfilt3(A,5,'NormalizationFactor',1);

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Output Arguments

collapse all

Filtered image, returned as a real, nonsparse 3-D array.

Algorithms

imboxfilt performs filtering using either convolution-based filtering or integral image filtering, using an internal heuristic to determine which filtering approach to use.

Introduced in R2015b

Was this topic helpful?